1 Reply Latest reply on Aug 12, 2008 4:33 AM by jaikiran pai

    Jboss 5.0.0 Servlet Injection support. Problem!

    Jason Jiang Newbie

      I am trying JBoss5.0.0.CR1 and Inject a EJB to a servlet, but alway throw below exception

      public class XXManagerServlet extends HttpServlet {
      
       @EJB(mappedName="xxx-ear/XXXXMgrBean/local")
       private XXXMgr xxMgr;
      


      2008-08-07 09:45:24,059 ERROR [org.jboss.injection.lang.reflect.FieldBeanProperty] failed to set value XXMgrBean on field private com.xxx.xx.XXXMgr com.xxx.xx.servlet.XXXManagerServlet.xMgr
      java.lang.IllegalArgumentException: Can not set com.xxxx.xxx.XXXMgr field com.xxx.xx.servlet.XXXManagerServlet.xMgr to $Proxy280
       at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
       at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
       at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
       at java.lang.reflect.Field.set(Field.java:657)
       at org.jboss.injection.lang.reflect.FieldBeanProperty.set(FieldBeanProperty.java:74)
       at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:96)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.processAnnotations(TomcatInjectionContainer.java:260)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:166)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:183)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:90)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:96)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:325)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)