[jboss-user] [JBoss Seam] - pageflow and exception question
pietermartin
do-not-reply at jboss.com
Mon Nov 26 15:31:54 EST 2007
Hi,
I am struggling to get exception handling to work with jpdl pageflows. Not sure whether it is suppose to work or whether the code needs decision elements everywhere to check for failures.
Currently I get an exception with the page breaking
my pageflow-definition is as follows
| <page name="captureContactDetails" view-id="/signyouup/contactDetails.xhtml" no-conversation-view-id="/signyouup/choosePhone.xhtml">
| <redirect />
| <transition name="back" to="capturePhoneDetails">
| </transition>
| <transition name="next" to="isCaptureContactSuccessful">
| <action expression="#{webCustomerAction.persistContact}" />
| </transition>
| </page>
|
the action class
| @Name("webCustomerAction")
| @Scope(ScopeType.CONVERSATION)
| public class WebCustomerAction extends SeamedAction {
|
| public String persistContact() {
| log.info("persistContact");
| if (true) {
| throw new SelfcareApplicationException("O my what absolute horror!");
| }
| }
| }
|
in pages...
| <exception>
| <end-conversation/>
| <redirect view-id="/error.xhtml">
| <message severity="error">#{org.jboss.seam.handledException.message}</message>
| </redirect>
| </exception>
|
The stack trace...
| 22:11:13,652 INFO [WebCustomerAction] persistContact
| 22:11:13,697 ERROR [GraphElement] action threw exception: couldn't evaluate expression '#{webCustomerAction.persistContact}'
| org.jbpm.JbpmException: couldn't evaluate expression '#{webCustomerAction.persistContact}'
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:43)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:30)
| at org.jbpm.graph.def.Action.execute(Action.java:118)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:70)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:262)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
| at org.jbpm.graph.def.Transition.take(Transition.java:138)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.exe.Token.signal(Token.java:195)
| at org.jbpm.graph.exe.Token.signal(Token.java:158)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:283)
| at org.jboss.seam.pageflow.Pageflow.signal(Pageflow.java:477)
| at org.jboss.seam.pageflow.Pageflow.navigate(Pageflow.java:336)
| at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:40)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
| at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
| at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
| 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.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.el.PropertyNotFoundException: Property 'persistContact' not found on type com.yannitech.virgin.selfcare.customer.manager.WebCustomerAction_$$_javassist_2
| at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
| at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
| at javax.el.BeanELResolver.property(BeanELResolver.java:279)
| at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at org.jboss.seam.bpm.SeamExpressionEvaluator$1.evaluate(SeamExpressionEvaluator.java:85)
| at org.jboss.seam.bpm.SeamExpressionEvaluator.evaluate(SeamExpressionEvaluator.java:36)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:39)
| ... 59 more
| 22:11:13,700 WARN [lifecycle] couldn't evaluate expression '#{webCustomerAction.persistContact}'
| org.jbpm.JbpmException: couldn't evaluate expression '#{webCustomerAction.persistContact}'
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:43)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:30)
| at org.jbpm.graph.def.Action.execute(Action.java:118)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:70)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:262)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
| at org.jbpm.graph.def.Transition.take(Transition.java:138)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.exe.Token.signal(Token.java:195)
| at org.jbpm.graph.exe.Token.signal(Token.java:158)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:283)
| at org.jboss.seam.pageflow.Pageflow.signal(Pageflow.java:477)
| at org.jboss.seam.pageflow.Pageflow.navigate(Pageflow.java:336)
| at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:40)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
| at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
| at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
| 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.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.el.PropertyNotFoundException: Property 'persistContact' not found on type com.yannitech.virgin.selfcare.customer.manager.WebCustomerAction_$$_javassist_2
| at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
| at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
| at javax.el.BeanELResolver.property(BeanELResolver.java:279)
| at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at org.jboss.seam.bpm.SeamExpressionEvaluator$1.evaluate(SeamExpressionEvaluator.java:85)
| at org.jboss.seam.bpm.SeamExpressionEvaluator.evaluate(SeamExpressionEvaluator.java:36)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:39)
| ... 59 more
| 22:11:13,701 WARN [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl at 1aa39a3) threw exception
| javax.faces.FacesException: couldn't evaluate expression '#{webCustomerAction.persistContact}'
| 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.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jbpm.JbpmException: couldn't evaluate expression '#{webCustomerAction.persistContact}'
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:43)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:30)
| at org.jbpm.graph.def.Action.execute(Action.java:118)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:70)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:262)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
| at org.jbpm.graph.def.Transition.take(Transition.java:138)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.exe.Token.signal(Token.java:195)
| at org.jbpm.graph.exe.Token.signal(Token.java:158)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:283)
| at org.jboss.seam.pageflow.Pageflow.signal(Pageflow.java:477)
| at org.jboss.seam.pageflow.Pageflow.navigate(Pageflow.java:336)
| at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:40)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
| at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
| at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| ... 38 more
| Caused by: javax.el.PropertyNotFoundException: Property 'persistContact' not found on type com.yannitech.virgin.selfcare.customer.manager.WebCustomerAction_$$_javassist_2
| at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
| at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
| at javax.el.BeanELResolver.property(BeanELResolver.java:279)
| at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at org.jboss.seam.bpm.SeamExpressionEvaluator$1.evaluate(SeamExpressionEvaluator.java:85)
| at org.jboss.seam.bpm.SeamExpressionEvaluator.evaluate(SeamExpressionEvaluator.java:36)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:39)
| ... 59 more
|
|
I see that in the dvd example app the action methods are themselves ocurring in a try catch block
eg.
| public String saveUser() {
| if (!isValidNamePassword()) {
| facesMessages.add("User name #{customer.userName} is not unique");
| return null;
| }
|
| try {
| em.persist(customer);
| sessionContext.set("currentUser", customer);
| Actor.instance().setId(customer.getUserName());
|
| identity.setUsername(customer.getUserName());
| identity.setPassword(customer.getPassword());
| identity.login();
|
| facesMessages.addFromResourceBundle("createCustomerSuccess");
| return "success";
| } catch (InvalidStateException e) {
| InvalidValue[] vals = e.getInvalidValues();
| for (InvalidValue val: vals) {
| facesMessages.add(val);
| }
|
| return null;
| } catch (RuntimeException e) {
| ctx.setRollbackOnly();
|
| facesMessages.addFromResourceBundle("createCustomerError");
|
| return null;
| }
| }
|
Is this the preferred way?
Any pointers appreciated.
I am using seam-2.0.0.GA and jboss 4.2.2.GA
Thanks
Pieter
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107881#4107881
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107881
More information about the jboss-user
mailing list