jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen More (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-1048) JNDIDatabaseFileSystem was not woring in tomcat webapp
Date Wed, 01 Aug 2007 19:55:53 GMT
JNDIDatabaseFileSystem was not woring in tomcat webapp
------------------------------------------------------

                 Key: JCR-1048
                 URL: https://issues.apache.org/jira/browse/JCR-1048
             Project: Jackrabbit
          Issue Type: Bug
          Components: core
    Affects Versions: 1.3
            Reporter: Stephen More


The new method should look like this:

protected Connection getConnection() throws NamingException, SQLException {

        InitialContext ic = new InitialContext();

        DataSource dataSource = null;
        try
        {
            dataSource = (DataSource) ic.lookup(dataSourceLocation);
        }
        catch( javax.naming.NameNotFoundException e )
        {
            // Now lets try it this way
            javax.naming.Context envCtx = (javax.naming.Context)ic.lookup( "java:comp/env"
);
            dataSource = (DataSource) envCtx.lookup(dataSourceLocation);
        }
        return dataSource.getConnection();
    }

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


Mime
View raw message