[jBPM] - [jBPM4.4] process instance is in STATE_ASYNC
by Jee Yi
Jee Yi [http://community.jboss.org/people/jeeyi] created the discussion
"[jBPM4.4] process instance is in STATE_ASYNC"
To view the discussion, visit: http://community.jboss.org/message/640693#640693
--------------------------------------------------------------
Hi,
I have defined a workflow so that it starts asynchronously. And there is a custom activity that implements ExternalActivity. In the execute method, I create Runnable object and submit to a custom thread pool, and then call execution.waitForSignal(). The new thread runs its own tasks and signals the execution in "work".
In the new thread, where it looks for the active execution in "work" sometimes throws an exception:
Execution execution = processInstance.findActiveExecutionIn("work");
The reason is because the state of the process instance is STATE_ASYNC and not STATE_ACTIVE_ROOT. Does anyone know why?
This is web application and we start multiple process instances concurrently. We are using jBPM JobExecutor with default configuration. When I start about 10 process instances, I see one or two process instances failed to move on to the next activity because we were not able to signal the execution.
1) Does anyone know what's going wrong here?
2) Any suggestion how to make process instance move from STATE_ASYNC to STATE_ACTIVE_ROOT?
3) Or is there a way to signal process instance in STATE_ASYNC?
| 5 | <start name="async-start" continue="async" > |
| 6 | <transition to="work"/> |
| 7 | </start> |
| 8 | |
| 9 | <custom name="work" expr="#{startWorkAndWait}" > |
| 10 | <transition name="ok" to="send mail" /> |
| 11 | <transition name="error" to="send error mail" /> |
| 12 | </custom>
|
| 1 |
|
public *class StartWorkAndWait* implements *ExternalActivity* {
public void execute(ActivityExecution execution) {
// created Runnable and submitted to a custom ThreadPool
*execution.waitForSignal();*
}
public void signal(ActivityExecution execution,
String signalName,
Map<String, Object> parameters) {
*execution.take(signalName);*
}
}
Thanks,
Jee
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640693#640693]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[Javassist] - Help for java.lang.VerifyError when modify a method
by Eirc Zhao
Eirc Zhao [http://community.jboss.org/people/zhaoxwen] created the discussion
"Help for java.lang.VerifyError when modify a method"
To view the discussion, visit: http://community.jboss.org/message/640621#640621
--------------------------------------------------------------
Hi,all,
I write a class named Bsafproxy which will change the method of the org.jdesktop.application.ResourceMap in the basf-1.9.jar; I don't know why it can not work, who will do me a faver, give me some idears, thanks.
BTW, BsafProxy.java is my class, and the bsaf-1.9.jar is witch i wanna to modifed.
package org.eric.javassist;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.CtNewMethod;
import javassist.Loader;
import javassist.NotFoundException;
/**
* @author apple
*
*/
public class BsafProxy {
/**
* @param args
*/
public static void main(String[] args) {
try {
ClassPool csPool = ClassPool.getDefault();
csPool.insertClassPath("/Users/apple/Documents/Eric/work/eclipse/workspace/HelloMac/bsaf-1.9.jar");
CtClass demoClass = csPool.get("org.jdesktop.application.ResourceMap");
CtMethod populateResourceMap = demoClass.getDeclaredMethod("populateResourceMap");
demoClass.removeMethod(populateResourceMap);
CtMethod newPopulate = CtNewMethod.make(getContent(), demoClass);
demoClass.addMethod(newPopulate);
// URL clazz = csPool.find("org.jdesktop.application.ResourceMap");
Loader loader = new Loader(csPool);
Class clazz = loader.loadClass("org.jdesktop.application.ResourceMap");
clazz.newInstance();
} catch (NotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CannotCompileException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static String getContent() {
// private void populateResourceMap(String bundleName, Map<String, Object> bundlesMap) {
// try {
// ResourceBundle bundle = ResourceBundle.getBundle(bundleName, locale, classLoader);
// Enumeration<String> keys = bundle.getKeys();
// while (keys.hasMoreElements()) {
// String key = keys.nextElement();
// bundlesMap.put(key, bundle.getObject(key));
// }
// } catch (MissingResourceException ignore) {
// /* bundleName is just a location to check, it's not
// * guaranteed to name a ResourceBundle
// */
// }
// }
StringBuffer content = new StringBuffer();
content.append("private void populateResourceMap(String bundleName, java.util.Map bundlesMap) {");
content.append("try {");
content.append(" java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle($1, locale, classLoader);");
content.append(" java.util.Enumeration keys = bundle.getKeys();");
content.append(" while (keys.hasMoreElements()) {");
content.append(" String key = keys.nextElement();");
content.append(" $2.put(key, bundle.getObject(key));");
content.append(" }");
content.append("} catch (java.util.MissingResourceException ignore) { }");
content.append("}");
return content.toString();
}
}
ouput:
Exception in thread "main" java.lang.VerifyError: (class: org/jdesktop/application/ResourceMap, method: populateResourceMap signature: (Ljava/lang/String;Ljava/util/Map;)V) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.eric.javassist.BsafProxy.main(BsafProxy.java:38)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640621#640621]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[Beginner's Corner] - Data sources
by jepper
jepper [http://community.jboss.org/people/jepper] created the discussion
"Data sources"
To view the discussion, visit: http://community.jboss.org/message/640600#640600
--------------------------------------------------------------
I tried to set up p2spy, on jboss 6.1 final. So, I altered the <driver-class> in oracle-ds.xml and configured the oracle driver in spy.properties, and fired up jboss. Fine. Nothing captured however. Application still working.
So decided to revert my change to the oracle driver, but I also made a deliberate error in oracle-ds.xml which I thought would stop jboss from speaking to Oracle.
It does however work. I can log in to the application, make changes, and the changes persists across jboss restarts.
I would like to understand where else database connectivity could be configured?
Does hibernate have it's own data source configuration when it's running in jboss?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640600#640600]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month