John Lewis [https://community.jboss.org/people/john0945] created the discussion

"Update Process Definitions timeout - with solution."

To view the discussion, visit: https://community.jboss.org/message/795847#795847

--------------------------------------------------------------
Summary: I resolved class java.io.IOException / timeout error when updating 
processes in the jBPM console by fixing errors in my process.

Hi. Just wanted to post something I've been struggling with. I installed jBPM5 
with the installer, and started developing my own process. Everything was going 
smoothly, until after I added a XOR gateway. I started getting an errror when 
trying to update the processes in the jBPM console. I got a popup error 
message, and no process definitions, though there should have been three. 
Here's the error:

2013-02-04 08:55:19,851 [DEBUG] GET:  
http://localhost:8080/gwt-console-server/rs/process/definitions 
http://localhost:8080/gwt-console-server/rs/process/definitions
2013-02-04 08:56:18,982 [ERROR] <ul><li>URL: ' 
http://localhost:8080/gwt-console-server/rs/process/definitions 
http://localhost:8080/gwt-console-server/rs/process/definitions'
<li>Action: 'org.jboss.bpm.console.client.process.UpdateDefinitionsAction'
<li>Exception: 'class java.io.IOException'</ul>

Request timeout
java.io.IOException:
Request timeout
    at Unknown.$fillInStackTrace_1(JsArrayString.java:42)
    at Unknown.$IOException(StackTraceCreator.java:366)
    at Unknown.run_17(AbstractRESTAction.java:120)
    at Unknown.fire(Timer.java:141)
    at Unknown.anonymous(Timer.java:60)
    at Unknown.entry0(Impl.java:146)
    at Unknown.anonymous(Impl.java:56)


I tried restarting the server, downloading new WAR files, redeploying the WAR 
files... everything I could think of. Sometimes it would work for a bit.

Eventually, I decided to first fix the compilation error I was getting when 
trying to build the package. In the conditions of the gateways (which are set 
on the branches leaving the gateway), I was trying to use a boolean process 
variable, but I was getting errors because the getVariable() method returns an 
object, which I was trying to cast to a boolean. After discovering this, I 
changed the code, and the build was successful. Here's the old and new code.

OLD: boolean decision = (boolean)kcontext.getVariable("instock");
         return decision;

NEW: boolean decision = kcontext.getVariable("instock").equals(true);
          return decision;

For information on the getVariable() method, I used:
 
http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/process/instance/context/variable/VariableScopeInstance.html
 
http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/process/instance/context/variable/VariableScopeInstance.html

For information on the equals() method, I used:
 http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/BooleanExpression.html 
http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/task/BooleanExpression.html

After changing to the new code, I updated the processes and didn't get the 
timeout issue. 

To check I had actually solved it by changing the code, I reverted back to the 
old code. The process was now not valid, so the Console didn't update to the 
new version. I rebooted the server to force it to work with the invalid 
version. Now, the Console didn't pick up the invalid process at all (but 
successfully loads the other valid processes I have, without giving the timeout 
error).

To attempt to recreate the timeout error, I reverted to an even older version 
of code (the version that was in use when the server booted up, and gave the 
timeout error). Here I tried to save an Object into a Boolean variable without 
casting.

OLDER: boolean decision = (boolean)kcontext.getVariable("instock");
             return decision;

After changing back to this code, I restarted the server. It took a couple 
tries before the console and Guvnor showed in the browser, but when it did, the 
process still didn't show up. The timeout error didn't come back.

Then, I changed back to the new code, built the package and refreshed the 
processes in the Console. The process then showed up (without having to reboot).

In conclusion, if you encounter a timeout error while updating the process 
definitions in the jBPM console, or the process doesn't show up, check that you 
can successfully build the package that the process is in. (This is done under 
the edit tab of the package, in Drools Guvnor. See section 3.6 of the jBPM 
installer guide for a video of how to do it.  
http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e571 
http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e571).
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/795847#795847]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to