Websphere - access datasource in server start [message #1270855] |
Thu, 13 March 2014 16:56 |
Rene Eigenheer Messages: 109 Registered: July 2009 |
Senior Member |
|
|
Dear all
Deploying a scout application to IBM Websphere (8.5) I face an error, when I try to connect via JNDI to a datasource out of the ServerApplication class.
The error I get is the following:
Caused by: 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 comp/env/jdbc not found in context "java:".]
I'll guess that Scout starts the ServerAppliccation on a new Thread - correct?
Is there a possibility to add some startup code somewhere on a scout extension which is executed on a thread which makes Websphere happy to connect to JNDI?
TIA
Rene
|
|
|
Powered by
FUDForum. Page generated in 0.03155 seconds