14 Replies Latest reply: Jan 11, 2013 4:51 AM by batnix RSS

Error inject HttpSession or HttpServletRequest - before it has been initialized

Matthew Hibberd Newbie

Hi,

 

I am having trouble with simply performing a logout operation using Seam 3.1.1.Final.

 

I hit the logout link and I get the below stack trace in the logs.

 

The logout link is as follows:

<pretty:link mappingId="logout" rendered="#{identity.loggedIn}">#{bundles.messages.menu_logoutLabel}</pretty:link>

 

 

And the pretty config is as follows:

<url-mapping id="logout">
    <pattern value="/logout"></pattern>
    <view-id>/home.xhtml</view-id>
    <action>#{identity.logout}</action>
</url-mapping>

 

 

01:30:28,484 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/customapp].[Faces Servlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: Attempted to inject an HttpSession before it has been initialized.
    at org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpSession(ImplicitHttpServletObjectsProducer.java:55) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_04]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_04]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_04]
    at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_04]
    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:133) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.proxies.HttpSession$1681475766$Proxy$_$$_WeldClientProxy.invalidate(HttpSession$1681475766$Proxy$_$$_WeldClientProxy.java)
    at org.jboss.seam.security.IdentityImpl.logout(IdentityImpl.java:427) [seam-security-3.1.0.Final.jar:3.1.0.Final]
    at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.logout(IdentityImpl$Proxy$_$$_WeldClientProxy.java) [seam-security-3.1.0.Final.jar:3.1.0.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_04]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_04]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_04]
    at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_04]
    at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [jbossweb-7.0.13.Final.jar:]
    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at com.ocpsoft.pretty.faces.util.FacesElUtils.invokeMethod(FacesElUtils.java:70) [prettyfaces-jsf2-3.3.2.jar:]
    at com.ocpsoft.pretty.faces.util.FacesElUtils.invokeMethod(FacesElUtils.java:62) [prettyfaces-jsf2-3.3.2.jar:]
    at com.ocpsoft.pretty.faces.beans.ActionExecutor.executeActions(ActionExecutor.java:56) [prettyfaces-jsf2-3.3.2.jar:]
    at com.ocpsoft.pretty.faces.event.PrettyPhaseListener.processEvent(PrettyPhaseListener.java:131) [prettyfaces-jsf2-3.3.2.jar:]
    at com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:117) [prettyfaces-jsf2-3.3.2.jar:]
    at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.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.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488) [jbossweb-7.0.13.Final.jar:]
    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.2.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:67)
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:48)
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

 

  • 1. Re: HttpSession Inject Error on identity.logout
    Matthew Hibberd Newbie

    The problem isn't specific to identity.logout, that was just the 1st thing I tried to use that injects a HttpSession.

    I get the same stack trace whener a HttpSession is injected anywhere.

     

    I tried adding the filter below into my web.xml as suggested here. But I get the same errors as everyone else in that thread when I do that.

     

     

    <filter>
         <filter-name>Seam 3.1 Servlet Filter</filter-name>
         <filter-class>org.jboss.solder.servlet.event.ServletEventBridgeFilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>Seam 3.1 Servlet Filter</filter-name>
         <url-pattern>/*</url-pattern>
    </filter-mapping>
    

     

     

     

    I'm thinking it has something to do with how I've packaged/configured my app as an EAR?

    I can run the seam 3 examples, such as seam-booking, on the same app server (7.1.1) and login/logout works fine. I just can't find the difference between the 2 apps/configurations.

  • 2. Re: HttpSession Inject Error on identity.logout
    Matthew Hibberd Newbie

    I am still having major headaches with this and it's really preventing me from moving forward with my app.

     

    I have attached my example app above that will replicate the problem.

    To get it working make sure Maven is configure for the JBoss community repository (https://community.jboss.org/wiki/MavenGettingStarted-Users) and that JBoss 7.1.1 is configured with a MySQL datasource CustomAppDS.

     

    It is built bases on other EAR apps examples from the forums https://github.com/antoinesd/contentieux and https://github.com/jagin/sandbox-starter, as well as the seam-booking example. But neither of these examples have any functionality base on session information such as login.

     

    I've added more functionality since finding out logout fails. Now upon login the exception below occurs.

    Am I posting this question in the right place? Maybe it is a Weld issue I'm facing?

    Any help greatly appreciated!

     


    13:41:41,409 ERROR (http-localhost-127.0.0.1-8080-5) javax.ejb.EJBTransactionRolledbackException: Attempted to inject an HttpServletRequest before it has been initialized.

    13:41:41,410 ERROR (http-localhost-127.0.0.1-8080-5) JBAS014134: EJB Invocation failed on component CurrentUserManager for method public void com.divide.customapp.web.action.user.CurrentUserManager.onLogin(com.divide.customapp.domain.entities.User,javax.servlet.http.HttpServletRequest): javax.ejb.EJBTransactionRolledbackException: Attempted to inject an HttpServletRequest before it has been initialized.

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:139)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:204)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:306)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulComponentIdInterceptor.processInvocation(StatefulComponentIdInterceptor.java:52)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)

        at com.divide.customapp.web.action.user.CurrentUserManager$$$view8.onLogin(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111)

        at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

        at com.divide.customapp.web.action.user.CurrentUserManager$Proxy$_$$_Weld$Proxy$.onLogin(CurrentUserManager$Proxy$_$$_Weld$Proxy$.java)

        at com.divide.customapp.web.action.user.CurrentUserManager$Proxy$_$$_WeldClientProxy.onLogin(CurrentUserManager$Proxy$_$$_WeldClientProxy.java)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

        at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)

        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)

        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)

        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)

        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)

        at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)

        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:564)

        at org.jboss.weld.event.EventImpl.fire(EventImpl.java:68)

        at com.divide.customapp.web.action.security.LoginAuthenticator.authenticate(LoginAuthenticator.java:48)

        at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:224)

        at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:163)

        at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

        at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)

        at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

        at javax.faces.component.UICommand.broadcast(UICommand.java:315)

        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)

        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)

        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)

        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)

        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

        at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:67)

        at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:48)

        at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

        at java.lang.Thread.run(Thread.java:722)

    Caused by: java.lang.IllegalStateException: Attempted to inject an HttpServletRequest before it has been initialized.

        at org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest(ImplicitHttpServletObjectsProducer.java:73)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)

        at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:133)

        at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299)

        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)

        at org.jboss.weld.proxies.HttpServletRequest$83012492$Proxy$_$$_WeldClientProxy.getSession(HttpServletRequest$83012492$Proxy$_$$_WeldClientProxy.java)

        at com.divide.customapp.web.action.user.CurrentUserManager.onLogin(CurrentUserManager.java:31)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)

        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127)

        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135)

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:156)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:82)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:66)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:202)

        ... 100 more

     

    13:41:41,454 ERROR (http-localhost-127.0.0.1-8080-5) Login failed: org.jboss.seam.security.AuthenticationException: Authentication failed.

        at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:245)

        at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:163)

        at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

        at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)

        at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

        at javax.faces.component.UICommand.broadcast(UICommand.java:315)

        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)

        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)

        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)

        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)

        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

        at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:67)

        at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:48)

        at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

        at java.lang.Thread.run(Thread.java:722)

    Caused by: javax.ejb.EJBTransactionRolledbackException: Attempted to inject an HttpServletRequest before it has been initialized.

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:139)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:204)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:306)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulComponentIdInterceptor.processInvocation(StatefulComponentIdInterceptor.java:52)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)

        at com.divide.customapp.web.action.user.CurrentUserManager$$$view8.onLogin(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111)

        at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

        at com.divide.customapp.web.action.user.CurrentUserManager$Proxy$_$$_Weld$Proxy$.onLogin(CurrentUserManager$Proxy$_$$_Weld$Proxy$.java)

        at com.divide.customapp.web.action.user.CurrentUserManager$Proxy$_$$_WeldClientProxy.onLogin(CurrentUserManager$Proxy$_$$_WeldClientProxy.java)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

        at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)

        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)

        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)

        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)

        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)

        at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)

        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:564)

        at org.jboss.weld.event.EventImpl.fire(EventImpl.java:68)

        at com.divide.customapp.web.action.security.LoginAuthenticator.authenticate(LoginAuthenticator.java:48)

        at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:224)

        ... 46 more

    Caused by: java.lang.IllegalStateException: Attempted to inject an HttpServletRequest before it has been initialized.

        at org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest(ImplicitHttpServletObjectsProducer.java:73)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)

        at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:133)

        at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:299)

        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)

        at org.jboss.weld.proxies.HttpServletRequest$83012492$Proxy$_$$_WeldClientProxy.getSession(HttpServletRequest$83012492$Proxy$_$$_WeldClientProxy.java)

        at com.divide.customapp.web.action.user.CurrentUserManager.onLogin(CurrentUserManager.java:31)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)

        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127)

        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135)

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:156)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:82)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:66)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:202)

        ... 100 more

     

    13:41:41,488 INFO  (http-localhost-127.0.0.1-8080-5) JBAS014101: Failed to find SFSB instance with session ID {[-51, 89, 18, 57, 69, 110, 78, -77, -77, -111, -74, 44, 54, 30, 112, 31]} in cache

     

  • 3. Re: HttpSession Inject Error on identity.logout
    Jason Porter Master

    It's possible this is an EAR problem. Do you have the same issue in a WAR?

  • 4. Re: HttpSession Inject Error on identity.logout
    Matthew Hibberd Newbie

    I suspected it as an EAR issue as well. I can't believe I didn't try it as a WAR before posting, sorry!

     

    Anyway, I removed any dependency that my WAR had on my EJB project, deployed it standalone as a WAR and it works fine. So I think you're correct, it is indeed an EAR issue imho.

     

    I have raised the below issue in JIRA. Hope that was the correct thing to do.

    https://issues.jboss.org/browse/SEAM-136

  • 5. Re: HttpSession Inject Error on identity.logout
    Matthew Hibberd Newbie

    I have dug into the pom.xml provided by Antoine in his EAR example (https://github.com/antoinesd/contentieux) and found this comment in the EAR pom.xml:

     

    <!-- Solder needs to be in EAR and nowhere else. That can be a problem 
                if you need servlet CDI support. In that case you need to extract Web fragment 
                from solder and put it in your war -->
            <dependency>
                <groupId>org.jboss.solder</groupId>
                <artifactId>solder-impl</artifactId>
            </dependency>
    

     

     

    Could the issue he is referring to be the one that I am facing injecting HttpSession etc etc??

    If so, can someone explain how I can "extract Web fragment from solder and put it in your war"?

    Thanks!

  • 6. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Dmitry Shultz Newbie

    I have the same issue.

     

    After repackaging the web app not to use ear it works (thanks for this thread!), but now there is no transactions created (javax.persistence.TransactionRequiredException: JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)). i.e for each request transaction must be managed manually...

  • 7. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Jason Porter Master

    You can still use local EJBs in a war. Or you could use seam transaction and annotate the methods / classes.

  • 8. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Dmitry Shultz Newbie

    I forgot about EJB's in war, Thanks!

    The way to manage transactions described here also works.

  • 9. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Matthew Hibberd Newbie

    Thanks for the replies. Unfortunately, I had designed my application as an EAR because I wanted remote EJBs for a remote client.

     

    Is there acknowledgement of a problem when deploying a Seam 3 app as an EAR? If so, what kind of priority would a fix be given?

    I'd really rather not look for an alternative framework, I like Seam, always have from day 1.

    Can anyone provide with any clues as to where to start looking in the source for a fix?

  • 10. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Jason Porter Master

    Yes, we know there are issues with EAR deployment. However, the core team, and the majority of the community are working on Apache DeltaSpike instead of Seam. DeltaSpike is a combination of MyFaces CODI, Seam and other CDI extensions. If you're looking for something similar, please look at CODI as it is more feature rich at the moment than DeltaSpike.

  • 11. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Dmitry Shultz Newbie

    DeltaSpike looks very exciting and promising, I'm sure the whole team having fun bringing it up.

     

    The question is (probably not very original) what is the rough estimation related to when it will start to became available (as separate extensions or single library... not sure in what shape)?

  • 12. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    Jason Porter Master

    Version v0.2-incubating is available now. It contains most of Solder, CODI core, authentication, basic authorization (though it is extensible, so you could do some complicated security schemas), exception handling, and i18n. You can find it in central.

  • 13. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    jim Newbie

    here's a work around, this works in seam 3, JBoss AS7, a war in an ear.

     

    HttpServletRequest httpServletRequest = (HttpServletRequest) FacesContext.getCurrentInstance()

    .getExternalContext().getRequest();

    httpServletRequest.getSession().setAttribute("loggedIn", true);

  • 14. Re: Error inject HttpSession or HttpServletRequest - before it has been initialized
    batnix Newbie

    Hi,

     

    Juergen Zimmermann wrote in https://issues.jboss.org/browse/SOLDER-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653734#comment-12653734 that he could solve the problem with the HttpServletRequest with the new version of solder 7.1.1.  Can anyone confirm this?

     

    I've got still the same 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 :/.

     

    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 (everything seems to work) 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