Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-1305

JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.3.4, core 1.4.1
    • Component/s: jackrabbit-core
    • Labels:
      None

      Description

      When using the org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory, the BundleDbPersistenceManager can not open a database connection via JNDI because the method DataSource.getConnection(user, password) is not supported. Instead, DataSource.getConnection() must be used for this to work.

      ConnectionFactory.getConnection should be changed to call this method if user name and password are empty.

        Activity

        Hide
        Guido Jäkel added a comment -

        > Could you check that there is no old jackrabbit-core in your classpath?

        Gotcha, thanks for analysis. But the mistake is up to the jackrabit team:

        Yes indeed, there is a wrong version in the path. But i forget to mention, that i'm using the jackrabbit-webapp.war because we're currently use RMI communication.

        I just take a closer look onto the contents of this war archive. Regardless what version of the other jackrabbit archives i will offer, this will have no effect – because this is a "stand alone" war and have included it's own copy of the libraries inside /WEB-INF/lib/.

        And (from my users point of view) you forgot to update it and should provide a updated jackrabbit-webapp-1.4.5.war including the latest version of (all of) the used libs:

        ---------------------------------

        1. unzip -l jackrabbit-webapp-1.4.war "/jackrabbit.jar"
          Archive: jackrabbit-webapp-1.4.war
          Length Date Time Name
                      • ---- ---- ----
                        1749859 01-11-08 14:41 WEB-INF/lib/jackrabbit-core-1.4.jar
                        9734 01-11-08 14:39 WEB-INF/lib/jackrabbit-api-1.4.jar
                        164719 01-11-08 14:39 WEB-INF/lib/jackrabbit-jcr-commons-1.4.jar
                        112033 01-11-08 14:39 WEB-INF/lib/jackrabbit-spi-commons-1.4.jar
                        23095 01-11-08 14:39 WEB-INF/lib/jackrabbit-spi-1.4.jar
                        33494 01-11-08 14:40 WEB-INF/lib/jackrabbit-text-extractors-1.4.jar
                        259610 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-server-1.4.jar
                        290856 01-11-08 14:43 WEB-INF/lib/jackrabbit-webdav-1.4.jar
                        31311 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-servlet-1.4.jar
                        217829 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-rmi-1.4.jar
                      • -------
                        2892540 10 files

        -------------------------------

        I've created an updated war by myself and it seems to work: At least, now it's starting up with the JNDI configuration...

        Thank you for quick help!

        Guido

        Show
        Guido Jäkel added a comment - > Could you check that there is no old jackrabbit-core in your classpath? Gotcha, thanks for analysis. But the mistake is up to the jackrabit team: Yes indeed, there is a wrong version in the path. But i forget to mention, that i'm using the jackrabbit-webapp.war because we're currently use RMI communication. I just take a closer look onto the contents of this war archive. Regardless what version of the other jackrabbit archives i will offer, this will have no effect – because this is a "stand alone" war and have included it's own copy of the libraries inside /WEB-INF/lib/. And (from my users point of view) you forgot to update it and should provide a updated jackrabbit-webapp-1.4.5.war including the latest version of (all of) the used libs: --------------------------------- unzip -l jackrabbit-webapp-1.4.war " /jackrabbit .jar" Archive: jackrabbit-webapp-1.4.war Length Date Time Name ---- ---- ---- 1749859 01-11-08 14:41 WEB-INF/lib/jackrabbit-core-1.4.jar 9734 01-11-08 14:39 WEB-INF/lib/jackrabbit-api-1.4.jar 164719 01-11-08 14:39 WEB-INF/lib/jackrabbit-jcr-commons-1.4.jar 112033 01-11-08 14:39 WEB-INF/lib/jackrabbit-spi-commons-1.4.jar 23095 01-11-08 14:39 WEB-INF/lib/jackrabbit-spi-1.4.jar 33494 01-11-08 14:40 WEB-INF/lib/jackrabbit-text-extractors-1.4.jar 259610 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-server-1.4.jar 290856 01-11-08 14:43 WEB-INF/lib/jackrabbit-webdav-1.4.jar 31311 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-servlet-1.4.jar 217829 01-11-08 14:43 WEB-INF/lib/jackrabbit-jcr-rmi-1.4.jar ------- 2892540 10 files ------------------------------- I've created an updated war by myself and it seems to work: At least, now it's starting up with the JNDI configuration... Thank you for quick help! Guido
        Hide
        Thomas Mueller added a comment -

        Hi,

        From the stack trace looks like you are not using Jackrabbit 1.4.5:

        java.lang.UnsupportedOperationException
        at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60)
        ...

        Line 60 of ConnectionFactory.java in Jackrabbit 1.4.5 does not call getConnection:
        if (user == null && password == null) {
        That means you are using an old version of Jackrabbit core.
        Could you check that there is no old jackrabbit-core in your classpath?

        Regards,
        Thomas

        Show
        Thomas Mueller added a comment - Hi, From the stack trace looks like you are not using Jackrabbit 1.4.5: java.lang.UnsupportedOperationException at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60) ... Line 60 of ConnectionFactory.java in Jackrabbit 1.4.5 does not call getConnection: if (user == null && password == null) { That means you are using an old version of Jackrabbit core. Could you check that there is no old jackrabbit-core in your classpath? Regards, Thomas
        Hide
        Guido Jäkel added a comment -

        Dear Thomas,

        please reopen this issue, it seems to be (still?) defect in 1.4.5!

        Trying to switch to the MySqlPersitanceManager and a Workspace Configuration like

        [...]
        <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
        <param name="driver" value="javax.naming.InitialContext"/>
        <param name="url" value="java:comp/env/jdbc/foo"/>
        <param name="schemaObjectPrefix" value="$

        {wsp.name}_"/>
        <param name="schema" value="mysql"/>
        </PersistenceManager>
        [...]

        To access to a database connection defined in a Tomcat environment i got:

        20080904-135101.532 ERROR [main] [] [RepositoryImpl] Unable to start repository, forcing shutdown...
        20080904-135101.533 INFO [main] [] [RepositoryImpl] Shutting down repository...
        20080904-135101.618 INFO [main] [] [RepositoryImpl] Repository has been shutdown
        20080904-135101.619 ERROR [main] [] [RepositoryImpl] failed to start Repository: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager: null
        javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager: null: null
        at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1163)
        at org.apache.jackrabbit.core.RepositoryImpl.access$700(RepositoryImpl.java:104)
        at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1727)
        at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1710)
        at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:569)
        at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:408)
        at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:304)
        at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:439)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:407)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:238)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:211)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
        Caused by: java.lang.UnsupportedOperationException
        at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.setupConnection(ConnectionRecoveryManager.java:328)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.<init>(ConnectionRecoveryManager.java:137)
        at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:558)
        at org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager.init(MySqlPersistenceManager.java:54)
        at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159)
        ... 38 more
        java.lang.UnsupportedOperationException
        at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.setupConnection(ConnectionRecoveryManager.java:328)
        at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.<init>(ConnectionRecoveryManager.java:137)
        at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:558)
        at org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager.init(MySqlPersistenceManager.java:54)
        at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159)
        at org.apache.jackrabbit.core.RepositoryImpl.access$700(RepositoryImpl.java:104)
        at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1727)
        at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1710)
        at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:569)
        at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:408)
        at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:304)
        at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:439)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:407)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:238)
        at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:211)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


        I think, \org\apache\jackrabbit\core\persistence\bundle\util\ConnectionFactory.java is still wrong at line 60ff. The thrown exception points out, that getConnection of the Pooled Datasource is called with user and passwort, which is illegal.

        if (user == null && password == null) { return ds.getConnection(); } else { return ds.getConnection(user, password); }

        May some other code accidentally set user and password to empty strings?

        Note: We're already using the feature of JNDI database connections, e.g.

        <FileSystem class="org.apache.jackrabbit.core.fs.db.JNDIDatabaseFileSystem">
        <param name="dataSourceLocation" value="java:comp/env/jdbc/foo"/>
        <param name="schemaObjectPrefix" value="${wsp.name}

        _"/>
        <param name="schema" value="mysql"/>
        </FileSystem>

        is in use without this problem.

        Show
        Guido Jäkel added a comment - Dear Thomas, please reopen this issue, it seems to be (still?) defect in 1.4.5! Trying to switch to the MySqlPersitanceManager and a Workspace Configuration like [...] <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager"> <param name="driver" value="javax.naming.InitialContext"/> <param name="url" value="java:comp/env/jdbc/foo"/> <param name="schemaObjectPrefix" value="$ {wsp.name}_"/> <param name="schema" value="mysql"/> </PersistenceManager> [...] To access to a database connection defined in a Tomcat environment i got: 20080904-135101.532 ERROR [main] [] [RepositoryImpl] Unable to start repository, forcing shutdown... 20080904-135101.533 INFO [main] [] [RepositoryImpl] Shutting down repository... 20080904-135101.618 INFO [main] [] [RepositoryImpl] Repository has been shutdown 20080904-135101.619 ERROR [main] [] [RepositoryImpl] failed to start Repository: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager: null javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager: null: null at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1163) at org.apache.jackrabbit.core.RepositoryImpl.access$700(RepositoryImpl.java:104) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1727) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1710) at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:569) at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:408) at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:304) at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:439) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:407) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:238) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:211) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Caused by: java.lang.UnsupportedOperationException at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.setupConnection(ConnectionRecoveryManager.java:328) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.<init>(ConnectionRecoveryManager.java:137) at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:558) at org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager.init(MySqlPersistenceManager.java:54) at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159) ... 38 more java.lang.UnsupportedOperationException at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:116) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:554) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory.getConnection(ConnectionFactory.java:60) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.setupConnection(ConnectionRecoveryManager.java:328) at org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.<init>(ConnectionRecoveryManager.java:137) at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:558) at org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager.init(MySqlPersistenceManager.java:54) at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159) at org.apache.jackrabbit.core.RepositoryImpl.access$700(RepositoryImpl.java:104) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1727) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1710) at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:569) at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:408) at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:304) at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:439) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:407) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:238) at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:211) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) I think, \org\apache\jackrabbit\core\persistence\bundle\util\ConnectionFactory.java is still wrong at line 60ff. The thrown exception points out, that getConnection of the Pooled Datasource is called with user and passwort, which is illegal. if (user == null && password == null) { return ds.getConnection(); } else { return ds.getConnection(user, password); } May some other code accidentally set user and password to empty strings? Note: We're already using the feature of JNDI database connections, e.g. <FileSystem class="org.apache.jackrabbit.core.fs.db.JNDIDatabaseFileSystem"> <param name="dataSourceLocation" value="java:comp/env/jdbc/foo"/> <param name="schemaObjectPrefix" value="${wsp.name} _"/> <param name="schema" value="mysql"/> </FileSystem> is in use without this problem.
        Hide
        Jukka Zitting added a comment -

        Merged to the 1.3 branch in revision 632349.

        Show
        Jukka Zitting added a comment - Merged to the 1.3 branch in revision 632349.
        Hide
        Thomas Mueller added a comment -

        Fixed in revision 613898 (branch 1.4).

        Show
        Thomas Mueller added a comment - Fixed in revision 613898 (branch 1.4).
        Hide
        Jukka Zitting added a comment -

        Yes, that would be nice. I recategorized this as a bug (incorrect use of DataSource) and tagged for 1.4.1.

        Show
        Jukka Zitting added a comment - Yes, that would be nice. I recategorized this as a bug (incorrect use of DataSource) and tagged for 1.4.1.
        Hide
        Thomas Mueller added a comment -

        Fixed in revision 613799 (trunk).
        Should I commit this change to 1.4 branch as well? I think yes.

        Show
        Thomas Mueller added a comment - Fixed in revision 613799 (trunk). Should I commit this change to 1.4 branch as well? I think yes.
        Hide
        Marcel May added a comment -

        It seems that for app server environment (eg JBoss) it works with a user/pwd in both app server datasource configuration and redundantly in the JK PM configuration.

        The only problem that remains is that for a corporate production environment and as an application provider,
        I often do not get the production db settings - only a configured datasource.

        So, this issue remains critical for me as I'd have to go for patching JK myself.
        I can provide this trivial patch as Thomas suggested.

        Show
        Marcel May added a comment - It seems that for app server environment (eg JBoss) it works with a user/pwd in both app server datasource configuration and redundantly in the JK PM configuration. The only problem that remains is that for a corporate production environment and as an application provider, I often do not get the production db settings - only a configured datasource. So, this issue remains critical for me as I'd have to go for patching JK myself. I can provide this trivial patch as Thomas suggested.
        Hide
        Marcel May added a comment -

        Using JK in an app server environment with managed connections, I'm not sure about how the app server will respond to getConnection(user,pwd).
        The connection from the pool is already authenticated. Guess the app server might not like it at all.

        Has anyone tested JK+JNDI Bundle conf in any application server?

        Can we get this fix into 1.4?

        We've been really looking forward to JNDI support

        Show
        Marcel May added a comment - Using JK in an app server environment with managed connections, I'm not sure about how the app server will respond to getConnection(user,pwd). The connection from the pool is already authenticated. Guess the app server might not like it at all. Has anyone tested JK+JNDI Bundle conf in any application server? Can we get this fix into 1.4? We've been really looking forward to JNDI support

          People

          • Assignee:
            Thomas Mueller
            Reporter:
            Thomas Mueller
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development