You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2008/01/10 15:10:34 UTC

[jira] Created: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
--------------------------------------------------------------------------------

                 Key: JCR-1305
                 URL: https://issues.apache.org/jira/browse/JCR-1305
             Project: Jackrabbit
          Issue Type: Improvement
          Components: jackrabbit-core
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller
            Priority: Minor


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561016#action_12561016 ] 

Thomas Mueller commented on JCR-1305:
-------------------------------------

Fixed in revision 613898 (branch 1.4). 

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Marcel May (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557994#action_12557994 ] 

Marcel  May commented on JCR-1305:
----------------------------------

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.

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1305:
-------------------------------

    Affects Version/s: 1.4
        Fix Version/s: 1.4.1
           Issue Type: Bug  (was: Improvement)

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

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Guido Jäkel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629415#action_12629415 ] 

Guido Jäkel commented on JCR-1305:
----------------------------------

> 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

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.3.4, core 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved JCR-1305.
---------------------------------

    Resolution: Fixed

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

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629184#action_12629184 ] 

Thomas Mueller commented on JCR-1305:
-------------------------------------

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



> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.3.4, core 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Marcel May (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557692#action_12557692 ] 

Marcel  May commented on JCR-1305:
----------------------------------

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 :-)

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1305:
-------------------------------

    Fix Version/s: 1.3.4

Merged to the 1.3 branch in revision 632349.

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.3.4, core 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1305) JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException

Posted by "Guido Jäkel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628330#action_12628330 ] 

Guido Jäkel commented on JCR-1305:
----------------------------------

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.

> JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException
> --------------------------------------------------------------------------------
>
>                 Key: JCR-1305
>                 URL: https://issues.apache.org/jira/browse/JCR-1305
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.4
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.3.4, core 1.4.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.