[jboss-user] [Beginners Corner] - Problem with @stateless
Eeth
do-not-reply at jboss.com
Tue Aug 21 06:17:21 EDT 2007
Hello,
i am using the Red hat development studio and i have a problem with the @stateless annotation.
I am following the example of the JBoss Seam tutorial (simple register application). Reading my database is no problem, so the connection is working, the only thing which is not working is my writing via entityManager.persist(object o).
As soon as I define my bean as @stateless and add the @PersistenceContext to my bean, i on the button click the following exception:
11:13:48,443 WARN [lifecycle] Could not instantiate Seam component: registeraction
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: registeraction
| at org.jboss.seam.Component.newInstance(Component.java:1708)
| at org.jboss.seam.Component.getInstance(Component.java:1611)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| 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:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.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 org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| 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.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:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.naming.NameNotFoundException: testPro not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1075)
| at org.jboss.seam.Component.instantiate(Component.java:1061)
| at org.jboss.seam.Component.newInstance(Component.java:1704)
| ... 54 more
| 11:13:48,443 WARN [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl at 11fb2e0) threw exception
| javax.faces.FacesException: Could not instantiate Seam component: registeraction
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
| 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.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:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: registeraction
| at org.jboss.seam.Component.newInstance(Component.java:1708)
| at org.jboss.seam.Component.getInstance(Component.java:1611)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| 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:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.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 org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| ... 36 more
| Caused by: javax.naming.NameNotFoundException: testPro not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1075)
| at org.jboss.seam.Component.instantiate(Component.java:1061)
| at org.jboss.seam.Component.newInstance(Component.java:1704)
| ... 54 more
| 11:13:48,443 ERROR [ExceptionFilter] uncaught exception
| javax.servlet.ServletException: Could not instantiate Seam component: registeraction
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 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:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: registeraction
| at org.jboss.seam.Component.newInstance(Component.java:1708)
| at org.jboss.seam.Component.getInstance(Component.java:1611)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| 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:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.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 org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| 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)
| ... 33 more
| Caused by: javax.naming.NameNotFoundException: testPro not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1075)
| at org.jboss.seam.Component.instantiate(Component.java:1061)
| at org.jboss.seam.Component.newInstance(Component.java:1704)
| ... 54 more
| 11:13:48,475 ERROR [ExceptionFilter] exception root cause
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: registeraction
| at org.jboss.seam.Component.newInstance(Component.java:1708)
| at org.jboss.seam.Component.getInstance(Component.java:1611)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| 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:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.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 org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| 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.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:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.naming.NameNotFoundException: testPro not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1075)
| at org.jboss.seam.Component.instantiate(Component.java:1061)
| at org.jboss.seam.Component.newInstance(Component.java:1704)
| ... 54 more
| 11:13:48,475 INFO [Exceptions] reading exception mappings from /WEB-INF/pages.xml
| 11:13:48,490 ERROR [DebugPageHandler] redirecting to debug page
| javax.naming.NameNotFoundException: testPro not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1075)
| at org.jboss.seam.Component.instantiate(Component.java:1061)
| at org.jboss.seam.Component.newInstance(Component.java:1704)
| at org.jboss.seam.Component.getInstance(Component.java:1611)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| 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:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.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 org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| 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.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:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
Without @Stateless and @PersistenceContext its working fine, i just doesnt write anything in my database.
Have you any idea?
Here my XML. Files and my code:
Persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <!-- Persistence deployment descriptor for dev profile -->
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
|
| <persistence-unit name="testPro">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/testProDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
| <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
| </properties>
| </persistence-unit>
|
| </persistence>
|
components.xml
<?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
| <core:init debug="true" jndi-pattern="testPro/#{ejbName}/local"/>
| <core:manager concurrent-request-timeout="500"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr" conversation-timeout="120000"/>
| <core:managed-persistence-context auto-create="true"
| entity-manager-factory="#{testProEntityManagerFactory}" name="entityManager"/>
| <core:entity-manager-factory name="testProEntityManagerFactory" persistence-unit-name="testPro"/>
| <core:ejb installed="false"/>
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>/security.drl</value>
| </drools:rule-files>
| </drools:rule-base>
| <security:identity authenticate-method="#{authenticator.authenticate}"
| remember-me="true" security-rules="#{securityRules}"/>
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
| </components>
|
web.xml
| <?xml version="1.0" ?>
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
| <!-- Ajax4jsf (must come first!) -->
|
| <filter>
| <display-name>Ajax4jsf Filter</display-name>
| <filter-name>ajax4jsf</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>ajax4jsf</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
| </context-param>
|
| <!-- Seam -->
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <!-- Facelets development mode (disable in production) -->
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <security-constraint>
| <display-name>Restrict raw XHTML Documents</display-name>
| <web-resource-collection>
| <web-resource-name>XHTML</web-resource-name>
| <url-pattern>*.xhtml</url-pattern>
| </web-resource-collection>
| </security-constraint>
|
| </web-app>
|
registeraction.java
package org.domain.testPro.session;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.NoResultException;
| import javax.persistence.PersistenceContext;
|
|
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.core.FacesMessages;
|
| @Stateless
| @Name("registeraction")
| public class RegisterAction {
|
|
| @In
| FacesMessages facesMessages;
|
| @In Users users;
|
| @PersistenceContext
| private EntityManager entityManager;
|
| public boolean register(){
|
| try{
|
| entityManager.createQuery(
| "Select username from Users where username = #{users.username}")
| .getSingleResult();
|
| FacesMessages.instance().add("User already in use. Sorry. Nommel.");
| return false;
|
| }catch(NoResultException e)
| {
| FacesMessages.instance().add("Registered with #{users.username}");
| entityManager.persist(users);
| return true;
| }
|
| }
|
| }
|
jboss-web.xml
<jboss-web>
| <class-loading java2ClassLoadingCompliance="false">
| <loader-repository>
| seam.jboss.org:loader=testPro
| <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
| </loader-repository>
| </class-loading>
| </jboss-web>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076191#4076191
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076191
More information about the jboss-user
mailing list