[jBPM Users] - Re: jBPM 4 and thread-safeness
by greeneagle
First of all thanks for the fast response :-)
If this is the wrong forum for this kind of question could you please move the thread to the dev-forum? ...because I still have some questions concerning this issue.
anonymous wrote :
| in strickt java sense, nutable methods on threadsafe objects should be synchronized. in jbpm sense, the only requirement is that you don't change your member fields in the execute method.
|
I totally agree to that approach. It's the same as the singleton-model in spring. The threadsafeness (even more: reintrance) is guaranteed if the developer observes some basic rules. If he does not strange things may occur.
anonymous wrote :
| in jbpm 4, we want to get to a situation that the event listener object becomes a part of the process definition object graph. and hence it gets cached and used by all threads
|
How can you handle this? IMHO this strategy only can work if the member variables of a handler-impl are set with constant values. Since it is possible to inject dynamic values in a member-var (e.g. return values from a prior method-call) it will have the same effect than changing the member fields in the handler-class itself.
For better explanation of what I mean a short piece of code (sorry it is JBPM 3-style but I am atm still a rookie in JBPM 4 :-( )
| // in class A I create a ProcessDefinition
| ProcessDefinition pd = new ProcessDefinition(...);
|
| // now I start a couple of instances of class B (which extend Thread)
| // and start the threads
| for(int i = 0; i < 100; i++) {
| new B(pd).start();
| }
|
| // class B looks something like that:
| public class B extends Thread {
|
| private ProcessDefinition pd;
|
| public B(ProcessDefinition pd) {
| this.pd = pd;
| }
|
| public void run() {
| //Note that I start the ProcessInstance depending on the same ProcessDefinition-instance
| ProcessInstance pi = new ProcessInstance(this.pd);
| pi.signal();
| }
| }
|
In JBPM 3 an action-delegate was instantiated at first access. After that the already instantiated object was used:
| // snippet from Delegation
| public Object getInstance() {
| if (instance==null) {
| instance = instantiate();
| }
| return instance;
| }
|
So if I understood you right the behaviour must be the same than in JBPM 4 after the point of the instantiation of the delegate.
This code produces the result I explained before:
If the member-fields of the used handlers are only set with constant values everything works fine
If the member-fields are set dynamically (e.g. via expressions) it becomes broken
And now the big question:
Have I understood something wrong or is this kind of test-scenario (multiple threads using the same ProcessDefinition-instance for instantiating ProcessDefinitions a kind of operation outside the specification?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254836#4254836
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254836
15 years, 4 months
[jBPM Users] - Re: Signaling executions for processes that containt tasks d
by LMarinkov
/*
| * JBoss, Home of Professional Open Source
| * Copyright 2005, JBoss Inc., and individual contributors as indicated
| * by the @authors tag. See the copyright.txt in the distribution for a
| * full listing of individual contributors.
| *
| * This is free software; you can redistribute it and/or modify it
| * under the terms of the GNU Lesser General Public License as
| * published by the Free Software Foundation; either version 2.1 of
| * the License, or (at your option) any later version.
| *
| * This software is distributed in the hope that it will be useful,
| * but WITHOUT ANY WARRANTY; without even the implied warranty of
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
| * Lesser General Public License for more details.
| *
| * You should have received a copy of the GNU Lesser General Public
| * License along with this software; if not, write to the Free
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
| */
| package org.jbpm.test.history;
|
| import java.util.Map;
|
| import org.jbpm.api.Execution;
| import org.jbpm.test.JbpmTestCase;
|
|
| /**
| * @author Tom Baeyens
| */
| public class AvgDurationTest extends JbpmTestCase {
|
| public void testAvgDuration() throws Exception {
| deployJpdlXmlString(
| "<process name='Insurance claim' key='ICL'>" +
| " <start>" +
| " <transition to='one' />" +
| " </start>" +
| " <task name='one'>" +
| " <transition to='two' />" +
| " </task>" +
| " <task name='two'>" +
| " <transition to='three' />" +
| " </task>" +
| " <task name='three'>" +
| " <transition to='end' />" +
| " </task>" +
| " <end name='end' />" +
| "</process>"
| );
|
| executeProcess();
| executeProcess();
| executeProcess();
|
| Map<String, Long> avgDurations = historyService.avgDurationPerActivity("ICL-1");
|
|
| Long avgDurationOne = avgDurations.get("one");
| assertNotNull(avgDurationOne);
| assertTrue("expected avg duration bigger then 40, but was"+avgDurationOne, avgDurationOne>40);
| Long avgDurationTwo = avgDurations.get("two");
| assertNotNull(avgDurationTwo);
| assertTrue("expected avg duration bigger then 10, but was"+avgDurationTwo, avgDurationTwo>10);
| Long avgDurationThree = avgDurations.get("three");
| assertNotNull(avgDurationThree);
| assertTrue("expected avg duration bigger then 0, but was"+avgDurationThree, avgDurationThree>=0);
|
| assertEquals(3, avgDurations.size());
| }
|
| protected void executeProcess() throws InterruptedException {
| Execution execution = executionService.startProcessInstanceByKey("ICL");
| Thread.sleep(50);
| executionService.signalExecutionById(execution.getId());
| Thread.sleep(20);
| executionService.signalExecutionById(execution.getId());
| executionService.signalExecutionById(execution.getId());
| }
|
| }
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254816#4254816
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254816
15 years, 4 months
[JBoss Remoting Users] - Infinite lock in MicroSocketClientInvoker
by mayankmit2002
I am running 2 Jboss Nodes (4.2.3GA) in a cluster with Jboss Messaging (1.4.2 SP1) and Jboss remoting ( 2.4.0SP1).
Now problem is that if I unplugs the network cable the clients get hanged. When I try to dig out the cause using JConsole. I found follwing thread dumps
| ame: pool-3-thread-1
| State: BLOCKED on java.util.LinkedList@2c1b1c owned by: Thread-29
| Total blocked: 6 Total waited: 71
|
| Stack trace:
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1058)
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:757)
| org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:423)
| org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:175)
| org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:495)
| - locked java.lang.Object@caafcc
| org.jboss.remoting.Client.setupClientLease(Client.java:1673)
| org.jboss.remoting.Client.connect(Client.java:1575)
| org.jboss.remoting.Client.connect(Client.java:487)
| org.jboss.jms.client.remoting.JMSRemotingConnection$1.run(JMSRemotingConnection.java:354)
| java.security.AccessController.doPrivileged(Native Method)
| org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:350)
| org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)
| org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
| org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
| org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
| org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
| org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
| org.jboss.jms.client.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:134)
| sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| java.lang.reflect.Method.invoke(Unknown Source)
| org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)
| org.jboss.jms.client.FailoverCommandCenter.failureDetected(FailoverCommandCenter.java:129)
| org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:124)
| org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| org.jboss.jms.client.delegate.ClientConsumerDelegate$close_N4742752445160157748.invokeNext(ClientConsumerDelegate$close_N4742752445160157748.java)
| org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
| org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| org.jboss.jms.client.delegate.ClientConsumerDelegate$close_N4742752445160157748.invokeNext(ClientConsumerDelegate$close_N4742752445160157748.java)
| org.jboss.jms.client.delegate.ClientConsumerDelegate.close(ClientConsumerDelegate.java)
| org.jboss.jms.client.container.ClosedInterceptor.maintainRelatives(ClosedInterceptor.java:306)
| org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:165)
| org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| org.jboss.jms.client.delegate.ClientSessionDelegate$closing_2473194355759371067.invokeNext(ClientSessionDelegate$closing_2473194355759371067.java)
| org.jboss.jms.client.delegate.ClientSessionDelegate.closing(ClientSessionDelegate.java)
| org.jboss.jms.client.container.ClosedInterceptor.maintainRelatives(ClosedInterceptor.java:305)
| org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:165)
| org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| org.jboss.jms.client.delegate.ClientConnectionDelegate$closing_2473194355759371067.invokeNext(ClientConnectionDelegate$closing_2473194355759371067.java)
| org.jboss.jms.client.delegate.ClientConnectionDelegate.closing(ClientConnectionDelegate.java)
| org.jboss.jms.client.JBossConnection.close(JBossConnection.java:131)
| com.barco.cms.perspectivemgtproxy.eventsupport.PerspectiveMgtEventReader.stopJMSEvents(Unknown Source)
| com.barco.cms.perspectivemgtproxy.eventsupport.PerspectiveMgtEventReader.restartJMSEvents(Unknown Source)
| com.barco.cms.perspectivemgtproxy.PerspectiveMgt.refreshJMSReader(Unknown Source)
| com.barco.cms.perspectivemgtproxy.PerspectiveMgt.disconnectPerspectiveMgtProxy(Unknown Source)
| com.barco.cms.dependency.CmsPerspectiveMgt.disconnectPerspectiveMgtProxy(Unknown Source)
| com.barco.cms.perspectivemgtproxy.eventsupport.PerspectiveMgtEventReader$EventPoller.run(Unknown Source)
| java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
| java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
| java.util.concurrent.FutureTask.run(Unknown Source)
| java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
| java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
| java.lang.Thread.run(Unknown Source)
Name: Thread-29
| State: RUNNABLE
| Total blocked: 1 Total waited: 0
|
| Stack trace:
| java.net.SocketInputStream.socketRead0(Native Method)
| java.net.SocketInputStream.read(Unknown Source)
| java.io.BufferedInputStream.fill(Unknown Source)
| java.io.BufferedInputStream.read(Unknown Source)
| - locked java.io.BufferedInputStream@92446e
| java.io.DataInputStream.readByte(Unknown Source)
| org.jboss.jms.client.remoting.ClientSocketWrapper.checkConnection(ClientSocketWrapper.java:92)
| org.jboss.remoting.transport.socket.SocketClientInvoker.getPooledConnection(SocketClientInvoker.java:223)
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1060)
| - locked java.util.LinkedList@2c1b1c
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:757)
| org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:423)
| org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:175)
| org.jboss.remoting.transport.bisocket.BisocketClientInvoker.getSecondaryLocator(BisocketClientInvoker.java:567)
| org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:331)
| org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:412)
| org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:175)
| org.jboss.remoting.Client.invoke(Client.java:1683)
| org.jboss.remoting.Client.addCallbackListener(Client.java:1749)
| org.jboss.remoting.Client.addListener(Client.java:977)
| org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
| org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:375)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.establishCallback(ClientClusteredConnectionFactoryDelegate.java:99)
| - locked org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate@ed9f47
| org.jboss.jms.client.remoting.ConnectionFactoryCallbackHandler$CallbackConnectionListener.handleConnectionException(ConnectionFactoryCallbackHandler.java:105)
| org.jboss.remoting.ConnectionValidator$1.run(ConnectionValidator.java:608)
|
Name: Thread-5
| State: BLOCKED on java.util.LinkedList@2c1b1c owned by: Thread-29
| Total blocked: 1 Total waited: 0
|
| Stack trace:
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1058)
| org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:757)
| org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:423)
| org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:175)
| org.jboss.remoting.Client.invoke(Client.java:1683)
| org.jboss.remoting.Client.invoke(Client.java:607)
| org.jboss.remoting.Client.removeListener(Client.java:1129)
| org.jboss.jms.client.remoting.JMSRemotingConnection.stop(JMSRemotingConnection.java:389)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.closeCallback(ClientClusteredConnectionFactoryDelegate.java:178)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.finalize(ClientClusteredConnectionFactoryDelegate.java:158)
| org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$FinalizerShutdownHook.run(ClientClusteredConnectionFactoryDelegate.java:418)
|
Is it a bug in the JBoss Remoting, some where I am doing wrong I have already set jnp.sotimeout value to 60000 during connection creation at client end.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254812#4254812
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254812
15 years, 4 months
[Installation, Configuration & Deployment] - Error deploying JBoss-EL
by jinpsu
I'm trying to deploy jboss-el-2.0.1.GA.jar within my webapp. It works fine if I put the jar in $JBOSS_HOME/server/default/lib/. However, if I try to put the jar in my webapp ear, I can't instantiate ExpressionFactoryImpl:
| java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.el.ExpressionFactoryImpl
| at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
| ...
|
I'm using JBoss 4.2.2.GA and my ear is structured like this:
| myapp.ear
| |-- lib
| | `-- (various hibernate jars to override the defaults)
| |-- META-INF
| | |-- application.xml
| | |-- my-login-config.xml
| | `-- jboss-app.xml (configures loader-repository)
| |-- my-service.xml
| `-- mywebapp.war
| |-- (webapp dirs)
| `-- WEB-INF
| |-- classes
| | `-- (bean classes)
| |-- lib
| | `-- (richfaces, facelets jars)
| |-- faces-config.xml
| |-- web.xml
| `-- facelets-taglib.xml
|
I've tried putting the jboss-el jar in the top-level lib dir and WEB-INF/lib, both to no avail. Why is it not in the classpath?
Thanks.
justin
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254809#4254809
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254809
15 years, 4 months