[ 
https://issues.apache.org/jira/browse/SLING-3735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14224625#comment-14224625
 ] 

Julian Reschke commented on SLING-3735:
---------------------------------------

Tested successfully with Tomcat, but fails on Websphere (7) with:

{code}
8.11.2014 05:39:48.402 *ERROR* [FelixStartLevel] 
org.apache.sling.extensions.datasource 
[org.apache.sling.datasource.JNDIDataSourceFactory(5)] The activate method has 
thrown an exception (javax.naming.ConfigurationException: A JNDI operation on a 
"java:" name cannot be completed because the server runtime is not able to 
associate the operation's thread with any J2EE application component.  This 
condition can occur when the JNDI client using the "java:" name is not executed 
on the thread of a server application request.  Make sure that a J2EE 
application does not execute JNDI operations on "java:" names within static 
code blocks or in threads created by that J2EE application.  Such code does not 
necessarily run on the thread of a server application request and therefore is 
not supported by JNDI operations on "java:" names. [Root exception is 
javax.naming.NameNotFoundException: Name  not found in context "java:".])
javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot 
be completed because the server runtime is not able to associate the 
operation's thread with any J2EE application component.  This condition can 
occur when the JNDI client using the "java:" name is not executed on the thread 
of a server application request.  Make sure that a J2EE application does not 
execute JNDI operations on "java:" names within static code blocks or in 
threads created by that J2EE application.  Such code does not necessarily run 
on the thread of a server application request and therefore is not supported by 
JNDI operations on "java:" names.
        at 
com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:428)
        at 
com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:399)
        at 
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:221)
        at 
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:161)
        at javax.naming.InitialContext.lookup(InitialContext.java:436)
        at 
org.apache.sling.datasource.internal.JNDIDataSourceFactory.lookupDataSource(JNDIDataSourceFactory.java:120){code}

This appears to be caused by the fact that we are trying the JNDI access from a 
thread that is not managed by the J2EE.

> support JNDI lookup in JDBC DataSource Provider
> -----------------------------------------------
>
>                 Key: SLING-3735
>                 URL: https://issues.apache.org/jira/browse/SLING-3735
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Julian Reschke
>            Assignee: Chetan Mehrotra
>             Fix For: DataSource Provider 0.0.2
>
>
> It would be good if the DataSource provider would also support using a 
> DataSource that already exists and is available through JNDI.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to