[jboss-user] [JBoss Seam] - since today (JBSEAM-954?) I get NPE in setEntityManagerFlush

codelion do-not-reply at jboss.com
Thu Mar 8 17:27:53 EST 2007


Calls to changeFlushMode that get passed a null flushMode from a null actualFlushMode?

I haven't changed anything that seems related, but upgrade to a build we make from CVS.

In class ManagedPersistenceContect method setEntityManagerFlushMode() throws a NullPointerException.

I dont think you need to know it is in a

@Name("authenticator")
  | public class Authenticator {
  | 
  | 	@In
  | 	EntityManager entityManager;
  | 
  | ...

You probably want the stack trace

13:47:20,593 ERROR [SeamPhaseListener] uncaught exception
  | java.lang.NullPointerException
  |         at org.jboss.seam.core.ManagedPersistenceContext.setEntityManagerFlushMode(ManagedPersistenceContext.java:228)
  |         at org.jboss.seam.core.ManagedPersistenceContext.changeFlushMode(ManagedPersistenceContext.java:222)
  |         at org.jboss.seam.core.PersistenceContexts.changeFlushMode(PersistenceContexts.java:67)
  |         at org.jboss.seam.core.PersistenceContexts.afterRender(PersistenceContexts.java:81)
  |         at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRender(AbstractSeamPhaseListener.java:233)
  |         at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:116)
  |         at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
  |         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
  |         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  |         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  |         at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  |         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  |         at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  |         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  |         at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  |         at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:67)
  |         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:223)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  |         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  |         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  |         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  |         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  |         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  |         at java.lang.Thread.run(Thread.java:595)

The real reason seems to be that the in PersistenceContexts there are calls to methods changeFlushMode that get passed a null flushMode from a null actualFlushMode.

Oddly in the debugger I see calls to afterRender before beforeRender, but don't take my word for it.

I might have mistinterpreted what I saw in debugger, because it didn't link up all symbols right this time.

I need a quick workaround or I'll get fried here for running Seam from CVS :(

Can I in PersistenceContexts make that

   private FlushModeType flushMode = FlushModeType.AUTO;
  |    private FlushModeType actualFlushMode = FlushModeType.AUTO;

?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026444#4026444

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026444



More information about the jboss-user mailing list