[jBPM] - Re: Human task + HornetQ + persistence + MySQL => ununderstanding stacktrace
by Sandra Renaud
Sandra Renaud [https://community.jboss.org/people/joploya] created the discussion
"Re: Human task + HornetQ + persistence + MySQL => ununderstanding stacktrace"
To view the discussion, visit: https://community.jboss.org/message/772558#772558
--------------------------------------------------------------
I add these lines after all named-queries to Taskorm.xml of human-task-core/META-INF/
> <entity class="org.jbpm.task.Task" metadata-complete="false">
> <attributes>
> <id name="id">
> <column name="id" />
> <generated-value strategy="IDENTITY "/>
> </id>
> </attributes>
> </entity>
After deployement my table task in MySQL have the option 'Auto Increment' check as I wanted but the error 'field id doesn't have default value' appears again :
> 14:31:34,615 ERROR [org.jbpm.task.service.TaskServerHandler] (Thread-70) Operation failed: java.lang.RuntimeException: Operation failed
> at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:994) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:186) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:144) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:44) [jbpm-human-task-hornetq-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:85) [jbpm-human-task-hornetq-5.3.0.Final.jar:5.3.0.Final]
> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
> Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Field 'id' doesn't have a default value
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:859) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.jbpm.task.service.persistence.TaskPersistenceManager.saveEntity(TaskPersistenceManager.java:186) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.TaskServiceSession$1.doOperation(TaskServiceSession.java:188) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:979) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> ... 5 more
> Caused by: org.hibernate.exception.GenericJDBCException: Field 'id' doesn't have a default value
> at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at $Proxy38.executeUpdate(Unknown Source) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2757) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3268) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:78) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:304) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:128) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:717) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:710) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.spi.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:49) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:380) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:409) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:350) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:326) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:462) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:337) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:128) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:725) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:701) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:705) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:853) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
> ... 8 more
> Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2345)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2330)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)
> at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) [:1.7.0_07]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_07]
> at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_07]
> at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
> ... 45 more
>
>
> 14:31:34,654 ERROR [org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler] (http--127.0.0.1-8080-3) Fri Oct 26 14:31:34 CEST 2012: Error when creating task on task server for work item id 1. Error reported by task server: Command AddTaskRequest faild due to Operation failed. Please contact task server administrator.: java.lang.RuntimeException: Command AddTaskRequest faild due to Operation failed. Please contact task server administrator.
> at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:662) [jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:44) [jbpm-human-task-hornetq-5.3.0.Final.jar:5.3.0.Final]
> at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:85) [jbpm-human-task-hornetq-5.3.0.Final.jar:5.3.0.Final]
> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772558#772558]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[Datasource Configuration] - Remote Jndi Datasource: ResultSet gets randomly closed
by manu patet
manu patet [https://community.jboss.org/people/troubleshooter] created the discussion
"Remote Jndi Datasource: ResultSet gets randomly closed"
To view the discussion, visit: https://community.jboss.org/message/772561#772561
--------------------------------------------------------------
Hello experts,
Let me give a short description of our deployment here before the issue.
We have multiple databases that our central reporting application reads. We do it by running multiple application servers (all JBoss 4.2.3.GA) on each of these boxes. The central application obtains Datasource objects by remote jndi lookup (see the http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/beta500/htm... note) and keeps them cached. We're totally ok with the caveats JBoss has mentioned since we don't run any distributed transactions. Moreover, this model has worked out beautifully so far and more importantly integrates with our existing model seamlessly.
The problem:
Under stress tests, the resultsets tend to close halfway and the underlying statement throws a SQLExcpetion. Here's a trace:
java.sql.SQLException: The result set is closed.
at org.jboss.resource.adapter.jdbc.WrappedResultSet.checkState(WrappedResultSet.java:1959)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getString(WrappedResultSet.java:885)
at sun.reflect.GeneratedMethodAccessor334.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doResultSetMethod(WrapperDataSourceService.java:431)
at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:233)
at sun.reflect.GeneratedMethodAccessor326.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:818)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:419)
at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy78.getString(Unknown Source)
at com.aryaka.nos.stats.feeder.ChartMapperDb.getChart(ChartMapperDb.java:73)
at com.aryaka.nos.stats.StatsAPIImpl.getStats(StatsAPIImpl.java:171)
at com.aryaka.nos.stats.StatsAPIImpl.getLinkTimeseriesStats(StatsAPIImpl.java:724)
at com.aryaka.nos.stats.StatsAPIImpl.getAppTimeseriesStats(StatsAPIImpl.java:633)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
This particular exception got thrown in this code:
if(rs.next()) {
ArrayList<Formula> arrFormula = new ArrayList<Formula>();
ArrayList<ChartConstants> arrConst = new ArrayList<ChartConstants>();
ChartConstants graphConstant = null;
do{
//do stuff
}while(rs.next()); //<<OFFENDING LINE
}
The code is the same production code that runs just fine on local datasources. Statements/Connection closures are handled in finally blocks. There are no shared connections/statements. All statements close before fetching a new resultset. Each request pulls a new connection from pool. All standard stuff.
I'm clueless as to what might be causing resultsets to close randomly. Any help is appreciated!
-Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772561#772561]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[jBPM] - taskservice error in jbpm5.3 with mysql
by Kehua Gao
Kehua Gao [https://community.jboss.org/people/kehuagao] created the discussion
"taskservice error in jbpm5.3 with mysql"
To view the discussion, visit: https://community.jboss.org/message/772483#772483
--------------------------------------------------------------
hi, I try the taskservice code in jbpm5.3 with mysql,it occurs error as follow:
java.lang.IllegalArgumentException: Named query not found: UnescalatedDeadlines
at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:108)
at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlinesList(TaskPersistenceManager.java:174)
at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlines(TaskPersistenceManager.java:146)
at org.jbpm.task.service.TaskServiceSession.scheduleUnescalatedDeadlines(TaskServiceSession.java:231)
at org.jbpm.task.service.TaskService.initialize(TaskService.java:116)
at org.jbpm.task.service.TaskService.initialize(TaskService.java:101)
at org.jbpm.task.service.TaskService.(TaskService.java:79)
at com.sample.TaskServer.main(TaskServer.java:26)
taskservice code:
package com.sample;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.drools.SystemEventListenerFactory;
import org.jbpm.task.User;
import org.jbpm.task.service.TaskService;
import org.jbpm.task.service.TaskServiceSession;
import org.jbpm.task.service.mina.MinaTaskServer;
import bitronix.tm.resource.jdbc.PoolingDataSource;
public class TaskServer {
/**
* @param args
*/
public static final void main(String[] args) {
try {
EntityManagerFactory emfTask = Persistence.createEntityManagerFactory( "org.jbpm.task" );
TaskService taskService = new TaskService(emfTask, SystemEventListenerFactory.getSystemEventListener());
/*
* Add the required users
*/
TaskServiceSession taskSession = taskService.createSession();
taskSession.addUser(new User("Administrator"));
taskSession.addUser(new User("krisv"));
/* Start Mina server for HT*/
MinaTaskServer server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
System.out.println("Server started ...");
} catch (Throwable t) {
t.printStackTrace();
}
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772483#772483]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[jBPM] - Human task + HornetQ + persistence + MySQL => ununderstanding stacktrace
by Sandra Renaud
Sandra Renaud [https://community.jboss.org/people/joploya] created the discussion
"Human task + HornetQ + persistence + MySQL => ununderstanding stacktrace"
To view the discussion, visit: https://community.jboss.org/message/772405#772405
--------------------------------------------------------------
Hello... or welcome back,
I go from error to error with jbpm and Human task, trying using them in my web application.
Last step was to connect the human task to LDAP and it seems working well :
16:30:13,329 INFO [stdout] (MSC service thread 1-6) HornetQ Task service started correctly !
16:30:13,330 INFO [stdout] (MSC service thread 1-6) HornetQ Task service running ...
16:30:13,334 INFO [org.jbpm.task.service.UserGroupCallbackManager] (MSC service thread 1-6) UserGroupCallback registered: org.jbpm.task.service.LDAPUserGroupCallbackImpl
16:30:13,335 INFO [stdout] (MSC service thread 1-6) Task service startup completed successfully !
So I return to the web app where I created a classe to manage the knowledgeSession (file attach), that I use in my Bean :
try {
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "/log/loggerFile.log", 1000);
HornetQHTWorkItemHandler hornetQHTWorkItemHandler = new HornetQHTWorkItemHandler(ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", hornetQHTWorkItemHandler);
getFlowEntity().setCurrentGroup("AMS_CRW_"+getFlowEntity().getGlobalEntity().getCodifType()+"_CODIF");
getFlowEntity().setRequestorName(((UserLDAP)identity.getUser()).getUser().getFirstName()+" "+((UserLDAP)identity.getUser()).getUser().getName());
//Add the current actor in CC
System.out.println("Add the current actor in CC");
PeopleEntity requestor = getCurrentPeople("AMS_CRW_PM_PL");
listCCnpl.add(requestor);
// ... some code
// start a new process instance
Map<String, Object> params = new HashMap<String, Object>();
params.put("userId", requestor.getName());
params.put("userGroup", requestor.getRole());
params.put("flowId", getFlowEntity().getFlowId());
ProcessInstance process = ksession.startProcess("com.st.ams.flow.npl", params);
System.out.println("process = "+process.getProcessId()+" : "+process.getProcessName()+" : state("+process.getState()+")");
SystemEventListenerFactory.setSystemEventListener(new SystemEventListener());
//Now the PM_PL process his task (it is already complete in reality)
BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
List<String> groups = new ArrayList<String>();
groups.add(requestor.getRole());
System.out.println("Groups : ");
for(String grp : groups){
System.out.println(" - "+grp);
}
amsKnowledgeSession.getClient().getTasksAssignedAsPotentialOwner(requestor.getName(), groups, "en-UK", taskSummaryResponseHandler);
List<TaskSummary> potentialTasks = taskSummaryResponseHandler.getResults();
for(TaskSummary task : potentialTasks){
System.out.println("PM_PL can execute task " + task.getName() + "(" + task.getId() + ": " + task.getDescription() + ")");
}
} catch (Exception e) {
e.printStackTrace();
}
The process seams to be launched correctly but after there is a lot of error in many threads (103, 106, 137 ....)
what do they mean?
Most of the entity mapped by the Human task have a field id, so what can be wrong with persistence? And which persistence?(human-core, human task, or other...)
Thanks in advance to help me progress because the others thread of dicussion and documentation don't help me at this point.
Another question linked is why human task generate a lot of tables like xxx_id_seq whereas entities have an AutoGenerated id value?
Regards,
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772405#772405]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[JBoss Cache] - JPA Entity(Hibernate) is not updated with REPL_SYNC cache mode
by Miklos Molnar
Miklos Molnar [https://community.jboss.org/people/molnarmi] created the discussion
"JPA Entity(Hibernate) is not updated with REPL_SYNC cache mode"
To view the discussion, visit: https://community.jboss.org/message/772526#772526
--------------------------------------------------------------
Dear JBoss users,
I am using jboss AS 5.0 and I have the following issue :
I am working on POF with having stateless session bean in cluster (round robin) in front of the hibernate-jpa. The second level cache is turned on.
I have tried all cache configuration (optimistic-shared, pessimistic-shared, optimistic-entity, etc...), but I do experience in all cases that the Entity update does not get synced/invalidated on the other node. When a new item is added to the cache it is always replicated well, but the entity update does not. So this means that on only one node the second level cache is updated on the other node the old data remains. So when after the entity update I make the call to the session beans on the different nodes they return different data for the same entity. On the node which received the entity update call everything is fine, however the other node does not receive any notification about the update. I turned the org.hibernate.cache log to INFO and I see "externalPutRead" command notification when a new item is added to the cache on the other node, however I see nothing when the entity is updated by the other node. My JPA Entity's cache configuration is TRANSACTIONAL and the JPA EntityManager access is done in REQUIRED transaction in the session bean. Do I miss anything?
Thanks for any comment.
regards, Miklos
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772526#772526]
Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[EJB3] - Calling an EJB from servlet
by Andreas Nauerz
Andreas Nauerz [https://community.jboss.org/people/NautilusIII] created the discussion
"Calling an EJB from servlet"
To view the discussion, visit: https://community.jboss.org/message/772525#772525
--------------------------------------------------------------
Hi!
I successfully deployed a simple EJB 3.
Here is the code:
{code}
package ejb;
import javax.ejb.Remote;
@Remote
public interface HelloWorld {
public String sayHello();
}
package ejb;
import javax.ejb.Stateless;
import ejb.HelloWorld;
public @Stateless class HelloWorldBean implements HelloWorld {
public String sayHello()
{
return "Hello world...";
}
}
{/code]
The deployment tells me about the following bindings:
{code}
java:global/MyEJBProject/HelloWorldBean!ejb.HelloWorld
java:app/MyEJBProject/HelloWorldBean!ejb.HelloWorld
java:module/HelloWorldBean!ejb.HelloWorld
java:jboss/exported/MyEJBProject/HelloWorldBean!ejb.HelloWorld
java:global/MyEJBProject/HelloWorldBean
java:app/MyEJBProject/HelloWorldBean
java:module/HelloWorldBean
{/code}
Looking up from a standalone client works:
{code}
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import ejb.HelloWorld;
import ejb.HelloWorldBean;
public class Client {
public static void main(String[] args) {
try {
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
env.put(Context.SECURITY_PRINCIPAL, "xxx");
env.put(Context.SECURITY_CREDENTIALS, "xxx");
env.put("jboss.naming.client.ejb.context", true);
Context ctx = new InitialContext(env);
HelloWorld hello = (HelloWorld) ctx.lookup("MyEJBProject/HelloWorldBean!ejb.HelloWorld");
System.out.println("EJB says: " + hello.sayHello());
} catch (Exception e) {
e.printStackTrace();
}
}
}
{/code}
But invocation from a servlet results in error messages due to unsuccessful lookups.
I tried:
{code}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
Context ctx = new InitialContext();
HelloWorld hello = (HelloWorld) ctx
.lookup("MyEJBProject/HelloWorldBean!ejb.HelloWorld");
out.println("EJB says: " + hello.sayHello());
} catch (Exception e) {
e.printStackTrace();
}
}
{/code}
Any idea?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772525#772525]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months