Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-14781

Fix error at startup when using nuxeo.db.singleDataSource=

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 5.9.5-SNAPSHOT
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Core VCS

      Description

      When using the following configuration in nuxeo.conf file, to disable single datasource:

      nuxeo.db.singleDataSource=
      

      The following error is shown:

      17:40:00,041 ERROR [MCFConnectionInterceptor] Error occurred creating ManagedConnection for handle: nullManagedConnectionInfo: org.apache.geronimo.connector.outbound.ManagedConnectionInfo@1f260171. mc: null]
      org.nuxeo.ecm.core.storage.StorageException: Connection error
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCBackend.initialize(JDBCBackend.java:92)
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createBackend(RepositoryImpl.java:211)
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.<init>(RepositoryImpl.java:134)
      	at org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl.initialize(ManagedConnectionFactoryImpl.java:289)
      	at org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:186)
      	at org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:49)
      	at org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor.getConnection(XAResourceInsertionInterceptor.java:41)
      	at org.apache.geronimo.connector.outbound.SinglePoolMatchAllConnectionInterceptor.internalGetConnection(SinglePoolMatchAllConnectionInterceptor.java:88)
      	at org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:80)
      	at org.apache.geronimo.connector.outbound.ThreadLocalCachingConnectionInterceptor.getConnection(ThreadLocalCachingConnectionInterceptor.java:70)
      	at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:49)
      	at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:101)
      	at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
      	at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
      	at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
      	at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:77)
      	at org.nuxeo.runtime.jtajca.NuxeoContainer$ConnectionManagerWrapper.allocateConnection(NuxeoContainer.java:935)
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:105)
      	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getSession(ConnectionFactoryImpl.java:176)
      	at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:132)
      	at org.nuxeo.ecm.core.api.local.LocalSession.connect(LocalSession.java:88)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:131)
      	at com.sun.proxy.$Proxy110.connect(Unknown Source)
      	at org.nuxeo.ecm.core.api.CoreInstance.acquireCoreSession(CoreInstance.java:185)
      	at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:179)
      	at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:82)
      	at org.nuxeo.ecm.core.api.UnrestrictedSessionRunner.runUnrestricted(UnrestrictedSessionRunner.java:131)
      	at org.nuxeo.ecm.platform.routing.core.listener.DocumentRoutingEscalationListener.triggerEsclationRulesExecution(DocumentRoutingEscalationListener.java:57)
      	at org.nuxeo.ecm.platform.routing.core.listener.DocumentRoutingEscalationListener.handleEvent(DocumentRoutingEscalationListener.java:51)
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:218)
      	at org.nuxeo.ecm.core.scheduler.EventJob.execute(EventJob.java:116)
      	at org.nuxeo.ecm.core.scheduler.EventJob.execute(EventJob.java:59)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
      Caused by: java.sql.SQLException: Cannot find datasource: repository_default
      	at org.nuxeo.runtime.datasource.ConnectionHelper.getDataSource(ConnectionHelper.java:962)
      	at org.nuxeo.runtime.datasource.ConnectionHelper.getConnection(ConnectionHelper.java:872)
      	at org.nuxeo.runtime.datasource.ConnectionHelper.getConnection(ConnectionHelper.java:847)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCBackend.initialize(JDBCBackend.java:87)
      	... 37 more
      Caused by: javax.naming.NameNotFoundException: Name [repository_default] is not bound in this Context. Unable to find [repository_default].
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
      	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
      	at javax.naming.InitialContext.lookup(InitialContext.java:411)
      	at org.nuxeo.runtime.api.DataSourceHelper.getDataSource(DataSourceHelper.java:130)
      	at org.nuxeo.runtime.api.DataSourceHelper.getDataSource(DataSourceHelper.java:118)
      	at org.nuxeo.runtime.datasource.ConnectionHelper.getDataSource(ConnectionHelper.java:952)
      	... 40 more
      

      Changes done on platform-demo module for NXP-14138 show how to declare the corresponding datasource, with the following property in nuxeo.conf:

      nuxeo.server.declare_datasources=false
      

      (see https://github.com/nuxeo/nuxeo-platform-forms-layout-demo/commit/63a2a01ba63ee43765aeb1b8a68b08738137e694)

      Note that layout-demo originally needed to disable single datasource because of NXP-11706 (see also NXP-12154)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: