Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-7704

Injecting Session Beans into Servlet in EAR archiv throws exception

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.0.0.M2
    • Component/s: None
    • Labels:
      None

      Description

      Injecting Session bean using either @Inject annotation directly or Instance<T> with following .get() into Servlet in EAR archiv throws an exception

      Steps to reproduce:
      1) download attached zip file and unpack it among weld/jsf examples
      2) run "mvn clean package" in root directory of the new project
      3) deploy resulting weld-pastie.ear into JBossAS default configuration
      4) go to localhost: http://localhost:8080/weld-pastie/download //which invokes the servlet
      5) now you can see following exception at jboss console:

      08:52:56,537 ERROR [[/weld-pastie]] StandardWrapper.Throwable
      java.lang.NullPointerException
      at org.jboss.weld.examples.pastie.DownloadServlet.init(DownloadServlet.java:31)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
      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:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      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:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)
      08:52:56,538 ERROR [[DownloadServlet]] Allocate exception for servlet DownloadServlet
      java.lang.NullPointerException
      at org.jboss.weld.examples.pastie.DownloadServlet.init(DownloadServlet.java:31)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
      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:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      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:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  marius.bogoevici Marius Bogoevici
                  Reporter:
                  mgencur Martin Gencur
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: