[jBPM Users] - Unit test succeeds but process does not properly run when de
by sebastian.s
Good morning folks!
Sorry but it's me pestering the forum with my questions again. ;) I tried to implement a kind of 4-eyes-approval where the decisions of the 2 people can be made concurrently. I had trouble with this process because when I tried to start a new instance in the jbpm-console I did not see a new instance. Furthermore when I tried to view the 2 users' tasklists to check if the tasks had been created I got an exception:
| org.jboss.resteasy.spi.UnhandledException: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
|
I thought this was a bug already reported but I don't manage to find the matching posts and the matching issue in JIRA anymore. I was sure there was a thing partly related to the engine and partly related to the console. At first I thought it was just an issue with the console because I made a unit test for the process and it passed. Afterwards I was using the API of the Process Engine instance used by the console to go through the process without using the console and it did not work. Buit when the unit test passes it should run on the server as well (in my case Tomcat), or not?
Process definition and unit test follow. I am using jBPM 4.1 running on Tomcat on a Windows Server System.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="parallel" xmlns="http://jbpm.org/4.0/jpdl" key="parallel" version="3">
| <start g="27,23,48,48" name="start1">
| <transition g="-49,-21" name="to fork1" to="fork1"/>
| </start>
| <end ends="process-instance" g="252,226,48,48" name="end1"/>
| <fork g="173,22,48,48" name="fork1">
| <transition g="-50,-21" name="to task1" to="task1"/>
| <transition g="8,-21" name="to task2" to="task2"/>
| </fork>
| <task assignee="mike" g="76,121,92,52" name="task1">
| <transition g="-35,-41" name="no" to="end1"/>
| <transition g="-39,-11" name="yes" to="join1"/>
| </task>
| <task assignee="peter" g="228,122,92,52" name="task2">
| <transition g="13,-16" name="no" to="end1"/>
| <transition g="-26,30" name="yes" to="join1"/>
| </task>
| <state g="82,314,92,52" name="approved">
| <transition g="-48,-21" name="to end1" to="end1">
| <timer duedate="3 minutes"/>
| </transition>
| </state>
| <join name="join1" g="102,225,48,48">
| <transition g="-73,-21" name="to approved" to="approved"/>
| </join>
| </process>
|
| import java.util.Iterator;
| import java.util.List;
| import java.util.Set;
|
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.job.Job;
| import org.jbpm.api.task.Task;
| import org.jbpm.test.JbpmTestCase;
|
|
| public class MeinTestfall extends JbpmTestCase {
|
| String deploymentId;
|
| protected void setUp() throws Exception {
| super.setUp();
|
| deploymentId = repositoryService.createDeployment()
| .addResourceFromClasspath("parallel.jpdl.xml")
| .deploy();
| }
|
| protected void tearDown() throws Exception {
| repositoryService.deleteDeploymentCascade(deploymentId);
|
| super.tearDown();
| }
|
| public void testProcess() {
|
| ProcessInstance processInstance = executionService.startProcessInstanceById("parallel-2");
|
| List<Task> tasksMike = taskService.findPersonalTasks("mike");
| List<Task> tasksPeter = taskService.findPersonalTasks("peter");
|
| if(tasksMike.size() == 0) {
| fail();
| }
|
| if(tasksPeter.size() == 0) {
| fail();
| }
|
| Set<String> activities = processInstance.findActiveActivityNames();
|
| Iterator<String> iterator = activities.iterator();
|
| while(iterator.hasNext()) {
| System.out.println(iterator.next());
| }
|
| taskService.completeTask(tasksMike.get(0).getId(), "yes");
| taskService.completeTask(tasksPeter.get(0).getId(), "yes");
|
| processInstance = executionService.findProcessInstanceById(processInstance.getId());
|
| activities = processInstance.findActiveActivityNames();
| iterator = activities.iterator();
|
| while(iterator.hasNext()) {
| System.out.println(iterator.next());
| }
|
| assertTrue(processInstance.isActive("approved"));
|
| // executing the job which would normally be executed by the JobExecutor
| Job job = managementService.createJobQuery()
| .timers()
| .processInstanceId(processInstance.getId())
| .uniqueResult();
|
| managementService.executeJob(job.getId());
|
| // process instance should be finished right now
| assertNull(executionService.findProcessInstanceById(processInstance.getId()));
|
| }
|
| }
|
|
Hints??
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258805#4258805
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258805
15 years, 3 months
[jBPM Users] - Re: Please help me to install jbpm with mysql
by prachi.mukhija
Hi,
I am facing the same error. Here's my trace:
| 12:52:52,757 INFO [Server] Starting JBoss (MX MicroKernel)...
| 12:52:52,757 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
| 12:52:52,758 INFO [Server] Home Dir: /home/prachi/Download/jboss/jboss-4.2.3.GA
| 12:52:52,758 INFO [Server] Home URL: file:/home/prachi/Download/jboss/jboss-4.2.3.GA/
| 12:52:52,759 INFO [Server] Patch URL: null
| 12:52:52,759 INFO [Server] Server Name: default
| 12:52:52,759 INFO [Server] Server Home Dir: /home/prachi/Download/jboss/jboss-4.2.3.GA/server/default
| 12:52:52,759 INFO [Server] Server Home URL: file:/home/prachi/Download/jboss/jboss-4.2.3.GA/server/default/
| 12:52:52,759 INFO [Server] Server Log Dir: /home/prachi/Download/jboss/jboss-4.2.3.GA/server/default/log
| 12:52:52,759 INFO [Server] Server Temp Dir: /home/prachi/Download/jboss/jboss-4.2.3.GA/server/default/tmp
| 12:52:52,760 INFO [Server] Root Deployment Filename: jboss-service.xml
| 12:52:52,987 INFO [ServerInfo] Java version: 1.6.0_11,Sun Microsystems Inc.
| 12:52:52,987 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 11.0-b16,Sun Microsystems Inc.
| 12:52:52,987 INFO [ServerInfo] OS-System: Linux 2.6.27.9-73.fc9.i686,i386
| 12:52:53,260 INFO [Server] Core system initialized
| 12:52:54,861 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
| 12:52:54,862 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
| 12:52:55,181 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
| 12:52:55,181 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
| 12:52:55,333 INFO [TransactionManagerService] Starting recovery manager
| 12:52:55,400 INFO [TransactionManagerService] Recovery manager started
| 12:52:55,400 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
| 12:52:57,313 INFO [EJB3Deployer] Starting java:comp multiplexer
| 12:52:58,942 INFO [NativeServerConfig] JBoss Web Services - Native
| 12:52:58,942 INFO [NativeServerConfig] jbossws-3.0.1-native-2.0.4.GA (build=200803312044)
| 12:52:59,784 INFO [Embedded] Catalina naming disabled
| 12:52:59,907 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/java/lib/i386/server:/usr/java/java/lib/i386:/usr/java/java/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
| 12:52:59,955 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
| 12:52:59,955 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 12:52:59,955 INFO [Catalina] Initialization processed in 170 ms
| 12:52:59,955 INFO [StandardService] Starting service jboss.web
| 12:52:59,957 INFO [StandardEngine] Starting Servlet Engine: JBossWeb/2.0.1.GA
| 12:52:59,993 INFO [Catalina] Server startup in 37 ms
| 12:53:00,080 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
| 12:53:00,565 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
| 12:53:00,745 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../deploy/jbossws.sar/jbossws-context.war/
| 12:53:00,869 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
| 12:53:01,507 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
| 12:53:01,989 INFO [MailService] Mail Service bound to java:/Mail
| 12:53:02,079 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
| 12:53:02,111 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
| 12:53:02,139 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
| 12:53:02,193 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
| 12:53:02,322 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
| 12:53:02,352 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
| 12:53:02,411 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
| 12:53:02,419 INFO [QuartzResourceAdapter] start quartz!!!
| 12:53:02,464 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
| 12:53:02,483 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
| 12:53:02,485 INFO [RAMJobStore] RAMJobStore initialized.
| 12:53:02,485 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
| 12:53:02,485 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
| 12:53:02,485 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
| 12:53:02,923 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
| 12:53:03,115 INFO [JbpmJobQueue] Bound to JNDI name: queue/JbpmJobQueue
| 12:53:03,149 INFO [JbpmCommandQueue] Bound to JNDI name: queue/JbpmCommandQueue
| 12:53:03,157 INFO [A] Bound to JNDI name: queue/A
| 12:53:03,158 INFO [B] Bound to JNDI name: queue/B
| 12:53:03,160 INFO [C] Bound to JNDI name: queue/C
| 12:53:03,161 INFO [D] Bound to JNDI name: queue/D
| 12:53:03,162 INFO [ex] Bound to JNDI name: queue/ex
| 12:53:03,178 INFO [testTopic] Bound to JNDI name: topic/testTopic
| 12:53:03,179 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
| 12:53:03,180 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
| 12:53:03,183 INFO [testQueue] Bound to JNDI name: queue/testQueue
| 12:53:03,234 INFO [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
| 12:53:03,263 INFO [DLQ] Bound to JNDI name: queue/DLQ
| 12:53:03,322 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=JbpmDS' to JNDI name 'java:JbpmDS'
| 12:53:03,450 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
| 12:53:03,792 INFO [EjbModule] Deploying TimerEntityBean
| 12:53:03,882 INFO [EjbModule] Deploying CommandServiceBean
| 12:53:03,892 INFO [EjbModule] Deploying CommandListenerBean
| 12:53:03,906 INFO [EjbModule] Deploying JobListenerBean
| 12:53:04,851 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'TimerEntityBean' to jndi 'java:jbpm/TimerEntityBean'
| 12:53:04,861 INFO [ProxyFactory] Bound EJB Home 'TimerEntityBean' to jndi 'jbpm/TimerEntityBean'
| 12:53:04,868 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'CommandServiceBean' to jndi 'java:jbpm/CommandServiceBean'
| 12:53:04,873 INFO [ProxyFactory] Bound EJB Home 'CommandServiceBean' to jndi 'jbpm/CommandServiceBean'
| 12:53:04,966 INFO [EJBDeployer] Deployed: file:/home/prachi/Download/jboss/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise.jar/
| 12:53:05,002 INFO [TomcatDeployer] deploy, ctxPath=/jbpm-console, warUrl=.../deploy/jbpm/jsf-console.war/
| 12:53:05,005 WARN [TomcatDeployer] message-destination-ref 'jms/JobQueue' ignoring message-destination-link 'JobQueue' because it has a jndi-name in jboss-web.xml
| 12:53:05,605 INFO [JbpmConfiguration] using configuration resource: jbpm.cfg.xml
| 12:53:05,641 INFO [StaleObjectLogConfigurer] stale object exceptions will be hidden from logging
| 12:53:05,672 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 12:53:05,754 INFO [TomcatDeployer] deploy, ctxPath=/jspLearning, warUrl=.../tmp/deploy/tmp4766398020094246831jspLearning-exp.war/
| 12:53:05,900 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 12:53:05,937 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 12:53:05,967 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 13s:206ms
|
I have done all the relevant configuration, however, I am not able to login to the console.
Please help.
Thanks !
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258793#4258793
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258793
15 years, 3 months