Is there an update for this?
I received this error trying to use the my EntityManagerFactory:
| @PersistenceUnit(unitName = "CRUDPU")
| private EntityManagerFactory emf = null;
|
| public EntityManager getEntityManager() {
| return emf.createEntityManager();
| }
|
The exception:
18:03:27,156 ERROR [JBossInjectionProvider] Injection failed on managed bean.
| javax.naming.NameNotFoundException: com.cml.entities.ConsumerController not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at
org.jboss.web.jsf.integration.injection.JBossInjectionProvider.lookupFieldResource(JBossInjectionProvider.java:241)
| at
org.jboss.web.jsf.integration.injection.JBossInjectionProvider.inject(JBossInjectionProvider.java:169)
| at
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:298)
| at
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:527)
| at
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
| at org.apache.el.parser.AstValue.getTarget(AstValue.java:43)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:132)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at
org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
| at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
| at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
| at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
| at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:90)
| at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:96)
| at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:309)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| 18:03:29,125 WARN [lifecycle] executePhase(RENDER_RESPONSE
6,com.sun.faces.context.FacesContextImpl@88249c) threw exception
| javax.faces.FacesException: org.apache.jasper.el.JspELException:
/User/consumer/List.jsp(15,0) '#{consumer.itemCount == 0}' Error reading
'itemCount' on type com.entities.ConsumerController
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:880)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
| at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
| at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
| at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
| at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:90)
| at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:96)
| at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:309)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.apache.jasper.el.JspELException: /User/consumer/List.jsp(15,0)
'#{consumer.itemCount == 0}' Error reading 'itemCount' on type
com.cml.entities.ConsumerController
| at
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107)
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
| ... 30 more
| Caused by: java.lang.NullPointerException
| at
com.cml.entities.ConsumerController.getEntityManager(ConsumerController.java:39)
| at
com.cml.entities.ConsumerController.getItemCount(ConsumerController.java:481)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.apache.el.parser.AstValue.getValue(AstValue.java:98)
| at org.apache.el.parser.AstEqual.getValue(AstEqual.java:21)
| at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
| ... 31 more
| 18:03:29,390 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw
exception
| java.lang.NullPointerException
|
| at
com.cml.entities.ConsumerController.getEntityManager(ConsumerController.java:39)
| at
com.cml.entities.ConsumerController.getItemCount(ConsumerController.java:481)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.apache.el.parser.AstValue.getValue(AstValue.java:98)
| at org.apache.el.parser.AstEqual.getValue(AstEqual.java:21)
| at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:880)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
| at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
| at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
| at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
| at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:90)
| at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:96)
| at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:309)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148461#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...