[jboss-user] [JNDI and Naming] - Re: JNDI Lookup fails in JBoss AS 7 [java.naming.CommunicationException]
abiya
do-not-reply at jboss.com
Mon Dec 12 01:58:33 EST 2011
abiya [http://community.jboss.org/people/abiya] created the discussion
"Re: JNDI Lookup fails in JBoss AS 7 [java.naming.CommunicationException]"
To view the discussion, visit: http://community.jboss.org/message/640970#640970
--------------------------------------------------------------
Thanks for the reply Jaikiran. While using annotation I get the following exception during deployment,
Servlet /common threw load() exception: java.lang.IllegalArgumentException: Can not set javax.sql.DataSource field com.metreo.common.web.servlet.StartupServlet.ds to com.metreo.common.web.servlet.StartupServlet
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_24]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_24]
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) [:1.6.0_24]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_24]
at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_24]
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:152)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:77)
at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:99) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_24]
at java.lang.Thread.run(Unknown Source) [:1.6.0_24]
My servlet code is as follows,
***public
**
**class** StartupServlet **extends** HttpServlet{
*
@Resource(mappedName="java:jboss/datasources/weblogic.jdbc.jts.demopool")
**private** DataSource ds;
....
}
I am new to annotations and not sure what is wrong over here.
Thanks,
Abiya
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640970#640970]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111212/d613e287/attachment.html
More information about the jboss-user
mailing list