I've been basically trying to rewrite the seam example registration code for
practice and have a nearly 100% identical version but the example version works
but not my code. I can't seem to figure this one out, it can't seem to find the
registerNewUser method of my Action Session bean. Below is the exception stack:
2006-04-16 13:16:48,828 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myl].[Faces
Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error calling action method of component with id
_id0:_id20
at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at
org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
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.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)
Caused by: javax.faces.el.EvaluationException: Exception while invoking
expression #{register.registerNewUser}
at
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
... 25 more
Caused by: javax.ejb.EJBException: java.lang.NullPointerException
at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
at
org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
at $Proxy189.registerNewUser(Unknown Source)
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
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
... 26 more
Caused by: java.lang.NullPointerException
at org.jboss.seam.Component.forName(Component.java:1011)
at
org.jboss.seam.ejb.SeamInterceptor.getSeamComponent(SeamInterceptor.java:61)
at
org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:34)
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
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:120)
at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:62)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
... 46 more
JSp line that executions the action is:
mandButton value="Create" type="submit" action="#{register.registerNewUser}"/>
|
Below is my version of the example session register classes:
| package com.myl.session;
|
| import javax.ejb.Local;
|
| @Local
| public interface RegisterUser {
| public String registerNewUser();
| }
|
|
| And:
| package com.myl.session;
|
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.ejb.Interceptors;
| import javax.ejb.Stateless;
| import javax.faces.application.FacesMessage;
| import javax.faces.context.FacesContext;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.hibernate.validator.Valid;
| import org.jboss.seam.annotations.IfInvalid;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Outcome;
| import org.jboss.seam.ejb.SeamInterceptor;
|
| import com.myl.Constants;
| import com.myl.TLStringConstants;
| import com.myl.entity.UserBean;
| import com.myl.entity.UserRole;
|
| @Stateless
| @Name("register")
| @Interceptors(SeamInterceptor.class)
| public class RegisterUserBean implements RegisterUser {
|
| @In ("user")
| @Valid
| private UserBean m_user;
|
| @PersistenceContext
| private EntityManager em;
|
| @In
| private FacesContext facesContext;
|
| @IfInvalid(outcome = Outcome.REDISPLAY)
| public String registerNewUser() {
| List existing = em.createQuery(
| "select emailAddress from User where
emailAddress=:emailAddress")
| .setParameter("emailAddress",
m_user.getEmailAddress()).getResultList();
|
| if (existing.size() == 0) {
| ArrayList<UserRole> userRoles = new
ArrayList<UserRole>();
| UserRole newRole = new UserRole();
| newRole.setRoleName(Constants.DEFAULT_ROLE);
| m_user.setUserRoles(userRoles);
| em.persist(m_user);
| return "success";
| } else {
| facesContext.addMessage(null, new
FacesMessage(Constants.getTranslatedString(TLStringConstants.ERROR_USER_EXISTS_TAG)+m_user.toString()));
| return null;
| }
| }
| }
|
|
| Any Ideas?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3937601#3937601
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3937601
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user