[JBoss jBPM] - Re: Transient variables between process and subprocess
by nizzy
Hi Guys,
I know this was a long time ago, but I'm trying to access a super-process transient variables via a sub-process.
In an ActionHandler I extract the transient variable map. When in the super-process the map contains the expected variables, however the sub-process map is null.
Is there anything special I need to do, have done, so that the
| subContextInstance.setTransientVariables(superContextInstance.getTransientVariables());
|
line of code in ProcessState is executed?
Currently all I'm doing is using the super-process to find the sub-process and signalling the sub-process.
public void signalSubProcess(long processInstanceId, String transitionName) {
| log.info("Signalling Sub Process");
|
| // Find ProcessInstance
| JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext();
| try {
| GraphSession gs = ctx.getGraphSession();
| gs.lockProcessInstance(processInstanceId);
|
| ProcessInstance instance = ctx.getProcessInstanceForUpdate(processInstanceId);
| log.info("Root Token of instance is " + instance.getRootToken().getId());
|
| ProcessInstance subInstance = instance.getRootToken().getSubProcessInstance();
| if (instance.hasEnded()) {
| log.info("SubProcess Instance has already ended so cannot signal");
| }
|
| if (subInstance != null) {
| signal(subInstance, transitionName);
| } else {
| String msg = "ProcessInstance not found";
| log.info(msg);
| throw new RuntimeException(msg);
| }
|
| } finally {
| ctx.close();
| }
| }
Am I calling the sub-process incorrectly, and as a result not executing the code included in the ProcessState class?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173988#4173988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173988
17 years, 7 months
[JBoss Cache: Core Edition] - Why does TreeCache notify when putting data gotten by a read
by jimshowalter
We are very happy with TreeCache and CacheLoader--the documentation for both is first-rate, and the code works perfectly in our application.
However, there is one thing about the design that puzzles us, and we're hoping you can explain it.
In our implementation, we currently don't use a CacheLoader. Instead, we have code that follows this pattern:
result = null;
try
{
result = cache.get(key for what we want);
}
catch (Exception e)
{
dead...
}
if (result == null)
{
try
{
result = database.get(key for what we want);
}
catch (Exception e)
{
dead...
}
cache.put(key for what we want, result); // Spurious notification sent here.
}
return result;
}
That was how we got our prototype working, but we always planned to implement our own CacheLoader to save and retrieve our data from our database, so that we wouldn't be doing the puts to the cache of what we retrieved from the database.
The reason we didn't want to do the puts ourselves on reads from the database is we figured that would send spurious notifications to other caches listening in our cluster, at the point commented "// Spurious notification sent here.".
We think of that notification as spurious because it wasn't caused by a change to the data--it was caused simply by reading some data and putting it in the cache, and why would other listeners in the cluster care about a non-data-changing event? (They can fetch the data themselves if they need it, and if they don't need it, why would they want to be notified that another cache in the cluster happened to want it?)
We figured when you call a CacheLoader, you do a put-*without*-notification to the cache. We figured put-without-notification is a hidden method, because it's not in the TreeCache API (and if it was, we would have called it instead of the standard put).
So last week we dug into the CacheLoaderInterceptor code, and discovered that you don't call a special put-without-notification method. Instead, you do this:
private NodeSPI loadNode(InvocationContext ctx, Fqn fqn, NodeSPI n, TransactionEntry entry) throws Exception
{
if (trace) log.trace("loadNode " + fqn);
Map nodeData = loadData(fqn);
if (nodeData != null)
{
if (trace) log.trace("Node data is not null, loading");
cache.getNotifier().notifyNodeLoaded(fqn, true, Collections.emptyMap(), ctx); // Spurious notification sent here.
if (isActivation)
{
cache.getNotifier().notifyNodeActivated(fqn, true, Collections.emptyMap(), ctx); // Spurious notification sent here.
}
n = createNodes(fqn, entry);
// n.clearDataDirect();
n.setInternalState(nodeData);
// set this node as valid?
if (usingOptimisticInvalidation) n.setValid(true, false);
cache.getNotifier().notifyNodeLoaded(fqn, false, nodeData, ctx); // Spurious notification sent here.
if (isActivation)
{
cache.getNotifier().notifyNodeActivated(fqn, false, nodeData, ctx); // Spurious notification sent here.
}
}
if (n != null && !n.isDataLoaded())
{
if (trace) log.trace("Setting dataLoaded to true");
n.setDataLoaded(true);
}
return n;
}
Why do you notify other caches in a cluster when data is loaded from the database?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173985#4173985
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173985
17 years, 7 months
[Installation, Configuration & DEPLOYMENT] - Re: Problem in deploying web modules
by kvijayk
01:39:18,467 ERROR [JBossWeb] Problem in init
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.read(Unknown Source)
at java.util.jar.JarInputStream.read(Unknown Source)
at org.jboss.util.file.JarUtils.unjar(JarUtils.java:300)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:325)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.deployment.SubDeployerInterceptorSupport.init(SubDeployerInterceptorSupport.java:119)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.init(SubDeployerInterceptorSupport.java:172)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:87)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.init(Unknown Source)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
01:39:18,488 ERROR [MainDeployer] Could not initialise deployment: file:/opt/local/jboss/server/default/deploy/ACES4-DEV-BUILD-20080903-092324.war
org.jboss.deployment.DeploymentException: Unexpected end of ZLIB input stream; - nested throwable: (java.io.EOFException: Unexpected end of ZLIB input stream)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:374)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.deployment.SubDeployerInterceptorSupport.init(SubDeployerInterceptorSupport.java:119)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.init(SubDeployerInterceptorSupport.java:172)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:87)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.init(Unknown Source)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.read(Unknown Source)
at java.util.jar.JarInputStream.read(Unknown Source)
at org.jboss.util.file.JarUtils.unjar(JarUtils.java:300)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:325)
... 40 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173978#4173978
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173978
17 years, 7 months