Solder
  1. Solder
  2. SOLDER-311

HttpServletRequest cannot be @Inject-ed

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Out of Date Out of Date
    • Affects Version/s: 3.1.0.Final
    • Fix Version/s: None
    • Component/s: Servlet
    • Labels:
      None
    • Environment:
      JBossAS 7.1beta1b
    • Similar Issues:
      Show 10 results 

      Description

      "@Inject HttpServletRequest request;" results in the stacktrace below, when I invoke "request(myusername, mypassword);" using JBossAS 7.1beta1b. I'll attach a testcase as an EAR. Just invoke http://localhost:8080/testcase and you'll see a form where you click the OK button. Then you'll see the stacktrace in the JBoss console.

      Stacktrace:
      09:11:00,535 Warnung [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http--127.0.0.1-8080-1) #

      {cust.findCustomer}: org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method: [method] @Produces @Typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest(): javax.faces.FacesException: #{cust.findCustomer}

      : org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method: [method] @Produces @Typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]
      at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.4.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]
      at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.3.Final.jar:]
      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Beta1b.jar:]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.Beta1b.jar:]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.3.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.3.Final.jar:]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.3.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.3.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.3.Final.jar:]
      at java.lang.Thread.run(Thread.java:722) [:1.7.0_02]
      Caused by: javax.faces.el.EvaluationException: org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method: [method] @Produces @Typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      ... 28 more
      Caused by: org.jboss.weld.exceptions.IllegalProductException: WELD-000052 Cannot return null from a non-dependent producer method: [method] @Produces @Typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()
      at org.jboss.weld.bean.AbstractProducerBean.checkReturnValue(AbstractProducerBean.java:217) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:300) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.proxies.HttpServletRequest$83012492$Proxy$$$_WeldClientProxy.login(HttpServletRequest$83012492$Proxy$$$_WeldClientProxy.java)
      at testcase.CustomerController.findCustomer(CustomerController.java:43) [classes:]
      at testcase.CustomerController$Proxy$$$_WeldClientProxy.findCustomer(CustomerController$Proxy$$$_WeldClientProxy.java) [classes:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_02]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0_02]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_02]
      at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0_02]
      at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.3.Final.jar:]
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.3.Final.jar:]
      at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.4.Final.jar:]
      at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.4.Final.jar:]
      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.1.3-b02-jbossorg-2.jar:]
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
      ... 29 more

        Issue Links

          Activity

          Hide
          Juergen Zimmermann
          added a comment -

          Is anyone still working on Solder? Are we left in the darkness until DeltaSpike becomes usable?

          Show
          Juergen Zimmermann
          added a comment - Is anyone still working on Solder? Are we left in the darkness until DeltaSpike becomes usable?
          Hide
          Frank Cornelis
          added a comment -

          I also did hit this when trying to move Seam dependencies from the WAR to the EAR. Any progress on resolving this issue?

          Show
          Frank Cornelis
          added a comment - I also did hit this when trying to move Seam dependencies from the WAR to the EAR. Any progress on resolving this issue?
          Hide
          Juergen Zimmermann
          added a comment -
          Show
          Juergen Zimmermann
          added a comment - Is there a chance to get it into 3.1.1? http://lists.jboss.org/pipermail/seam-dev/2012-March/004675.html
          Hide
          Juergen Zimmermann
          added a comment -

          The issue is gone since 3.1.1

          Show
          Juergen Zimmermann
          added a comment - The issue is gone since 3.1.1
          Hide
          Adam Lukaszewski
          added a comment -

          Hi,

          I've got still the problem with the HttpServletRequest. Can't fix it... I've also replaced the solder 3.1.0 version against the 3.1.1 and still getting the same Exception (@Zimmermann: Have you done something additionally, you haven't mentioned?)

          Does anyone have an idea, a hint how to figure that problem out? I've spend a lot of time with the configuration of my ear with seam and while I have beeing trying a little bit around with the seam-booking example I ran into this issue.

          Thanks for your support. Cheers,
          Adam

          Show
          Adam Lukaszewski
          added a comment - Hi, I've got still the problem with the HttpServletRequest. Can't fix it... I've also replaced the solder 3.1.0 version against the 3.1.1 and still getting the same Exception (@Zimmermann: Have you done something additionally, you haven't mentioned?) Does anyone have an idea, a hint how to figure that problem out? I've spend a lot of time with the configuration of my ear with seam and while I have beeing trying a little bit around with the seam-booking example I ran into this issue. Thanks for your support. Cheers, Adam

            People

            • Assignee:
              Unassigned
              Reporter:
              Juergen Zimmermann
            • Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: