• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • Tomcat error after deploying from source code

    Good afternoon all,

    I have been following the instructions located on the Confluence Board in order to deploy OpenSpecimen from the source code on Fedora 24. However, there is a hiccup towards the end. I do not perform the step involving eclipse, as this is being installed in a VM server for testing purposes. After I restart the Tomcat server, I cannot proceed with the MySQL to create a default institute, department, and user as the tables do not exist. During the “gradle deploy” command, I am not receiving any errors. I have tried accessing the front end, but Firefox does not show anything on the page (it is all white). If I check the services, Tomcat is running without any errors. If I look into /usr/share/tomcat/webapps/openspecimen/ I notice that there is no folder called “os_plugins” as I defined in build.properties. I have to manually create this directory, which then removes one error when starting Tomcat. This brings up a new error though, which states that it cannot find the JDBC jar. I have corrected this by creating a symlink from the mysql-connector-java.jar into the /usr/share/tomcat/webapps/openspecimen/WEB-INF/lib/ folder. There are further issues then as I look through Tomcat logs, the only file that is being updated after a Tomcat restart is /var/log/tomcat/catalina.2016-09-01.log. I am receiving the following error:

    01-Sep-2016 16:35:24.322 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
    01-Sep-2016 16:35:24.323 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler [“http-apr-8080”]
    01-Sep-2016 16:35:24.339 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler [“ajp-apr-8009”]
    01-Sep-2016 16:35:24.340 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
    01-Sep-2016 16:35:24.376 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler [“http-apr-8080”]
    01-Sep-2016 16:35:25.640 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.32
    01-Sep-2016 16:35:25.643 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 3 2016 11:06:06 UTC
    01-Sep-2016 16:35:25.643 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.32.0
    01-Sep-2016 16:35:25.644 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
    01-Sep-2016 16:35:25.645 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.6.7-300.fc24.x86_64
    01-Sep-2016 16:35:25.645 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
    01-Sep-2016 16:35:25.646 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.fc24.x86_64/jre
    01-Sep-2016 16:35:25.647 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_102-b14
    01-Sep-2016 16:35:25.648 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
    01-Sep-2016 16:35:25.649 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/share/tomcat
    01-Sep-2016 16:35:25.649 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat
    01-Sep-2016 16:35:25.651 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentpath:/usr/lib/abrt-java-connector/libabrt-java-connector.so=abrt=on
    01-Sep-2016 16:35:25.656 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
    01-Sep-2016 16:35:25.657 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat
    01-Sep-2016 16:35:25.658 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat
    01-Sep-2016 16:35:25.659 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=
    01-Sep-2016 16:35:25.659 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat/temp
    01-Sep-2016 16:35:25.660 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
    01-Sep-2016 16:35:25.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    01-Sep-2016 16:35:25.662 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.4 using APR version 1.5.2.
    01-Sep-2016 16:35:25.663 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
    01-Sep-2016 16:35:25.675 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2f 28 Jan 2016)
    01-Sep-2016 16:35:25.848 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“http-apr-8080”]
    01-Sep-2016 16:35:25.870 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“ajp-apr-8009”]
    01-Sep-2016 16:35:25.877 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1121 ms
    01-Sep-2016 16:35:25.923 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
    01-Sep-2016 16:35:25.927 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
    01-Sep-2016 16:35:25.974 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /var/lib/tomcat/webapps/openspecimen.war
    01-Sep-2016 16:35:26.856 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/openspecimen]]
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NullPointerException
    at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:304)
    at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:162)
    at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1890)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1128)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:780)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    … 10 more

    01-Sep-2016 16:35:26.860 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /var/lib/tomcat/webapps/openspecimen.war
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/openspecimen]]
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

    01-Sep-2016 16:35:26.863 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat/webapps/openspecimen.war has finished in 888 ms
    01-Sep-2016 16:35:26.864 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat/webapps/TestApp
    01-Sep-2016 16:35:27.559 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    01-Sep-2016 16:35:27.659 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat/webapps/TestApp has finished in 795 ms
    01-Sep-2016 16:35:27.666 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-apr-8080”]
    01-Sep-2016 16:35:27.685 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“ajp-apr-8009”]
    01-Sep-2016 16:35:27.690 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1812 ms

    Looking through this, I see that the following is the first error that it encounters:

    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/openspecimen]]

    I’m not actually sure what this means, but it is definitely stopping the webapp from getting published. Would anyone be able to assist me?

    Hi David,

    From given log not getting what is the exact issue. Please try out following

    1. Stop the tomcat.
    2. Put mysql connector jar into /usr/share/tomcat/lib folder. You can download mysql connector jar from here
    3. Start the tomcat.

    If still gets the error please share the catalina.out and localhost.2016-09-01.log files.

    Hi Vinod,

    Thanks for the quick response. First, I didn’t realize I was putting the mysql connector into the wrong lib folder. The current version that I have is mysql-connector-java.jar 5.1.38 that I got via dnf. I have now moved the symlink into /usr/share/tomcat/lib as you suggested. Once I had fixed that, localhost.2016-09-02.log file stated that I needed to set ‘lower_case_table_names = 1’ in my.cnf, which I have done and restarted both tomcat and mysqld.

    Oddly enough, I am still running into an issue, but the localhost.2016-09-02.log file hasn’t updated at all after I corrected the mysql issue, but I’ll share it anyway.

    Catalina.out (last modified Mar 3 2016):

    tomcat-8.0.32 RPM installed

    localhost.2016-09-02.log (last modified Sep 2 10:11):

    02-Sep-2016 10:06:41.230 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
    02-Sep-2016 10:06:42.218 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
    02-Sep-2016 10:07:21.278 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'os-liquibase' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set db/db-os-pre-conditions.xml::Pre condition to check the case sensitivity::nmarwaha:
         Reason:
              classpath:db/db-os-changelog-master-fresh.xml : OpenSpecimen expects case insensitive flag to be set in MySQL. Set 'lower_case_table_names = 1' in my.cnf or my.ini and restart MySQL database server
    
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
            at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
            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:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set db/db-os-pre-conditions.xml::Pre condition to check the case sensitivity::nmarwaha:
         Reason:
              classpath:db/db-os-changelog-master-fresh.xml : OpenSpecimen expects case insensitive flag to be set in MySQL. Set 'lower_case_table_names = 1' in my.cnf or my.ini and restart MySQL database server
    
            at liquibase.changelog.ChangeSet.execute(ChangeSet.java:485)
            at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
            at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
            at liquibase.Liquibase.update(Liquibase.java:200)
            at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:402)
            at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:366)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
            ... 25 more
    Caused by: liquibase.exception.PreconditionFailedException: Preconditions Failed
            at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:220)
            at liquibase.changelog.ChangeSet.execute(ChangeSet.java:471)
            ... 32 more
    02-Sep-2016 10:07:21.437 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
    02-Sep-2016 10:11:22.298 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
    02-Sep-2016 10:11:23.071 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
    02-Sep-2016 10:11:38.194 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'de-liquibase' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from openspecimen_test_db.DATABASECHANGELOGLOCK: Table 'openspecimen_test_db.databasechangeloglock' doesn't exist
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
            at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
            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:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from openspecimen_test_db.DATABASECHANGELOGLOCK: Table 'openspecimen_test_db.databasechangeloglock' doesn't exist
            at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:215)
            at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:154)
            at liquibase.Liquibase.update(Liquibase.java:186)
            at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:402)
            at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:366)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
            ... 25 more
    Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from openspecimen_test_db.DATABASECHANGELOGLOCK: Table 'openspecimen_test_db.databasechangeloglock' doesn't exist
            at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:121)
            at liquibase.lockservice.StandardLockService.init(StandardLockService.java:94)
            at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:188)
            ... 31 more
    Caused by: liquibase.exception.DatabaseException: Error executing SQL select count(*) from openspecimen_test_db.DATABASECHANGELOGLOCK: Table 'openspecimen_test_db.databasechangeloglock' doesn't exist
            at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
            at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:135)
            at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
            at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
            at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
            at liquibase.executor.jvm.JdbcExecutor.queryForInt(JdbcExecutor.java:187)
            at liquibase.executor.jvm.JdbcExecutor.queryForInt(JdbcExecutor.java:182)
            at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:118)
            ... 33 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'openspecimen_test_db.databasechangeloglock' doesn't exist
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
            at com.mysql.jdbc.Util.getInstance(Util.java:387)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2552)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2510)
            at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1370)
            at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:209)
            at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:209)
            at liquibase.executor.jvm.JdbcExecutor$QueryStatementCallback.doInStatement(JdbcExecutor.java:352)
            at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
            ... 40 more
    
    02-Sep-2016 10:11:38.269 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
    

    catalina.2016-09-02.log:

    02-Sep-2016 10:03:26.309 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
    02-Sep-2016 10:03:26.312 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-apr-8080"]
    02-Sep-2016 10:03:26.331 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-apr-8009"]
    02-Sep-2016 10:03:26.334 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
    02-Sep-2016 10:06:16.513 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.32
    02-Sep-2016 10:06:16.521 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Mar 3 2016 11:06:06 UTC
    02-Sep-2016 10:06:16.523 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.32.0
    02-Sep-2016 10:06:16.525 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
    02-Sep-2016 10:06:16.526 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.6.7-300.fc24.x86_64
    02-Sep-2016 10:06:16.531 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
    02-Sep-2016 10:06:16.533 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.fc24.x86_64/jre
    02-Sep-2016 10:06:16.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_102-b14
    02-Sep-2016 10:06:16.536 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
    02-Sep-2016 10:06:16.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/share/tomcat
    02-Sep-2016 10:06:16.538 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/share/tomcat
    02-Sep-2016 10:06:16.541 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentpath:/usr/lib/abrt-java-connector/libabrt-java-connector.so=abrt=on
    02-Sep-2016 10:06:16.542 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
    02-Sep-2016 10:06:16.544 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat
    02-Sep-2016 10:06:16.545 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat
    02-Sep-2016 10:06:16.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=
    02-Sep-2016 10:06:16.551 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat/temp
    02-Sep-2016 10:06:16.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
    02-Sep-2016 10:06:16.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    02-Sep-2016 10:06:16.555 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.4 using APR version 1.5.2.
    02-Sep-2016 10:06:16.558 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
    02-Sep-2016 10:06:16.579 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2f  28 Jan 2016)
    02-Sep-2016 10:06:17.035 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
    02-Sep-2016 10:06:17.108 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
    02-Sep-2016 10:06:17.118 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 3145 ms
    02-Sep-2016 10:06:17.248 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
    02-Sep-2016 10:06:17.254 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
    02-Sep-2016 10:06:17.385 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /var/lib/tomcat/webapps/openspecimen.war
    02-Sep-2016 10:06:41.060 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    02-Sep-2016 10:07:21.293 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
    02-Sep-2016 10:07:21.397 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/openspecimen] startup failed due to previous errors
    02-Sep-2016 10:07:21.485 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [openspecimen] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
     java.lang.Thread.sleep(Native Method)
     org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:104)
    02-Sep-2016 10:07:21.491 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [openspecimen] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
     java.lang.Object.wait(Native Method)
     java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
     com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
    02-Sep-2016 10:11:38.360 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat/webapps/openspecimen.war has finished in 40,015 ms
    02-Sep-2016 10:11:38.366 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat/webapps/TestApp
    02-Sep-2016 10:11:40.178 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat/webapps/TestApp has finished in 1,811 ms
    02-Sep-2016 10:11:40.193 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
    02-Sep-2016 10:11:40.251 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
    02-Sep-2016 10:11:40.258 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 42200 ms
    

    Looking at the localhost.2016-09-02.log file, it looks like the mysql tables weren’t created? Is this something that is supposed to happen during the “gradle deploy” command? If so, does this mean that I need to roll back the VM to a previous snapshot and make sure that the connector jar is in the right place before running the deploy?

    Hi David,

    There is no need to redeploy the build. Just drop the current database and recreate it and restart the tomcat it will work.

    Let me know how it goes.

    Hi Vinod,

    Looks like that did it! I had a little trouble dropping the database as a few tables were created such as DATABASECHANGELOG, DATABASECHANGELOGLOCK, DYEXTN_CONTAINERS, and DYEXTN_ID_SEQ. I had to go into /var/lib/mysql/openspecimen_test_db and manually delete them as the drop database; command failed. I then recreated the openspecimen_test_db database in mysql and started up tomcat and now I see a bunch of catissue and os tables in the database. If I go to localhost:8080/openspecimen, I am brought to the log in screen for OpenSpecimen! After inserting the proper Institution and User into the database, I can log in as well! Thank you so much for your assistance. I’m going to try to spin up another VM and get this working from scratch, hopefully without having to do too many workarounds and post my steps here for anyone else that may be encountering similar troubles.