Hi all,
I'm struggling with this error. I've included the resource ref in my web.xml and everything deploys cool, when I try do a jee:jndi lookup for my DS, I get the following:
Caused by: org.springframework.jndi.JndiLookupFailureExceptio n: JndiObjectTargetSource failed to obtain new target object; nested exception is javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime 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:".]
at org.springframework.jndi.JndiObjectTargetSource.ge tTarget(JndiObjectTargetSource.java:138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:184)
at $Proxy5.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DataSourceUtil s.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(DataSourceUtils.java:79)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:577)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:641)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:670)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:678)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:710)
at org.appfuse.dao.jdbc.JdbcMessageDao.getNextMessage (JdbcMessageDao.java:64)
at org.appfuse.service.impl.PersistentMessageAdapterI mpl.removeNext(PersistentMessageAdapterImpl.java:5 6)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unkno wn Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.util.MethodInvoker.invoke(Meth odInvoker.java:276)
at org.springframework.integration.util.NameResolving MethodInvoker.invokeMethod(NameResolvingMethodInvo ker.java:58)
at org.springframework.integration.message.MethodInvo kingMessageSource.receive(MethodInvokingMessageSou rce.java:84)
... 18 more
Caused by: javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime 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:".]
at com.ibm.ws.naming.java.javaURLContextImpl.throwCon figurationExceptionWithDefaultJavaNS(javaURLContex tImpl.java:416)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(j avaURLContextImpl.java:388)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java:205)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java:145)
at javax.naming.InitialContext.lookup(InitialContext. java:351)
at org.springframework.jndi.JndiTemplate$1.doInContex t(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(Jndi Template.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiT emplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiT emplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup (JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup( JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectTargetSource.ge tTarget(JndiObjectTargetSource.java:131)
... 35 more
Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInt ernal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal( NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpac e.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(Ur lContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(j avaURLContextImpl.java:384)
... 45 more
[5/14/09 16:49:30:895 SAST] 0000005d javaURLContex E NMSV0310E: 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. Exception stack trace:
javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".]
at com.ibm.ws.naming.java.javaURLContextImpl.throwCon figurationExceptionWithDefaultJavaNS(javaURLContex tImpl.java:411)


Reply With Quote
