glassfish
  1. glassfish
  2. GLASSFISH-902

Need improved error message for catching static injection

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 3.1.1_b01
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      902

      Description

      An improved error message is needed for when a user attempts to inject a
      resource (such as an EntityManager) into a static field. The current stack trace
      and message are nowhere near related to such a problem.

      Example stack trace:
      Exception creating stateless session bean : [

      {0}

      ]
      com.sun.enterprise.InjectionException: Exception attempting to inject Env-Prop:
      com.simunex.snx.core.dao.ejb3.EJB3DAOFactory/em@Field-Injectable Resource. Class
      name = com.simunex.snx.core.dao.ejb3.EJB3DAOFactory Field
      name=em@java.lang.String@@@ into class com.simunex.snx.core.dao.ejb3.EJB3DAOFactory
      at
      com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373)
      at
      com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193)
      at
      com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114)
      at
      com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
      ...

      test case:

      Bean.java
      ==
      @Stateless @Interceptors(

      {DAO.class}

      )
      public class Bean
      {
      public void doThis() {}
      }

      DAO.java
      ==
      public class DAO
      {
      @PersistenceUnit(unitName = "em")
      private static EntityManager em;
      }

        Issue Links

          Activity

          Hide
          Hong Zhang added a comment -

          This should be fixed in the Glassfish v1 FCS build already. Can you let us know
          which build you are using?

          And could you please also attach the complete stack trace? Thanks.

          Show
          Hong Zhang added a comment - This should be fixed in the Glassfish v1 FCS build already. Can you let us know which build you are using? And could you please also attach the complete stack trace? Thanks.
          Hide
          sbalmos added a comment -

          This is in v2b10 & 11.

          Full trace log entry (and the eventual nested exception) is below

          [#|2006-08-07T23:23:19.623-0400|INFO|sun-appserver-pe9.1|javax.enterprise.system.container.ejb|_ThreadID=18;_ThreadName=httpWorkerThread-8080-1;|EJB5070:
          Exception creating stateless session bean : [

          {0}

          ]
          com.sun.enterprise.InjectionException: Exception attempting to inject Env-Prop:
          com.simunex.snx.core.dao.ejb3.EJB3DAOFactory/em@Field-Injectable Resource. Class
          name = com.simunex.snx.core.dao.ejb3.EJB3DAOFactory Field
          name=em@java.lang.String@@@ into class com.simunex.snx.core.dao.ejb3.EJB3DAOFactory
          at
          com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373)
          at
          com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193)
          at
          com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114)
          at
          com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
          at
          com.sun.ejb.containers.StatelessSessionContainer.access$100(StatelessSessionContainer.java:96)
          at
          com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:746)
          at
          com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186)
          at
          com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566)
          at
          com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133)
          at $Proxy91.startSession(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145)
          at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
          at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at
          com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
          at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
          at
          com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
          Caused by: com.sun.enterprise.InjectionException: Illegal use of static field
          private static javax.persistence.EntityManager
          com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports
          instance-based injection
          at
          com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:292)
          ... 45 more

          #]

          [#|2006-08-07T23:23:19.623-0400|SEVERE|sun-appserver-pe9.1|javax.enterprise.resource.webservices.jaxws.server.PeptTie|_ThreadID=18;_ThreadName=httpWorkerThread-8080-1;_RequestID=b76b3122-d8c4-4594-9a02-3e2094279707;|nested
          exception is: javax.ejb.EJBException: nested exception is:
          javax.ejb.CreateException: Could not create stateless EJB
          javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested
          exception is: javax.ejb.CreateException: Could not create stateless EJB
          javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could
          not create stateless EJB
          javax.ejb.CreateException: Could not create stateless EJB
          at
          com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:554)
          at
          com.sun.ejb.containers.StatelessSessionContainer.access$100(StatelessSessionContainer.java:96)
          at
          com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:746)
          at
          com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186)
          at
          com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566)
          at
          com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133)
          at $Proxy91.startSession(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145)
          at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
          at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at
          com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
          at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
          at
          com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
          Caused by: com.sun.enterprise.InjectionException: Exception attempting to inject
          Env-Prop: com.simunex.snx.core.dao.ejb3.EJB3DAOFactory/em@Field-Injectable
          Resource. Class name = com.simunex.snx.core.dao.ejb3.EJB3DAOFactory Field
          name=em@java.lang.String@@@ into class com.simunex.snx.core.dao.ejb3.EJB3DAOFactory
          at
          com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373)
          at
          com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193)
          at
          com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114)
          at
          com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
          ... 42 more
          Caused by: com.sun.enterprise.InjectionException: Illegal use of static field
          private static javax.persistence.EntityManager
          com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports
          instance-based injection
          at
          com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:292)
          ... 45 more
          javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could
          not create stateless EJB
          at
          com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:748)
          at
          com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186)
          at
          com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566)
          at
          com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133)
          at $Proxy91.startSession(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145)
          at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
          at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at
          com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
          at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
          at
          com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)
          javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested
          exception is: javax.ejb.CreateException: Could not create stateless EJB
          at
          com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:474)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566)
          at
          com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133)
          at $Proxy91.startSession(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
          at
          com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145)
          at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
          at
          com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182)
          at
          com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
          at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at
          com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251)
          at
          com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
          at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
          at
          com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)

          #]
          Show
          sbalmos added a comment - This is in v2b10 & 11. Full trace log entry (and the eventual nested exception) is below [#|2006-08-07T23:23:19.623-0400|INFO|sun-appserver-pe9.1|javax.enterprise.system.container.ejb|_ThreadID=18;_ThreadName=httpWorkerThread-8080-1;|EJB5070: Exception creating stateless session bean : [ {0} ] com.sun.enterprise.InjectionException: Exception attempting to inject Env-Prop: com.simunex.snx.core.dao.ejb3.EJB3DAOFactory/em@Field-Injectable Resource. Class name = com.simunex.snx.core.dao.ejb3.EJB3DAOFactory Field name=em@java.lang.String@@@ into class com.simunex.snx.core.dao.ejb3.EJB3DAOFactory at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373) at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193) at com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114) at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518) at com.sun.ejb.containers.StatelessSessionContainer.access$100(StatelessSessionContainer.java:96) at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:746) at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186) at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469) at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566) at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133) at $Proxy91.startSession(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145) at com.sun.xml.ws.server.Tie.handle(Tie.java:88) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90) at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182) at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103) Caused by: com.sun.enterprise.InjectionException: Illegal use of static field private static javax.persistence.EntityManager com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports instance-based injection at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:292) ... 45 more #] [#|2006-08-07T23:23:19.623-0400|SEVERE|sun-appserver-pe9.1|javax.enterprise.resource.webservices.jaxws.server.PeptTie|_ThreadID=18;_ThreadName=httpWorkerThread-8080-1;_RequestID=b76b3122-d8c4-4594-9a02-3e2094279707;|nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB javax.ejb.CreateException: Could not create stateless EJB at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:554) at com.sun.ejb.containers.StatelessSessionContainer.access$100(StatelessSessionContainer.java:96) at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:746) at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186) at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469) at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566) at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133) at $Proxy91.startSession(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145) at com.sun.xml.ws.server.Tie.handle(Tie.java:88) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90) at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182) at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103) Caused by: com.sun.enterprise.InjectionException: Exception attempting to inject Env-Prop: com.simunex.snx.core.dao.ejb3.EJB3DAOFactory/em@Field-Injectable Resource. Class name = com.simunex.snx.core.dao.ejb3.EJB3DAOFactory Field name=em@java.lang.String@@@ into class com.simunex.snx.core.dao.ejb3.EJB3DAOFactory at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373) at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193) at com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114) at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518) ... 42 more Caused by: com.sun.enterprise.InjectionException: Illegal use of static field private static javax.persistence.EntityManager com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports instance-based injection at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:292) ... 45 more javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:748) at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186) at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:469) at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566) at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133) at $Proxy91.startSession(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145) at com.sun.xml.ws.server.Tie.handle(Tie.java:88) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90) at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182) at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103) javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:474) at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566) at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:133) at $Proxy91.startSession(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586) at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145) at com.sun.xml.ws.server.Tie.handle(Tie.java:88) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160) at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:90) at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:182) at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:619) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:550) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:780) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:326) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:251) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103) #]
          Hide
          ksak added a comment -

          The specific cause is contained in the stack trace :

          >>Caused by: com.sun.enterprise.InjectionException: Illegal use of static field
          >>private static javax.persistence.EntityManager
          >>com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports
          >>instance-based injection

          Granted, it's not easy to find that within the large stack traces. That's a more general problem being
          investigated within glassfish. There might already be a different issue filed for that but for now
          reassigning this to ejb container.

          Show
          ksak added a comment - The specific cause is contained in the stack trace : >>Caused by: com.sun.enterprise.InjectionException: Illegal use of static field >>private static javax.persistence.EntityManager >>com.simunex.snx.core.dao.ejb3.EJB3DAOFactory.em on class that only supports >>instance-based injection Granted, it's not easy to find that within the large stack traces. That's a more general problem being investigated within glassfish. There might already be a different issue filed for that but for now reassigning this to ejb container.
          Hide
          vince kraemer added a comment -

          error message improvement initiative

          Show
          vince kraemer added a comment - error message improvement initiative
          Hide
          marina vatkina added a comment -

          It's as simple as add a message from the cause to the new exception

          Show
          marina vatkina added a comment - It's as simple as add a message from the cause to the new exception
          Hide
          Cheng Fang added a comment -

          This is the stacktrace from 3.2 build (the line numbers have changed a lot since v2):

          [#|2011-03-21T17:17:46.594-0400|WARNING|glassfish3.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=23;_ThreadName=T
          hread-1;|StandardWrapperValve[test.TestServlet]: PWC1382: Allocate exception for servlet test.TestServlet
          com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class test.TestServlet
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:317)
          at com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:702)
          at com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:1968)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1263)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1070)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
          at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
          at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
          at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
          at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
          at java.lang.Thread.run(Thread.java:680)
          Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Local ejb-ref name=test.TestServl
          et/testBean,Local 3.x interface =test.TestBean resolved to intra-app EJB TestBean in module test,ejb-link=TestBean,lookup=,mappedName=,jndi-
          name=,refType=Session into class test.TestServlet
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:698)
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:468) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:146)
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:132)
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:311)
          ... 28 more
          Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Illegal use of static field private static test.TestBean test.TestServlet.testBean on class that only supports instance-based injection
          at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:616)
          ... 32 more

          #]
          Show
          Cheng Fang added a comment - This is the stacktrace from 3.2 build (the line numbers have changed a lot since v2): [#|2011-03-21T17:17:46.594-0400|WARNING|glassfish3.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=23;_ThreadName=T hread-1;|StandardWrapperValve [test.TestServlet] : PWC1382: Allocate exception for servlet test.TestServlet com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class test.TestServlet at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:317) at com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:702) at com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:1968) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1263) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1070) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:680) Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Local ejb-ref name=test.TestServl et/testBean,Local 3.x interface =test.TestBean resolved to intra-app EJB TestBean in module test,ejb-link=TestBean,lookup=,mappedName=,jndi- name=,refType=Session into class test.TestServlet at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:698) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:468) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:146) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:132) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:311) ... 28 more Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Illegal use of static field private static test.TestBean test.TestServlet.testBean on class that only supports instance-based injection at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:616) ... 32 more #]
          Hide
          Cheng Fang added a comment -

          Sending container-common/src/main/java/com/sun/enterprise/container/common/impl/util/InjectionManagerImpl.java
          Adding container-common/src/main/resources/com
          Adding container-common/src/main/resources/com/sun
          Adding container-common/src/main/resources/com/sun/enterprise
          Adding container-common/src/main/resources/com/sun/enterprise/container
          Adding container-common/src/main/resources/com/sun/enterprise/container/common
          Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl
          Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl/util
          Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl/util/LocalStrings.properties

          Committed revision 45768.

          Show
          Cheng Fang added a comment - Sending container-common/src/main/java/com/sun/enterprise/container/common/impl/util/InjectionManagerImpl.java Adding container-common/src/main/resources/com Adding container-common/src/main/resources/com/sun Adding container-common/src/main/resources/com/sun/enterprise Adding container-common/src/main/resources/com/sun/enterprise/container Adding container-common/src/main/resources/com/sun/enterprise/container/common Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl/util Adding container-common/src/main/resources/com/sun/enterprise/container/common/impl/util/LocalStrings.properties Committed revision 45768.

            People

            • Assignee:
              Cheng Fang
              Reporter:
              sbalmos
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: