Forum Discussion

nagrajps's avatar
nagrajps
New Contributor
7 years ago

Failed to initialize pool: Database may be already in use: "C:/opt/snaplogic/run/bstore-Emirates_Training-sidekick-dev-1.mv.db"

2018-10-29T08:52:38,841 E main [ ] Error while loading web app configuration. Shutting down, please verify the jcc properties. javax.servlet.ServletException: JCC cannot be initialized properly [Failed to initialize pool: Database may be already in use: “C:/opt/snaplogic/run/bstore-Emirates_Training-sidekick-dev-1.mv.db”. Possible solutions: close all other connection(s); use the server mode [90020-182]]
at com.snaplogic.common.web.RequestFilter.init(RequestFilter.java:139) ~[jcc-4.0.jar:?]
at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:139) ~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletH~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]andler.java:725) ~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]

8 Replies

    • nagrajps's avatar
      nagrajps
      New Contributor

      My intention is to develop custom snaps, for that i have followed the below link http://developer.snaplogic.com, i was trying to do the setup in windows machine, after following couple of steps as per the above link i got this exception.

      Failed at this stage:

      $ cd ~/opt/snaplogic/run/lib
      $ java -jar jcc.war jcc
      

      Received Exception:
      2018-10-29T21:32:18,163 E main [ ] Error while loading web app configuration. Shutting down, please verify the jcc properties. javax.servlet.ServletException: JCC cannot be initialized properly [Failed to initialize pool: Database may be already in use: “C:/opt/snaplogic/run/bstore-Emirates_Training-sidekick-dev-1.mv.db”. Possible solutions: close all other connection(s); use the server mode [90020-182]]
      at com.snaplogic.common.web.RequestFilter.init(RequestFilter.java:139) ~[jcc-4.0.jar:?]
      at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:139) ~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:725) ~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348) ~[jetty-servlet-9.4.0.v20161208.jar:9.4.0.v20161208]
      at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480) ~[jetty-webapp-9.4.0.v20161208.jar:9.4.0.v20161208]

      Caused by: org.h2.jdbc.JdbcSQLException: Database may be already in use: “C:/opt/snaplogic/run/bstore-Emirates_Training-sidekick-dev-1.mv.db”. Possible solutions: close all other connection(s); use the server mode [90020-182]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.message.DbException.get(DbException.java:168) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:107) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.getPageStore(Database.java:2376) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.open(Database.java:666) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.openDatabase(Database.java:266) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.(Database.java:260) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Engine.openSession(Engine.java:60) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Engine.openSession(Engine.java:167) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Engine.createSessionAndValidate(Engine.java:145) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Engine.createSession(Engine.java:128) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Engine.createSession(Engine.java:26) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:347) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:108) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:92) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.Driver.connect(Driver.java:72) ~[h2-1.4.182.jar:1.4.182]
      at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:120) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:126) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:375) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:204) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:459) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:533) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:114) ~[HikariCP-2.7.5-SLCURRENTCONTEXT-1.jar:?]
      at com.snaplogic.cc.jstream.persistence.sql.DBType$1.initConnectionPool(DBType.java:221) ~[jcc-4.0.jar:?]
      at com.snaplogic.cc.jstream.persistence.sql.DBType$1.initialize(DBType.java:89) ~[jcc-4.0.jar:?]
      at com.snaplogic.cc.jstream.persistence.sql.SqlBackingStore.initialize(SqlBackingStore.java:75) ~[jcc-4.0.jar:?]
      at com.snaplogic.common.AppInitializer.initBackingStore(AppInitializer.java:521) ~[jcc-4.0.jar:?]
      at com.snaplogic.common.AppInitializer.initialize(AppInitializer.java:269) ~[jcc-4.0.jar:?]
      at com.snaplogic.common.web.RequestFilter.configureApplication(RequestFilter.java:303) ~[jcc-4.0.jar:?]
      at com.snaplogic.common.web.RequestFilter.init(RequestFilter.java:130) ~[jcc-4.0.jar:?]
      … 18 more
      Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/opt/snaplogic/run/bstore-Emirates_Training-sidekick-dev-1.mv.db [1.4.182/7]
      at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:762) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.FileStore.open(FileStore.java:170) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.MVStore.(MVStore.java:326) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2736) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.db.MVTableEngine$Store.(MVTableEngine.java:161) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:97) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.getPageStore(Database.java:2376) ~[h2-1.4.182.jar:1.4.182]
      at org.h2.engine.Database.open(Database.java:666) ~[h2-1.4.182.jar:1.4.182]

      • bgiles's avatar
        bgiles
        Former Employee

        If you are using a generic JDBC account try adding “AUTO_SERVER” = “TRUE” to the Url properties.

        You’ll also need to upload the h2 jar at ‘Jdbc jars’.

        If you’ve explicitly specified the database URL try appending “;AUTO_SERVER=TRUE” to the URL everywhere you call it. You’ll want to do the same if you start the server with a script.

        In any case you should start with a generic JDBC snap and account and verify that you can access the database with an existing snap. That lets you rule out any unexpected issues such as bad permissions, incompatible jars, etc., before you start developing your own code. That can save you a tremendous amount of effort down the road.

  • Looks like some stuff that wasn’t cleaned up when the JCC shut down. Can you delete the entire /opt/snaplogic/run directory and try starting the JCC back up?

    edit or the JCC is already running and you are trying to start another simultaneously

    edit 2 Can you try logging in and seeing if it’s connected to the dashboard, like in this step. If you see it connected, then no need to run java -jar jcc.war jcc as it’s already running.

    • nagrajps's avatar
      nagrajps
      New Contributor

      Thank you for the information, my issue got resolved , the reason for this issue the second point which you mentioned.

      I have proceed for next step and i am facing two other issues not related to the earlier one,

      Unable to write log sample file: log4j2-yarn.xml java.io.FileNotFoundException: c:\opt\snaplogic\run\lib\etc\log4j2-yarn.xml.sample (The system cannot find the path specified)

      2018-10-31T08:00:21,259 E main [ ] Error while loading web app configuration. Shutting down, please verify the jcc properties. java.io.IOException: keys.properties does not have any user for auth prefix: cc
      at com.snaplogic.common.ConfigurationManager.extractUsername(ConfigurationManager.java:366) ~[jcc-4.0.jar:?]
      at com.snaplogic.common.ConfigurationManager.readAuthPropertiesInto(ConfigurationManager.java:319) ~[jcc-4.0.jar:?]

      • tlikarish's avatar
        tlikarish
        Employee

        Have you downloaded the configuration files and put them on the machine?

        If not, can you open up the manager and navigate to your Snaplex. Then click the downloads tab and download the configuration. The file should go in c:\opt\snaplogic\etc