Re: [jboss-user] [jBPM] - Fork and join , bug ?
by HuiSheng Xu
HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion
"Fork and join , bug ?"
To view the discussion, visit: http://community.jboss.org/message/554895#554895
--------------------------------------------------------------
Hi Hamel,
By default, JoinActivity used its incomming transitions to decide when execution need to continue.
So for the 'join5', you shouldn't add a join under decision, because there were two incomming transitions in join5, join5 will wait for two executions arrived it and let execution continue to next step. but decision won't create any child execution, so there will be always one execution arrived on join5, but join5 didn't know that, it will go on waiting for the second execution, then the whole process instance was blocked.
Please notice that, you should use join only after a fork activity.
The join1 is another situation. As mentioned before, join used its incomming transitions to decide when to continue. There are four incomming transitions on join1, but then only three child execution being created by fork on the runtime, so we have to set multiplicity=3 on join1, so join1 could know if there are 3 child execution arrived , then the execution should continue to next step.
Cheers.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554895#554895]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
[jBPM] - in jbpm 4.3, timer's event listener throws exception on ExecuteEventListener.java:68.
by Tun Mang
Tun Mang [http://community.jboss.org/people/tunmang] created the discussion
"in jbpm 4.3, timer's event listener throws exception on ExecuteEventListener.java:68."
To view the discussion, visit: http://community.jboss.org/message/554894#554894
--------------------------------------------------------------
Hi there,
Follow the example described in "jbpm-4.3/doc/devguide/html_single/index.html#timer", the following is what we have done:
(1) in the event listener, we call executeJob:
public void notify(EventListenerExecution execution)
{
String aId = execution.getId();
String aName = execution.getName();
out("===============================");
out("timer handler: (timeout) event (" + aId + ").");
out("===============================");
ProcessInstance processInstance = (ProcessInstance) execution.getProcessInstance();
ManagementService managementService = EnvironmentImpl.getFromCurrent(ManagementService.class);
JobQuery jobQuery = managementService.createJobQuery();
JobQuery timerQuery = jobQuery.timers();
JobQuery ptQuery = timerQuery.processInstanceId( processInstance.getId() );
List<Job> jobList = ptQuery.list();
Job foundJob = null;
for(int ii=0 ; ii < jobList.size(); ii++)
{
Job jbpmJob = jobList.get(ii);
Execution jobExcu = jbpmJob.getExecution();
String bId = jobExcu.getId();
String bName = jobExcu.getName();
if( ! bId.equals(aId) || ! bName.equals(aName) )
continue;
foundJob = jbpmJob;
break;
}
if( foundJob == null )
{
err("cannot find a matched timer object in external db: (execId: " + aId + "), (name: " + aName + ").");
return;
}
out("found a matched timer object in external db: (execId: " + aId + "), (name: " + aName + "), (timerId: " + foundJob.getId() + ").");
managementService.executeJob( foundJob.getId() );
}
(2) in the process definition, we linked it with the timer:
<state g="222,123,147,40" name="generate-file">
<on event="timeout">
<timer duedate="10 seconds"/>
<event-listener class="basicfive.TestTimerHandler">
<field name="msg"><string value="entered the (generate-file) state node."/></field>
</event-listener>
</on>
<on event="start">
<event-listener class="basicfive.TestJobMakeRequestHandler">
<field name="msg"><string value="entered the (generate-file) state node."/></field>
</event-listener>
</on>
<transition g="-71,-15" name="timeout" to="remove-file">
</transition>
</state>
(3) When start the process instance, and after it reaches the handler, it always throws the following exeptions:
10-07-28/17:01:17 DEBUG [basicfive.TestTimerHandler]: (AP) ===============================
10-07-28/17:01:17 DEBUG [basicfive.TestTimerHandler]: (AP) timer handler: (timeout) event (test_Timer_1.680001.generate-file).
10-07-28/17:01:17 DEBUG [basicfive.TestTimerHandler]: (AP) ===============================
10-07-28/17:01:17 DEBUG [basicfive.TestTimerHandler]: (AP) found a matched timer object in external db: (execId: test_Timer_1.680001.generate-file), (name: generate-file), (timerId: 680004).
10-07-28/17:01:17 DEBUG [basicfive.TestTimerHandler]: (AP) leaving event fired for timer object in external db: (id: test_Timer_1.680001.generate-file), (name: generate-file).
### EXCEPTION ###########################################
17:01:17,161 SEV | [ExecuteJobCmd] exception while executing 'timer[680004|2010-07-28 17:01:15,000|timeout]'
java.lang.NullPointerException
at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:68)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:678)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:638)
at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:585)
at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:575)
......
How do we resolve this problem ? Thanks a lot for your help in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554894#554894]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
[JBoss Messaging] - getting "Message to JBossTopic ... not processed"
by ranjix
ranjix [http://community.jboss.org/people/ranjix] created the discussion
"getting "Message to JBossTopic ... not processed""
To view the discussion, visit: http://community.jboss.org/message/554885#554885
--------------------------------------------------------------
Hey guys, sorry for the bother.
I use JBoss Community Edition 5.1.0GA, and I do have an issue with MDBs. Basically they seem to work intermittently. I do have a client which posts a message into a topic, and a subscriber which uses an MDB to pick up the respective message from the topic and use it. Fairly straightforward. The issue is that it doesn't work *every time*, from my tests it looks like once every three times it fails (messages don't make it to the subscriber). When it fails, it shows in the system.out a message like "+14:41:58,469 INFO [STDOUT] Warning: Message to JBossTopic[com.bluemartini.DBUtilTopic] not processed: delegator->JBossMessage[5243929060474880]:NON-PERSISTENT, deliveryId=0+".
the questions:
1. any idea what's going on, why it doesn't work every time? Looks like some timing issues, but no clue how to resolve. Making the subscription durable didn't help.
2. how can I get the sources to whichever class is printing out the "Message to JBossTopic"? I downloaded sources, looked through them, couldn't figure out. It seems that the part with "delegator->JBossMessage" comes from a org.jboss.jms.message.MessageProxy toString method, but can't find where is the other part coming from (the one with Message to JBossTopic). The fact that's the second issue for which I can't find the sources starts bothering me. I'll look into how to download ALL the sources (using subversion or something).
Thanks for any idea,
ranjix
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554885#554885]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
[JBoss Tools Development] - Remote Debugging for Eclipse Test Plug-in Running by Tycho
by Denis Golovin
Denis Golovin [http://community.jboss.org/people/dgolovin] modified the document:
"Remote Debugging for Eclipse Test Plug-in Running by Tycho"
To view the document, visit: http://community.jboss.org/docs/DOC-15209
--------------------------------------------------------------
When I report issue in bug tracking system about nightly build's JUnit test error I usually get simple answer that it is supposed to be working because it is working on developer's workstation. After that routine conversation starts and it turns out that tests were running from development environment under Eclipse. Here I usually have to explain again and again that's not the same running tests from development environment and in build.
The right way to make yourself sure your tests will work in most cases without errors in nightly build is to start tests the same way as nightly build does. It was not easy for JBoss Tools tests until we created experimental branch and switched to Maven Tycho project. That means it is fairly easy to run tests now. Basically you need to change current directory and execute maven install goal. If it runs in development environment and in maven your tests are good and in most cases it should be fine in nightly build. Problems begin if it runs in development environment but it doesn't in maven. In this scenario you need to debug tests running in Tycho somehow and fix it. Fortunately it can be done using Java remote debugging support.
First of all you need to be sure you have built your sources you're going to debug and there is no differences between .java and .class files. If you're going find problem from previous build just get right tagged version and build it before debugging session.
There are two options to use remote debugger
1. Simple use of -DdebugPort=8001 or what ever port you would like to use
2. Add full argLine for remote debugging configuration im pom.xml
h1. Use of debugPort system properties
To use this just add -DdebugPort=<portNumber> to your maven command line replacing <portNumber> for desired port and make sure you have the same port configured in your Remote Java Application configuration in Eclipse Debug Configuration dialog as it explained for second option below.
h1. Use full argLine for remote debugging configuration in pom.xml
Open pom.xml for your Eclipse Test Plug-in and add Java VM arguments like it shown below (actual port numbers, server names and other parameters may be different, it depends from your environment)
<build>
<plugins>
<plugin>
<groupid>org.sonatype.tycho</groupid>
<artifactid>maven-osgi-test-plugin</artifactid>
<version>${tycho-version}</version>
<configuration>
<argline>-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y</argline>
</configuration>
</plugin>
</plugins>
</build>
This snipped configured for remote debugging in OpenJDK 6, if your is different you might need to read #r1 [1] and configure it right for your JVM version.
Configure java projects with sources you're going to debug in Eclipse and create Remote Java Application configuration in Eclipse Debug Configuration dialog. Fill 'host' and 'port' fields with the same values from pom.xml argLine element. Press Apply button to save your changes and start your test plug-in from terminal like
$mvn install
It will go through build process and finally you ll see something like
[INFO] Expected eclipse log file: /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/work/data/.metadata/.log
[INFO] Command line:
/bin/sh -c cd /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test && /usr/lib/jvm/java-6-openjdk/jre/bin/java -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86 -agentlib:jdwp=transport=dt_socket,address=8001,server=y,suspend=y -jar /home/eskimo/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.0.201.R35x_v20090715/org.eclipse.equinox.launcher-1.0.201.R35x_v20090715.jar -data /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/work/data -dev file:/home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/dev.properties -install /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/work -configuration /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/work/configuration -application org.codehaus.tycho.surefire.osgibooter.uitest -testproperties /home/eskimo/Projects/jbt-modular/jst/tests/org.jboss.tools.jst.web.kb.test/target/surefire.properties
Listening for transport dt_socket at address: 8001
At this point build is waiting for you to attach remote debugger to the process because of using
suspend=y
in argLine element of your pom.xml file. So you need to return to eclipse and hit 'Debug' button in dialog opened before.
Build will continue at this point and stop on your break points so you can find out what is wrong with tests during nightly build.
[1] http://java.sun.com/javase/technologies/core/toolsapis/jpda/#Invocation Java Platform Debugger Architecture - http://java.sun.com/javase/technologies/core/toolsapis/jpda/#Invocation
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15209]
Create a new document in JBoss Tools Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 5 months
[Datasource Configuration] - Datasource security
by Khurram Chaudhry
Khurram Chaudhry [http://community.jboss.org/people/kilyas] created the discussion
"Datasource security"
To view the discussion, visit: http://community.jboss.org/message/554875#554875
--------------------------------------------------------------
Like any normal application running on JBoss I am using JBoss managemed datasources in the applications running on the app server for DB interaction. It has been working fine till now when we came across a new requirement. The new requirement is such that not all the users should have the permissions to update the data, e.g
A user John logs into an application running on JBoss and requests some information from the database. Now once the data is returned to him not only does he have the permissions to view it but he could also delete/update the information. While when another person Bob might just view the information. So apparently I would to ensure that the connections established with the database in these cases should be as themselves and these users' permissions should be defined in the database while creating these users. Apparently in such a case we might be bypassing the connection pool(please correct me if I am wrong). Also is there a way to define such a connection in the datasource xml file where the username/password information is left to the application level?
Secondly we have generic accounts defined in the datasource file. These accounts have read/write priviliges to the DB. e.g boatrade/password has beed defined in the ds file as follows:-
*<local-tx-datasource>
<jndi-name>TradeTestOracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@trmpd_pkg.bankers.com:1521:trmpd</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<max-pool-size>100</max-pool-size>
<user-name>boatrade</user-name>
<password>test</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>*
Since this datasource is defined in the ds file is there a way in JBoss to ensure that this ds is only used for select statements and no updates/deletes are performed using this ds? Or that only these set of applications can use this datasource and nobody else has access to this DS?
Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554875#554875]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
Re: [jboss-user] [jBPM] - jBPM 4.4 How do I force a process instance to end
by Kevin Moodley
Kevin Moodley [http://community.jboss.org/people/kevinmoodley] replied to the discussion
"jBPM 4.4 How do I force a process instance to end"
To view the discussion, visit: http://community.jboss.org/message/554871#554871
--------------------------------------------------------------
By the way I tried using
processEngine.getExecutionService().endProcessInstance(instanceId, ProcessInstance.STATE_ENDED);
but this threw a null-pointer exception:
DefaultCommandService - exception while executing command org.jbpm.pvm.internal.cmd.EndProcessInstance@6649
java.lang.NullPointerException
at org.jbpm.pvm.internal.util.ReflectUtil.installDeploymentClassLoader(ReflectUtil.java:385)
at org.jbpm.pvm.internal.util.ReflectUtil.instantiateUserCode(ReflectUtil.java:412)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:63)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:47)
at org.jbpm.pvm.internal.wire.usercode.UserCodeEventListener.notify(UserCodeEventListener.java:38)
at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:81)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632)
at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:579)
at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:568)
at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:386)
at org.jbpm.pvm.internal.cmd.EndProcessInstance.execute(EndProcessInstance.java:48)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:40)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.endProcessInstance(ExecutionServiceImpl.java:117)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554871#554871]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
Re: [jboss-user] [JBoss Web Services] - Abstract class as input Parameter in WebService
by alex soto
alex soto [http://community.jboss.org/people/lexsoto%40gmail.com] replied to the discussion
"Abstract class as input Parameter in WebService"
To view the discussion, visit: http://community.jboss.org/message/554866#554866
--------------------------------------------------------------
In case it helps somebody else, here is how I managed to get the JBoss web service client to work.
With Java 6, need to run the client with the JVM option:
-Djava.endorsed.dirs=${JBOSS_HOME}/lib/endorsed
The maven dependencies I used are:
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>5.1.0.GA</version>
<type>pom</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>jaxb-api</artifactId>
<groupId>sun-jaxb</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.14.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-spi</artifactId>
<version>1.1.2.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-jaxws</artifactId>
<version>3.1.2.GA</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jboss-client</artifactId>
<version>5.1.0.CR1</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.9.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jbossall-client</artifactId>
<version>5.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<version>2.0.1.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-common</artifactId>
<version>1.1.0.SP1</version>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
<version>3.1.2.GA</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-core</artifactId>
<version>3.1.2.GA</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-jaxrpc</artifactId>
<version>3.1.2.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-jaxws-ext</artifactId>
<version>3.1.2.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-saaj</artifactId>
<version>3.1.2.GA</version>
</dependency>
<dependency>
<groupId>com.sun.xml.fastinfoset</groupId>
<artifactId>FastInfoset</artifactId>
<version>1.2.2</version>
</dependency>
These dependencies may include more than what is actually needed, but I spent a lot of time adding one by one until it worked, so I have no energy left to clean up redundant or superfluous dependencies :)
Again, this worked for JBoss 5.1.0.GA and Java 6.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554866#554866]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months