[
http://jira.jboss.com/jira/browse/EJBTHREE-912?page=comments#action_12404753 ]
Pete Muir commented on EJBTHREE-912:
------------------------------------
I can reproduce injecting using @PersistenceContext(type=EXTENDED) and trying to do
entityManager.getDelegate() inside an @PostConstruct method
13:04:47,244 INFO [STDOUT] Hibernate: select top ? hotel0_.id as id7_, hotel0_.address as
address7_, hotel0_.name as name7_, hotel0_.state as state7_, hotel0_.country as country7_,
hotel0_.price as price7_, hotel0_.city as city7_, hotel0_.zip as zip7_ from Hotel hotel0_
where lower(hotel0_.name) like ? or lower(hotel0_.city) like ? or lower(hotel0_.zip) like
? or lower(hotel0_.address) like ?
13:06:34,183 ERROR [STDERR] java.lang.RuntimeException: java.lang.NullPointerException
13:06:34,184 ERROR [STDERR] at
org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:113)
13:06:34,184 ERROR [STDERR] at
org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:619)
13:06:34,184 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:131)
13:06:34,184 ERROR [STDERR] at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:49)
13:06:34,184 ERROR [STDERR] at
org.jboss.ejb3.ThreadlocalPool.create(ThreadlocalPool.java:50)
13:06:34,184 ERROR [STDERR] at
org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:90)
13:06:34,185 ERROR [STDERR] at
org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:315)
13:06:34,185 ERROR [STDERR] at
org.jboss.ejb3.stateful.StatefulLocalProxyFactory.createProxy(StatefulLocalProxyFactory.java:146)
13:06:34,185 ERROR [STDERR] at
org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:53)
13:06:34,185 ERROR [STDERR] at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
13:06:34,185 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1273)
13:06:34,185 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1290)
13:06:34,185 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:763)
13:06:34,185 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
13:06:34,185 ERROR [STDERR] at
javax.naming.InitialContext.lookup(InitialContext.java:351)
13:06:34,185 ERROR [STDERR] at
org.jboss.seam.Component.instantiateSessionBean(Component.java:1348)
13:06:34,185 ERROR [STDERR] at org.jboss.seam.Component.instantiate(Component.java:1312)
13:06:34,185 ERROR [STDERR] at org.jboss.seam.Component.newInstance(Component.java:2055)
13:06:34,185 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1959)
13:06:34,185 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1926)
13:06:34,185 ERROR [STDERR] at
org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
13:06:34,185 ERROR [STDERR] at
org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
13:06:34,185 ERROR [STDERR] at
org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
13:06:34,185 ERROR [STDERR] at
org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
13:06:34,185 ERROR [STDERR] at
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
13:06:34,186 ERROR [STDERR] at
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
13:06:34,186 ERROR [STDERR] at
org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
13:06:34,186 ERROR [STDERR] at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
13:06:34,186 ERROR [STDERR] at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
13:06:34,186 ERROR [STDERR] at
org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.navigation.Pages.callAction(Pages.java:639)
13:06:34,186 ERROR [STDERR] at org.jboss.seam.navigation.Pages.preRender(Pages.java:298)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
13:06:34,186 ERROR [STDERR] at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
13:06:34,186 ERROR [STDERR] at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
13:06:34,186 ERROR [STDERR] at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
13:06:34,186 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
13:06:34,186 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
13:06:34,186 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
13:06:34,187 ERROR [STDERR] at
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
13:06:34,187 ERROR [STDERR] at
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13:06:34,187 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
13:06:34,187 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
13:06:34,188 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
13:06:34,188 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
13:06:34,188 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
13:06:34,188 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
13:06:34,188 ERROR [STDERR] at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
13:06:34,188 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
13:06:34,188 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
13:06:34,188 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
13:06:34,188 ERROR [STDERR] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
13:06:34,188 ERROR [STDERR] at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
13:06:34,188 ERROR [STDERR] at java.lang.Thread.run(Thread.java:613)
13:06:34,189 ERROR [STDERR] Caused by: java.lang.NullPointerException
13:06:34,189 ERROR [STDERR] at
org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:56)
13:06:34,189 ERROR [STDERR] at
org.jboss.ejb3.entity.ExtendedEntityManager.isOpen(ExtendedEntityManager.java:166)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.persistence.PersistenceProvider.getPersistenceProvider(PersistenceProvider.java:178)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.persistence.PersistenceProvider.proxyEntityManager(PersistenceProvider.java:133)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.persistence.EntityManagerProxyInterceptor.proxyPersistenceContexts(EntityManagerProxyInterceptor.java:54)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.persistence.EntityManagerProxyInterceptor.postConstruct(EntityManagerProxyInterceptor.java:40)
13:06:34,189 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
13:06:34,189 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13:06:34,189 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:06:34,189 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:184)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
13:06:34,189 ERROR [STDERR] at
org.jboss.seam.persistence.HibernateSessionProxyInterceptor.postConstruct(HibernateSessionProxyInterceptor.java:42)
13:06:34,189 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
13:06:34,189 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13:06:34,189 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:06:34,189 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:184)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.intercept.RootInterceptor.invokeAndHandle(RootInterceptor.java:84)
13:06:34,190 ERROR [STDERR] at
org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(SessionBeanInterceptor.java:114)
13:06:34,190 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
13:06:34,190 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13:06:34,190 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:06:34,190 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
13:06:34,190 ERROR [STDERR] at
org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131)
13:06:34,190 ERROR [STDERR] at
org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109)
13:06:34,190 ERROR [STDERR] ... 75 more
ejb-jar.xml injected EntityManger fails in @PostConstruct annotated
methods
---------------------------------------------------------------------------
Key: EJBTHREE-912
URL:
http://jira.jboss.com/jira/browse/EJBTHREE-912
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC9 - Patch 1
Environment: Identified on jboss-4.0.5.GA from jems installer 1.2.GA, still
present in head from svn co
http://anonsvn.jboss.org/repos/jbossas/branches/Branch_4_0/
as of 13th March 2007. Tests run agains JDK 1.5 on Win XP (sp2)
Reporter: Andrew Redhead
Attachments: build-test.xml, resources-xmleminjection.zip,
src-xmleminjection.zip, xmleminjection-pu-test.jar, xmleminjection-test.jar
Using an ejb-jar.xml file to inject an EntityManger into an EJB3 stateless session bean
succeeds for bean interface methods but fails for @PostConstruct methods.
In both cases the reference to the EntityManager is non-null, however in the
@PostConstruct method, accessing the EnityManger underlying delegate fails.
The test cases provide both an "API" interface case (which passes) and an
@PostConstruct case, which currently fails.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira