[JBoss Seam] - Please help me! The page cannot change when jbpm is used.
by kumachan
Hello.
I want to make the sample program of seam, and to change in pageflow.jpdl.xml the screen.
The program moves well when pageflow.jpdl.xml is not used.
However, it is not possible to control with jbpm.
Following information comes out though the error has not gone out.
Could anyone advise,please?
## Environment ##
JBOSS4.0.5GA
jdk1.5.0_06
jboss-seam-1.0.1.GA
jbpm-3.1.2.jar
## Server Log ##
21:35:06,420 INFO [EARDeployer] Started J2EE application: file:/C:/usr/local/jboss-4.0.5.GA/server/default/deploy/ks.ear
| 21:35:17,545 INFO [Events] no events.xml file found
| 21:35:17,623 INFO [Pages] no pages.xml file found
| 21:35:18,576 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
| 21:35:18,576 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
| 21:35:18,592 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
## RegisterAction.java ##
@Stateful
| @Name("register")
| @Scope(CONVERSATION)
| public class RegisterAction implements Register {
|
| ????@In(required=false) @Valid
| ????@Out(required=false)
| ????public User user;
|
| ????@PersistenceContext
| ????private EntityManager em;
|
| ????@Logger
| ????private Log log;
|
| ????@In(create=true)
| ????private transient FacesMessages facesMessages;
|
| ????@Create
| ????@Begin(pageflow="index")
| ????public void index(){}
|
| ????public void register(){
| ????????user = new User();
| log.info("register()");
| ????}
|
| ????public void confirm(){
| if(user.getUsername().equals(" ")){
| ????facesMessages.add("Please input UserId.");
| }
| ????}
|
| ????@End
| ????public void registered(){
| em.persist(user);
| log.info(user.getUsername()");
| ????}
|
| ????@Destroy
| ????@Remove
| ????public void destroy(){}
| }
## index.jsp ##
<%@ page language="java" contentType="text/html; charset=Shift_JIS" pageEncoding="MS932"%>
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
| <html><head><title>Menu</title></head>
|
| <script type="text/javascript" src="seam/remoting/resource/remote.js">
| </script>
| <script type="text/javascript" src="seam/remoting/interface.js?register">
| </script>
|
| <body>
| <f:view>
| ????<h:form>
| <h:commandButton type="submit" value="entry" ?action="register" />
| ????</h:form>
| </f:view>
| </body></html>
## application.xml ##
<application>
| ????<display-name>ks</display-name>
| ????<module>
| <web>
| ????<web-uri>ks.war</web-uri>
| ????<context-root>/ks</context-root>
| </web>
| ????</module>
| ????<module>
| <ejb>ks.jar</ejb>
| ????</module>
| ????<module>
| <java>jboss-seam.jar</java>
| ????</module>
| ????<module>
| <java>jbpm-3.1.2.jar</java>
| ????</module>
| </application>
## seam.properties ##
org.jboss.seam.init.componentClasses org.jboss.seam.core.Jbpm
| org.jboss.seam.core.jbpm.pageflowDefinitions pageflow.jpdl.xml
It becomes deploy error if it describes it in component.xml.
## pageflow.jpdl.xml ##
<?xml version="1.0" encoding="UTF-8"?>
|
| <pageflow-definition name="registerflow">
| <start-page name="index" view-id="/index.jsp">
| <redirect/>
| <transition name="register" to="register">
| <action expression="#{register.register}" />
| </transition>
| </start-page>
| <page name="register" view-id="/register.jsp">
| <redirect/>
| <transition name="confirm" to="confirm">
| <action expression="#{register.confirm}" />
| </transition>
| </page>
| <page name="confirm" view-id="/confirm.jsp">
| <redirect/>
| <transition name="registered" to="registered">
| <action expression="#{register.registered}" />
| </transition>
| </page>
| <page name="registered" view-id="/registered.jsp">
| <redirect/>
| <end-conversation />
| </page>
| </pageflow-definition>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989675#3989675
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989675
19Â years, 5Â months
[JBoss Seam] - Re: Debug page intercepts handled exceptions in 1.1
by rbz285
thanks, I've just tried the fix using the 20061129 nightly build that has the change in it but it doesn't work for me, it still shows the debug page
I've checked that the download includes the source change
| static ThreadLocal marker = new ThreadLocal();
|
| @AroundInvoke
| public Object handleExceptions(InvocationContext invocation) throws Exception
| {
| boolean outermost = marker.get() == null;
| marker.set(this);
| try {
| return invocation.proceed();
| } catch (Exception e) {
| if (outermost && FacesContext.getCurrentInstance()!=null) {
| return Exceptions.instance().handle(e);
| } else {
| throw e;
| }
| } finally {
| marker.remove();
| }
| }
|
I reckon it doesn't work for me because my first bean actually calls 2 different methods on my second bean and so the above code calls marker.remove() after the first call to the second bean, hence the next call is treated as the outermost.
It would probably be better to only bother with the exception logic if its actually going to be used, something like:
| @AroundInvoke
| public Object handleExceptions(InvocationContext invocation) throws Exception
| {
| boolean outermost = marker.get() == null;
| if (outermost) {
| marker.set(this);
| try {
| return invocation.proceed();
| } catch (Exception e) {
| if (FacesContext.getCurrentInstance()!=null) {
| return Exceptions.instance().handle(e);
| } else {
| throw e;
| }
| } finally {
| marker.remove();
| }
| }
| else {
| return invocation.proceed();
| }
| }
|
what do you reckon ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989667#3989667
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989667
19Â years, 5Â months