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

H2 database does not start when using a non-embedded runtime directory in tomcat #90

Closed
jenshp opened this issue Aug 18, 2016 · 3 comments

Comments

@jenshp
Copy link
Member

jenshp commented Aug 18, 2016

I am attempting to deploy moqui in tomcat (tried 7.0.54 and 8.0.32).
The runtime is specified in the MoquiInit.properties and is not embedded, so it will not be added to the system properties anymore. As the EntityFacade attempts to expand the URL for the database, it has no moqui.runtime system property and thus attempts to open the DB at the "/db" location instead of "${moqui_runtime}/db".

Following is the exception that results:

18-Aug-2016 15:48:23.562 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.moqui.impl.webapp.MoquiContextListener
bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named DEFAULT_transactional_DS
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:90)
at org.moqui.impl.context.TransactionInternalBitronix.getDataSource(TransactionInternalBitronix.groovy:133)
at org.moqui.impl.entity.EntityDatasourceFactoryImpl.init(EntityDatasourceFactoryImpl.groovy:82)
at org.moqui.impl.entity.EntityFacadeImpl.initAllDatasources(EntityFacadeImpl.groovy:191)
at org.moqui.impl.entity.EntityFacadeImpl.(EntityFacadeImpl.groovy:120)
at org.moqui.impl.context.ExecutionContextFactoryImpl.initEntityFacade(ExecutionContextFactoryImpl.groovy:689)
at org.moqui.impl.context.ExecutionContextFactoryImpl.(ExecutionContextFactoryImpl.groovy:197)
at org.moqui.impl.webapp.MoquiContextListener.contextInitialized(MoquiContextListener.groovy:69)
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: org.h2.jdbc.JdbcSQLException: Error while creating file "/db" [90062-192]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.store.fs.FilePathDisk.createDirectory(FilePathDisk.java:274)
at org.h2.store.fs.FileUtils.createDirectory(FileUtils.java:42)
at org.h2.store.fs.FileUtils.createDirectories(FileUtils.java:309)
at org.h2.store.fs.FileUtils.createDirectories(FileUtils.java:308)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:73)
at org.h2.engine.Database.getPageStore(Database.java:2463)
at org.h2.engine.Database.open(Database.java:692)
at org.h2.engine.Database.openDatabase(Database.java:270)
at org.h2.engine.Database.(Database.java:264)
at org.h2.engine.Engine.openSession(Engine.java:64)
at org.h2.engine.Engine.openSession(Engine.java:176)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
at org.h2.engine.Engine.createSession(Engine.java:137)
at org.h2.engine.Engine.createSession(Engine.java:27)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:118)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:102)
at org.h2.Driver.connect(Driver.java:72)
at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:190)
at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:353)
at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:422)
at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:52)
at bitronix.tm.resource.common.XAPool.createPooledObject(XAPool.java:472)
at bitronix.tm.resource.common.XAPool.growUntilMinPoolSize(XAPool.java:466)
at bitronix.tm.resource.common.XAPool.init(XAPool.java:105)
at bitronix.tm.resource.common.XAPool.(XAPool.java:98)
at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:99)
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:86)
... 20 more

@jonesde
Copy link
Member

jonesde commented Aug 19, 2016

I'll look into a solution for this. As a workaround you can specify the moqui.runtime explicitly in the Tomcat startup.

@jonesde
Copy link
Member

jonesde commented Aug 19, 2016

Would you try commit #785e3c2 and see if it works for you?

@jenshp
Copy link
Member Author

jenshp commented Aug 19, 2016

Yes, it works fine in commit #785e3c2

@jenshp jenshp closed this as completed Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants