1
I am getting below error when I am looking up a JNDI connection for jdbc datasource:
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:".]
On server startup, I have created a servlet init method using which I am starting my thread pool of rabbit MQ queues listener threads. Whenever there is some message in the queue, I have to process that message and insert it into the database. When trying to use the existing code of inserting into the database getting the above JNDI exception in WebSphere server. Any pointers will help.