[jBPM] - strange error in human tasks
by Luis Victor
Luis Victor [https://community.jboss.org/people/keymaker19] created the discussion
"strange error in human tasks"
To view the discussion, visit: https://community.jboss.org/message/763067#763067
--------------------------------------------------------------
hi everybody i'm doing a process as study case with two human tasks. When i reclaim the human task associated to a group i get the following error before load the human task form
it happens with the human task example of jbpm 5.3.0 final examples too with the sales-rep user:
012-10-03 15:04:19,409 [DEBUG] parse {"id":3, "processInstanceId":"21", "processId":"com.sample.humantask", "name":"Request Review", "assignee":"sales-rep", "isBlocking":false, "isSignalling":false, "outcomes":[], "currentState":"ASSIGNED", "participantUsers":[], "participantGroups":[], "url":" http://localhost:8080/gwt-console-server/rs/form/task/3/render http://localhost:8080/gwt-console-server/rs/form/task/3/render", "priority":0}
2012-10-03 15:04:19,420 [FATAL] Uncaught Exception:
com.google.gwt.core.client.JavaScriptException:
(TypeError): this$static is undefined
fileName: http://localhost:8080/jbpm-console/app/A648065FD2C101A07524EF32DE4F4440.c... http://localhost:8080/jbpm-console/app/A648065FD2C101A07524EF32DE4F4440.c...
lineNumber: 13092
at Unknown.$fillInStackTrace(StackTraceCreator.java:147)
at Unknown.fillInStackTrace(StackTraceCreator.java:387)
at Unknown.JavaScriptException_0(Throwable.java:46)
at Unknown.caught_0(Exceptions.java:29)
at Unknown.$update_8(AssignedTasksView.java:361)
at Unknown.handleSuccessfulResponse_15(LoadTasksAction.java:77)
at Unknown.onResponseReceived_5(AbstractRESTAction.java:78)
at Unknown.$fireOnResponseReceived(Request.java:287)
at Unknown.onReadyStateChange_0(RequestBuilder.java:395)
at Unknown.anonymous(XMLHttpRequest.java:287)
at Unknown.entry0(Impl.java:214)
at Unknown.anonymous(Impl.java:57)
Any help would be appreciated. Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/763067#763067]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Load users and groups to Human task service
by Grigory Kalabin
Grigory Kalabin [https://community.jboss.org/people/gkalabin] created the discussion
"Load users and groups to Human task service"
To view the discussion, visit: https://community.jboss.org/message/762488#762488
--------------------------------------------------------------
Hi everybody!
I'm using jBPM 5.3.0.Final (except jbpm-human-task which version is 5.3.0.CR1, because something is wrong with my pom.xml or maven repo) and JBoss 7.1.1.
On application startup I'm loading users and groups data to Human Task Service. Here is the code:
private static void startHumanTaskService() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
// init users and groups
TaskServiceSession taskServiceSession = taskService.createSession();
for (String username : UsersUtils.getUsers()) {
taskServiceSession.addUser(new User(username));
}
for (String group : UsersUtils.getGroups()) {
// guest group already registered? Really?
if (!group.equals("guest")) {
taskServiceSession.addGroup(new Group(group));
}
}
MinaTaskServer taskServer = new MinaTaskServer(taskService);
// bind to JNDI
try {
new InitialContext().bind(TASK_SERVER_JNDI_NAME, taskServer);
logger.info("save " + taskServer + " to " + TASK_SERVER_JNDI_NAME);
} catch (NamingException exception) {
logger.error("unable to bind task server", exception);
}
// start the server
Thread thread = new Thread(taskServer);
thread.start();
}
But If I try load "guest" group I have the following exception
15:47:38,944 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/my-jbpm]] (MSC service thread 1-2) Exception sending context
initialized event to listener instance of class com.example.my.jbpm.MyJbpmServletContextListener: java.lang.RuntimeException: Operation failed
at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:902) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
at org.jbpm.task.service.TaskServiceSession.persistInTransaction(TaskServiceSession.java:868) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
at org.jbpm.task.service.TaskServiceSession.addGroup(TaskServiceSession.java:101) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
at com.example.my.jbpm.utils.jbpm.JbpmApiUtils.startHumanTaskService(JbpmApiUtils.java:149) [classes:]
at com.example.my.jbpm.utils.jbpm.JbpmApiUtils.initEngine(JbpmApiUtils.java:244) [classes:]
at com.example.my.jbpm.MyJbpmServletContextListener.contextInitialized(MyJbpmServletContextListener.java:19) [classes:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]
Caused by: javax.persistence.EntityExistsException: a different object with the same identifier value was already associated with the session:
[org.jbpm.task.Group#guest]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1359) [hibernate-entitymanager-3.6.9.Final.jar:3.6.9.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1315) [hibernate-entitymanager-3.6.9.Final.jar:3.6.9.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1321) [hibernate-entitymanager-3.6.9.Final.jar:3.6.9.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:843) [hibernate-entitymanager-3.6.9.Final.jar:3.6.9.Final]
at org.jbpm.task.service.persistence.TaskPersistenceManager.saveEntity(TaskPersistenceManager.java:200) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
at org.jbpm.task.service.TaskServiceSession$14.doOperation(TaskServiceSession.java:870) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:890) [jbpm-human-task-5.3.0.CR1.jar:5.3.0.CR1]
... 13 more
Is that true that "guest" group already registered in jBPM? How can I check is currently inserting group persisted or not?
Thank you for any help. Have a good day!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/762488#762488]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - JBPM 5.2 Console application taking long time (more than 20 min) to load the process definitions and process instances
by srikant vege
srikant vege [https://community.jboss.org/people/srikanthvege1] created the discussion
"JBPM 5.2 Console application taking long time (more than 20 min) to load the process definitions and process instances"
To view the discussion, visit: https://community.jboss.org/message/762914#762914
--------------------------------------------------------------
Hi,
I am using JBPM 5.2 with Tomcat 6 and MySql database. I have deployed the below artifacts in one tomcat server.
guvnor
designer
gwt-console
gwt-console-server
and started the human task server locally. I have read the process from guvnor and started that process from my code.
When I open the console application and click the "process overview" link, I am getting TimeOut error after 1min. If I copy the same rest url "http://<ip>:8080/gwt-console-server/rs/process/definitions" and paste it in the browser, I am geting the process definitions json after long time (taking more than 20 min). After that If I click my process definition to see the process instances for that process, it is also again taking 20 min to display the process instances list in the browser. And again if I execute the rest url for "process Diagram" to see the process state, it is also taking more than 20 min time to display in the browser. It seems like all the process related actions are taking long time.
This is happening only on first time. From second time onwards, I am getting within no time.
Please help me on where could be the problem. I am using JPA stuff with BitronexTransactionManager. Also let me know wether I can increase the timeout value in console app or not.
Thanks
Srikant.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/762914#762914]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Re: Human Task Service transactions fail
by Grigory Kalabin
Grigory Kalabin [https://community.jboss.org/people/gkalabin] created the discussion
"Re: Human Task Service transactions fail"
To view the discussion, visit: https://community.jboss.org/message/762872#762872
--------------------------------------------------------------
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:
| 30974 | Thu Jan 01 12:39:35 MSK 1970 | INFO | found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5 | com.example.my.jbpm.rest.ProcessManagementResources | http--127.0.0.1-8080-2 |
| Note [note=] |
| 31052 | Thu Jan 01 12:39:36 MSK 1970 | FINE | No UserTransaction found at JNDI location [java:comp/UserTransaction] | org.drools.persistence.jta.JtaTransactionManager | NioProcessor-2 |
| Note [note=] |
| 31159 | Thu Jan 01 12:39:37 MSK 1970 | INFO | found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5 | com.example.my.jbpm.rest.ProcessManagementResources | http--127.0.0.1-8080-2 |
| Note [note=] |
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/762872#762872]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Work Item not persisted
by Swaminathan Bhaskar
Swaminathan Bhaskar [https://community.jboss.org/people/swaminathan.bhaskar] created the discussion
"Work Item not persisted"
To view the discussion, visit: https://community.jboss.org/message/760675#760675
--------------------------------------------------------------
Hello all;
I am using JPA persistence with jBPM 5.3 with MySQL database. I created a new domain specific task and a corresponding work item handler and expect the work item to be persisted along with the session info as well as process instance info when I kill the process at the point shown in red below ... but do not see that happening. Any ideas or thoughts
Here is the code for the work item handler
public class CustomWorkItemHandler implements WorkItemHandler {
@Override
public void executeWorkItem(WorkItem item, WorkItemManager manager) {
System.out.printf("\n-----> Waiting in custom work item %s <ID:%d> for 60 secs\n", item.getName(), item.getId());
// Expect an entry in the DB for this work item when I kill the process
// Artificial wait
try {
Thread.sleep(60000);
}
catch (Exception ex) {
}
System.out.printf("\n-----> Completing custom work item %s <ID:%d>\n", item.getName(), item.getId());
manager.completeWorkItem(item.getId(), null);
}
@Override
public void abortWorkItem(WorkItem item, WorkItemManager manager) {
}
}
Here is the main process code:
public class sample07 {
public static final String BPMN_RESOURCE = "sample07.bpmn";
public static final String BPM_PROCESS = "sample07";
public static final String WORK_ITEM_NAME = "custom_work_item";
public static final void main(String[] args) {
if (args.length != 2) {
System.out.printf("Usage: java %s <session-id> <process-id>\n", sample07.class.getName());
System.exit(1);
}
try {
int sessionId = Integer.parseInt(args[0]);
long processId = Long.parseLong(args[1]);
// Setup Datasource
PoolingDataSource mysqlDS = new PoolingDataSource();
mysqlDS.setUniqueName("jdbc/MySQL-DS");
mysqlDS.setClassName("com.mysql.jdbc.jdbc2.optional.MysqlXADataSource");
mysqlDS.setMaxPoolSize(3);
mysqlDS.setAllowLocalTransactions(true);
mysqlDS.getDriverProperties().put("user", "mydbuser");
mysqlDS.getDriverProperties().put("password", "mydbpass");
mysqlDS.getDriverProperties().put("url", "jdbc:mysql://localhost:3306/mytestdb");
mysqlDS.init();
// Setup JPA persistence
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
// Load and setup the BPM process
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource(BPMN_RESOURCE), ResourceType.BPMN2);
// Do we have any errors ?
if (kbuilder.hasErrors()) {
if (kbuilder.getErrors().size() > 0) {
for (KnowledgeBuilderError error : kbuilder.getErrors()) {
System.out.printf("Error building KnowledgeBase: %s\n", error.getMessage());
}
}
throw new RuntimeException("Error building KnowledgeBase");
}
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = null;
if (sessionId > 0) {
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);
JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
// Register the custom work item handler
ksession.getWorkItemManager().registerWorkItemHandler(WORK_ITEM_NAME, new CustomWorkItemHandler());
ProcessInstance processInstance = ksession.getProcessInstance(processId);
// Did the process instance complete successfully ?
if (processInstance.getState() == ProcessInstance.STATE_COMPLETED) {
System.out.printf("\n-----> Restarted business process [%s] successfully completed\n", processInstance.getProcessId());
}
logger.dispose();
}
else {
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
// Register the custom work item handler
ksession.getWorkItemManager().registerWorkItemHandler(WORK_ITEM_NAME, new CustomWorkItemHandler());
System.out.printf("\n-----> Session ID: %d\n", ksession.getId());
// Create the process instance
ProcessInstance processInstance = ksession.createProcessInstance(BPM_PROCESS, null);
System.out.printf("\n-----> Starting new Business process %s <ID:%d>\n", processInstance.getProcessId(), processInstance.getId());
// Start the BPM process
ksession.startProcessInstance(processInstance.getId());
// Did the process instance complete successfully ?
if (processInstance.getState() == ProcessInstance.STATE_COMPLETED) {
System.out.printf("\n-----> Business process %s <ID:%d> successfully completed\n", processInstance.getProcessId(), processInstance.getId());
}
logger.dispose();
}
}
catch (Exception ex) {
ex.printStackTrace(System.err);
System.exit(1);
}
System.exit(0);
}
}
And here is the persistence.xml:
<persistence version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/MySQL-DS</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
<mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<!-- Process Related -->
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
Any help appreciated.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/760675#760675]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JBoss Web Services] - Problem implementing ws-security service (and client) in AS7.1.1
by Dimitris Keramidas
Dimitris Keramidas [https://community.jboss.org/people/varkon] created the discussion
"Problem implementing ws-security service (and client) in AS7.1.1"
To view the discussion, visit: https://community.jboss.org/message/735080#735080
--------------------------------------------------------------
Hello,
I have been trying to migrate a secure web service deployed in JBoss AS 5.1 to AS7.1. Having realized that the process is quite different now, I decided to start small and follow the https://docs.jboss.org/author/display/AS71/WS-Security WS-Security for AS7.1 documentation.Unfortunately, I did not manage to get the service working as expected (sign & encrypt). I keep getting errors like this:
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}AsymmetricBinding" was evaluated as "UNKNOWN".
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}Wss10" was evaluated as "UNKNOWN".
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token: The received token does not match the token inclusion requirement
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at $Proxy22.sayHello(Unknown Source)
at Test.main(Test.java:22)
or this (with a slightly altered WSDL):
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}AsymmetricBinding" was evaluated as "UNKNOWN".
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}Wss10" was evaluated as "UNKNOWN".
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}AsymmetricBinding: Received Timestamp does not match the requirements
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token: The received token does not match the token inclusion requirement
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}InitiatorToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}RecipientToken
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IncludeTimestamp: Received Timestamp does not match the requirements
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at $Proxy22.sayHello(Unknown Source)
at Test.main(Test.java:22)
I have tried changing the ws-securitypolicy configuration in my WSDL - as described in the http://docs.oasis-open.org/ws-sx/ws-securitypolicy/v1.3/ws-securitypolicy... WS-SecurityPolicy standard - but to no avail.
Are the sample web services described in the above https://docs.jboss.org/author/display/AS71/WS-Security WS-Security link located anywhere? I would very much like to download them, and try to deploy them as they are. Perhaps I might get a better idea of what I might be doing wrong.
Regards,
Dimitris
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/735080#735080]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months