Hi everybody!
I'm using jBPM 5.3.0.Final, Drools 5.4.0.Final and JBoss 7.1.1.
I'm trying to run jbpm with human task service.
When I start processes without human tasks everything works fine. But when I
try to run process with human task I get the following exception (see full
error log in attachments):
Caused by: java.lang.NullPointerException
at
org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
[drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]
at
org.jbpm.task.service.persistence.TaskJTATransactionManager.getStatus(TaskJTATransactionManager.java:63)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.persistence.TaskJTATransactionManager.begin(TaskJTATransactionManager.java:36)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:976)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
... 28 more
I init HumanTaskService and jBPM in following way:
Environment JBPM_ENVIRONMENT = KnowledgeBaseFactory.newEnvironment();
JBPM_ENVIRONMENT.set(EnvironmentName.ENTITY_MANAGER_FACTORY,
Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa"));
JBPM_ENVIRONMENT.set(EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager());
JBPM_ENVIRONMENT.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory",
"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory",
"org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration JBPM_CONFIG =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener());
MinaTaskServer taskServer = new MinaTaskServer(taskService);
// start the server
Thread thread = new Thread(taskServer);
thread.start();
TaskClient taskClient = new TaskClient(new
MinaTaskClientConnector("myHtsClient",
new
MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
if (!taskClient.connect(TASK_CLIENT_SERVER_ADDRESS,
TASK_CLIENT_SERVER_PORT)) {
logger.error("Could not connect task client");
}
StatefulKnowledgeSession session =
JPAKnowledgeService.newStatefulKnowledgeSession(readKnowledgeBase(),
JBPM_CONFIG, JBPM_ENVIRONMENT);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new
MinaHTWorkItemHandler(session));
I had an experiment: before a process start and after it I looked up the
UserTransaction:
try {
logger.info("found: " + new
InitialContext().lookup("java:comp/UserTransaction"));
} catch (NamingException e) {
logger.info("not found", e);
}
// start process code
try {
logger.info("found: " + new
InitialContext().lookup("java:comp/UserTransaction"));
} catch (NamingException ex) {
logger.info("not found", ex);
}
The name java:comp/UserTransaction I took from
org.drools.persistence.jta.JtaTransactionManager which falls with NPE.
It still falls and in my log:
found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5
com.example.my.jbpm.rest.ProcessManagementResources http--127.0.0.1-8080-2
No UserTransaction found at JNDI location [java:comp/UserTransaction]
org.drools.persistence.jta.JtaTransactionManager NioProcessor-2
found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5
com.example.my.jbpm.rest.ProcessManagementResources http--127.0.0.1-8080-2
--
View this message in context:
http://drools.46999.n3.nabble.com/JtaTransactionManager-couldn-t-find-Use...
Sent from the Drools: User forum mailing list archive at
Nabble.com.