1 Reply Latest reply on Apr 19, 2016 10:11 AM by Horia Chiorean

    Database Persistence cannot connect to Oracle XE 11.2

    Dirk Michaelsen Newbie

      I'm trying to connect Modeshape 5 Database Persistence to an Oracle XE 11.2 database running locally on my developer machine. Modeshape is not able to connect to the database. However, when I use Oracle SQLDeveloper I can connect to the database with the given credentials.

       

      I'm using Oracle's JDBC driver ojdbc14.jar version 10.2.0.2.0. This is my JSON config file:

       

      {

          "name" : "repository",

          "workspaces" : {

              "predefined" : ["otherWorkspace"],

              "default" : "default",

              "allowCreation" : true

          },

          "storage" : {

              "persistence" : {

                  "type" : "db",

                  "connectionUrl" : "jdbc:oracle:thin:@127.0.0.1:1521:xe",

                  "driver" : "oracle.jdbc.OracleDriver",

                  "username" : "modeshape",

                  "password" : "modeshape"

              } ,   

              "binaryStorage" : {

                  "type" : "file",

              "directory" : "repository",

                  "minimumBinarySizeInBytes" : 4096,

                  "minimumStringSize" : 4096

              }

          },

          "security" : {

              "anonymous" : {

                  "useOnFailedLogin" : false

              },

              "providers" : [

                  {

                      "classname" : "de.edeka.lunar.jcr.edi.util.PicketBoxSecurityProvider"

                  }

              ]

          }

      }

       

      When I try to connect I get this stacktrace:

       

      javax.jcr.RepositoryException: Error while starting 'repository' repository: Exception during pool initialization: HikariPool-0 - Connection is not available, request timed out after 30001ms.

        at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:634)

        at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:598)

        at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:135)

        at de.edeka.lunar.jcr.edi.util.JcrSessionManager.openSession(JcrSessionManager.java:55)

        at de.edeka.lunar.jcr.edi.ReadTestData.main(ReadTestData.java:17)

      Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Exception during pool initialization: HikariPool-0 - Connection is not available, request timed out after 30001ms.

        at com.zaxxer.hikari.pool.HikariPool.initializeConnections(HikariPool.java:526)

        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:136)

        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:94)

        at org.modeshape.persistence.relational.DataSourceManager.newConnection(DataSourceManager.java:117)

        at org.modeshape.persistence.relational.DataSourceManager.<init>(DataSourceManager.java:58)

        at org.modeshape.persistence.relational.RelationalDb.<init>(RelationalDb.java:62)

        at org.modeshape.persistence.relational.RelationalProvider.getDB(RelationalProvider.java:34)

        at org.modeshape.persistence.relational.RelationalProvider.getDB(RelationalProvider.java:27)

        at org.modeshape.schematic.Schematic.getDbFromProvider(Schematic.java:91)

        at org.modeshape.schematic.Schematic.lambda$getDb$9(Schematic.java:74)

        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

        at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812)

        at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)

        at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)

        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)

        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)

        at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)

        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

        at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)

        at org.modeshape.schematic.Schematic.getDb(Schematic.java:76)

        at org.modeshape.jcr.Environment.getDb(Environment.java:59)

        at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1034)

        at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:936)

        at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:367)

        at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:632)

        ... 4 more

      Caused by: java.sql.SQLTransientConnectionException: HikariPool-0 - Connection is not available, request timed out after 30001ms.

        at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:195)

        at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:147)

        at com.zaxxer.hikari.pool.HikariPool.initializeConnections(HikariPool.java:510)

        ... 28 more