Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema-validation: missing table [client_x_listColumn] #3998

Closed
2 tasks
matthias-ronge opened this issue Sep 18, 2020 · 3 comments · Fixed by #4412
Closed
2 tasks

Schema-validation: missing table [client_x_listColumn] #3998

matthias-ronge opened this issue Sep 18, 2020 · 3 comments · Fixed by #4412

Comments

@matthias-ronge
Copy link
Collaborator

matthias-ronge commented Sep 18, 2020

The SQL file kitodo_3-2.sql published with the release contains all table names in lower case, which does not work on Linux.

Log with full stack trace
SCHWERWIEGEND: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/kitodo]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.HibernateException: Schema-validation: missing table [client_x_listColumn]
    at org.kitodo.data.database.persistence.HibernateUtil.getSessionFactory(HibernateUtil.java:76)
    at org.kitodo.data.database.persistence.HibernateUtil.getSession(HibernateUtil.java:48)
    at org.kitodo.data.database.persistence.BaseDAO.getByQuery(BaseDAO.java:196)
    at org.kitodo.data.database.persistence.ListColumnDAO.getAllCustom(ListColumnDAO.java:55)
    at org.kitodo.production.services.data.ListColumnService.removeCustomListColumns(ListColumnService.java:181)
    at org.kitodo.production.helper.CustomListColumnInitializer.updateCustomColumnsInDatabase(CustomListColumnInitializer.java:114)
    at org.kitodo.production.helper.CustomListColumnInitializer.init(CustomListColumnInitializer.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
    at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.bootstrap.BeanDeploymentModule.fireEvent(BeanDeploymentModule.java:94)
    at org.jboss.weld.servlet.HttpContextLifecycle.fireEventForApplicationScope(HttpContextLifecycle.java:154)
    at org.jboss.weld.servlet.HttpContextLifecycle.contextInitialized(HttpContextLifecycle.java:142)
    at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:105)
    at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
    at org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:66)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5253)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    ... 10 more
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [client_x_listColumn]
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:121)
    at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
    at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:192)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:316)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:469)
    at org.kitodo.data.database.persistence.HibernateUtil.getSessionFactory(HibernateUtil.java:73)
    ... 37 more

Sep 18, 2020 2:09:19 PM org.apache.catalina.startup.HostConfig deployWAR
SCHWERWIEGEND: Error deploying web application archive /var/lib/tomcat8/webapps/kitodo.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/kitodo]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Sep 18, 2020 2:09:19 PM org.apache.catalina.startup.HostConfig deployWAR
INFORMATION: Deployment of web application archive /var/lib/tomcat8/webapps/kitodo.war has finished in 16,863 ms

Workaround: After loading the SQL file, manually execute the following SQL statements:

ALTER TABLE client_x_listcolumn RENAME TO client_x_listColumn;
ALTER TABLE ldapgroup RENAME TO ldapGroup;
ALTER TABLE ldapserver RENAME TO ldapServer;
ALTER TABLE listcolumn RENAME TO listColumn;
ALTER TABLE workflowcondition RENAME TO workflowCondition;

Goals:

  • Ship a working kitodo_3-2.sql file.
  • Update the release instructions that the database template must be created on Linux (on a case-sensitive file system).
@henning-gerhardt
Copy link
Collaborator

If you create the SQL schema file on Windows you get the table and other names in lower case. If you create the SQL schema file on Linux you get them in camel case or how you create them.

@matthias-ronge
Copy link
Collaborator Author

matthias-ronge commented Sep 18, 2020

Yes. There were a few more. I completed the description of the error.

@matthias-ronge
Copy link
Collaborator Author

The agreement is: in the future only table names in lower case letters. @matthias-ronge makes a pull request, which converts table names to lowercase letters.

matthias-ronge added a commit to matthias-ronge/kitodo-production that referenced this issue May 17, 2021
Kathrin-Huber pushed a commit to Kathrin-Huber/kitodo-production that referenced this issue Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants