tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: WARNING - Could NOT lazily initialize session context because of null RequestContext + login = context parameter can not be null
Date Sun, 03 Feb 2013 10:56:52 GMT
Wow/hmmm, interesting. I do have @Schedule pinging CDI @applicationscoped
bean's getter methods. Maybe that is the cause, and when @Schedule pinging
CDI @applicationscoped bean, I may be pinging CDI @sessionscoped (user)
bean(s).

I will have to check on that. Other than that, I really would not know
where else I ping a sessionscoped bean 'outside of' a request. :)


On Sun, Feb 3, 2013 at 5:39 AM, Romain Manni-Bucau <rmannibucau@gmail.com>wrote:

> You identied the cause? = where you ask a sessionscoped bean without doing
> any request
> Le 3 févr. 2013 11:03, "Howard W. Smith, Jr." <smithh032772@gmail.com> a
> écrit :
>
> > Romain, I still see the following in my log. I reported this when TomEE
> > 1.5.1 SNAPSHOT was in development, and I think you recommended the same
> to
> > me that you have already recommended to Jose in this thread. Honestly, I
> > did not understand how to modify my code to prevent the following that
> > shows up the most in my log. it would be nice... if TomEE provided a bit
> > more information in this WARNING message or possibly a recommendation
> made
> > to the developer, how to prevent this from showing up in the log. As you
> > can see below, the first message is occurring over and over at the same
> > time (9:30:37 PM); i did not copy/paste here all of the occurrences that
> > occurred at 9:30:37 PM. :)
> >
> > Feb 02, 2013 9:30:37 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 9:30:37 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 9:30:37 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 9:42:29 PM jsf.users.pf_UsersController log
> > INFO: pf_UsersController.loginUser(): administrator logged in at Sat Feb
> 02
> > 21:42:29 EST 2013
> > Feb 02, 2013 9:58:39 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 9:58:39 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 10:10:16 PM jsf.users.pf_UsersController log
> > INFO: pf_UsersController.logout(): administrator logged out at Sat Feb 02
> > 22:10:16 EST 2013
> > Feb 02, 2013 11:10:45 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 11:10:45 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 11:11:45 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 11:11:45 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> > Feb 02, 2013 11:20:46 PM org.apache.openejb.cdi.CdiAppContextsService
> > lazyStartSessionContext
> > WARNING: Could NOT lazily initialize session context because of null
> > RequestContext
> >
> >
> > On Wed, Jan 30, 2013 at 2:43 AM, Romain Manni-Bucau
> > <rmannibucau@gmail.com>wrote:
> >
> > > can you give a try with a fresh snapshot please ?(build it from sources
> > or
> > > wait next snapshot deployed tonight)
> > >
> > > *Romain Manni-Bucau*
> > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > *Blog: **http://rmannibucau.wordpress.com/*<
> > > http://rmannibucau.wordpress.com/>
> > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > *Github: https://github.com/rmannibucau*
> > >
> > >
> > >
> > > 2013/1/30 Romain Manni-Bucau <rmannibucau@gmail.com>
> > >
> > > > That's a bug in session scope using session directly: ill fix it soon
> > but
> > > > disactivacte it and it will work
> > > > Le 30 janv. 2013 06:23, "José Luis Cetina" <maxtorzito@gmail.com>
a
> > > > écrit :
> > > >
> > > > Hi
> > > >> When i deploy 2 or more webapps in the same EAR each of them have
> > > (webapp)
> > > >> with their own session bean and use a request.login method.
> > > >>
> > > >> I get a java.lang.NullPointerException: context parameter can not
be
> > > null
> > > >> (this error happens in each web app where i get WARNING - Could NOT
> > > lazily
> > > >> initialize session context because of null RequestContext) i read
> some
> > > >> posts about this but in those posts they says is ONLY A WARNING!!
> > > >>
> > > >>
> > > >> I reproduce this behavior in my github project.
> > > >>
> > > >> You can download and test the example.
> > > >>
> > > >> https://github.com/maxtorzito/tomee.git
> > > >>
> > > >> Setps:
> > > >>
> > > >> 1. Run with tomee plugin the pom.xml (ear project)
> > > >> 2. Add mymailing.com and mymailing2.com to your hosts files
> > > >> 3. Try to access to mymailing.com:8080 (you get an WARNING - Could
> > NOT
> > > >> lazily initialize session context because of null RequestContext )
> the
> > > >> webapp shows the index.xhtml
> > > >> 4.  Try to acess to mymailing2.com:8080 (you dont get any warning
> > like
> > > >> webapp1) the webapp show the index.xhtml
> > > >> 5. Then click on Login button in webapp1 or webapp2 (the
> > > >> order doesn't matter)
> > > >>
> > > >> Results: When you try to login in webapp2 you can see the successful
> > > >> message, but when you try to login with webapp1 you get this
> > exception:
> > > >>
> > > >> Log:
> > > >>
> > > >> java.lang.NullPointerException: context parameter can not be null
> > > >> at org.apache.webbeans.util.Asserts.assertNotNull(Asserts.java:50)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.webbeans.web.context.SessionContextManager.addNewSessionContext(SessionContextManager.java:58)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.openejb.cdi.UpdatableSessionContextManager.updateSessionIdMapping(UpdatableSessionContextManager.java:50)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.openejb.cdi.CdiAppContextsService.updateSessionIdMapping(CdiAppContextsService.java:516)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.tomee.catalina.TomEEContainerListener.containerEvent(TomEEContainerListener.java:42)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.ContainerBase.fireContainerEvent(ContainerBase.java:1398)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.session.ManagerBase.changeSessionId(ManagerBase.java:776)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.register(AuthenticatorBase.java:715)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.login(AuthenticatorBase.java:801)
> > > >> at org.apache.catalina.connector.Request.login(Request.java:2622)
> > > >> at
> > > >>
> > >
> >
> org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1065)
> > > >> at
> > > >>
> > > >>
> > >
> >
> com.maxtorzito.web1.managedbean.Web1IndexMBean.login(Web1IndexMBean.java:32)
> > > >> 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.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:322)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:117)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:108)
> > > >> at
> > > >>
> > > >>
> > >
> >
> com.maxtorzito.web1.managedbean.Web1IndexMBean_$$_javassist_28.login(Web1IndexMBean_$$_javassist_28.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:278)
> > > >> at
> > > >>
> > org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:96)
> > > >> at
> > > >>
> > > >>
> > >
> >
> javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
> > > >> at
> javax.faces.event.ActionEvent.processListener(ActionEvent.java:51)
> > > >> at
> > > >>
> > >
> javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:420)
> > > >> at javax.faces.component.UICommand.broadcast(UICommand.java:103)
> > > >> at
> > javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1028)
> > > >> at
> > javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:286)
> > > >> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1375)
> > > >> at
> > > >>
> > javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:38)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
> > > >> at
> > > >>
> > >
> >
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.execute(CodiLifecycleWrapper.java:95)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.execute(CodiLifecycleWrapper.java:95)
> > > >> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> > > >> at
> org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> > > >> at
> > > >>
> > > >>
> > >
> >
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
> > > >> at
> > > >>
> > > >>
> > >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> > > >> at
> > > >>
> > > >>
> > >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> > > >> at java.lang.Thread.run(Thread.java:722)
> > > >>
> > > >>
> > > >>
> > > >> I guess this is for the first WARNING in webapp 1 (WARNING - Could
> NOT
> > > >> lazily initialize session context because of null RequestContext ).
> > > >>
> > > >> I reproduce this problem in the github project, in my real app i
> have
> > 4
> > > >> webapps in the same ear (because they share sources etc..) and i
> have
> > > the
> > > >> same problem, i can login only in 1 webapp, if i just deploy 1
> webapp
> > in
> > > >> the ear i could login, but if i N webapps i can only access (login)
> > to 1
> > > >> of
> > > >> them, each webapp unless 1 show the WARNING message, the webapp
> where
> > > the
> > > >> warning message is not present is the webapp where i can login.
> > > >>
> > > >> What could be?
> > > >>
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message