[jBPM Development] - Getting "Could not execute JDBC batch update" while running process in JBPM 5.1 with persistence
by uvijayreddy657
uvijayreddy657 [http://community.jboss.org/people/uvijayreddy657] created the discussion
"Getting "Could not execute JDBC batch update" while running process in JBPM 5.1 with persistence"
To view the discussion, visit: http://community.jboss.org/message/622394#622394
--------------------------------------------------------------
We have created all the required mapping tables as per the JPA entity classes. When we are running the process, it tries to insert the process instance data into the database and at that time we are facing below issue. Please see below for the error,
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
org.hibernate.ejb.EntityManagerImpl@fbf51d
1
In Human Task Handler.... :)
Completed
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: select user_.id from OrganizationalEntity user_ where user_.id=?
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: insert into Task (allowedToDelegate, taskInitiator_id, priority, activationTime, actualOwner_id, createdBy_id, createdOn, documentAccessType, documentContentId, documentType, expirationTime, faultAccessType, faultContentId, faultName, faultType, outputAccessType, outputContentId, outputType, parentId, previousStatus, processInstanceId, skipable, status, workItemId, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)
Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)
Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)
Hibernate: insert into Content (content, id) values (?, ?)
Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?
javax.persistence.RollbackException: Error while committing the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:93)
at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:820)
at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:134)
at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:109)
at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:81)
... 29 more
Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:76)
... 29 more
Caused by: java.sql.BatchUpdateException: ORA-02291: integrity constraint (SDS_OWNR.FK27A9A56CE1EF3A) violated - parent key not found
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10720)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 37 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/622394#622394]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 11 months
[JBoss AS 7 Development] - Custom LoginModule in Jboss as 7.1 Beta 1
by Rodrigo Vallejo
Rodrigo Vallejo [http://community.jboss.org/people/rxvallejoce] created the discussion
"Custom LoginModule in Jboss as 7.1 Beta 1"
To view the discussion, visit: http://community.jboss.org/message/638431#638431
--------------------------------------------------------------
I have a custom LoginModule develop in jboss as 6.1 an this extends from .AbstractServerLoginModule, i dont know where is en Jboss 7.1 Beta 1, when i try to auth i have a exeption :
Caused by: java.lang.ClassNotFoundException: org.jboss.security.auth.spi.AbstractServerLoginModule from [Module "ec.gob.sri:main" from local module loader @1112783 (roots: /home/rxvc120809/tools/jboss-as-7.1.0.Beta1/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
... 52 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/638431#638431]
Start a new discussion in JBoss AS 7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 11 months
[JBoss AS7 Development] - Re: Weld-OSGi integration in AS7
by Kevin Pollet
Kevin Pollet [http://community.jboss.org/people/kevinpollet] created the discussion
"Re: Weld-OSGi integration in AS7"
To view the discussion, visit: http://community.jboss.org/message/605472#605472
--------------------------------------------------------------
> Thoughts?
Hi all,
I just want to give you my thinking and Mathieu's thinking about the use of the OSGiService qualifier. First of all, we agree with you that it's possible to get rid of the OSGiService qualifier (if a service is not found in CDI, it's possible to look at the OSGi service registry).
I thought a lot about this and one interrogation comes to my mind. How differentiate the case of a missing CDI binding and the case of a local implementation for a service? The default behavior of CDI is to throw an exception specifying that there is no binding for this injection target but in this case, a proxy waiting for an hypothetical OSGi service will be injected (and obviously will fail at runtime). IMHO, doing this will break the default CDI programming model. I mean that the user applicition will start without any problem in our case but in the default CDI programming model an exception will be thrown. We think that the user have to specify where he wants to use OSGi (so the user will knows where to deal with OSGi dynamism).
On the other hand, as you say in your above comments, this feature has to be enabled by the user. In this case he could be aware of this behavior, but we think it's too much changes for the CDI programming model.
WDYT?
Kevin & Mathieu
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/605472#605472]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 11 months
[JBoss AS7 Development] - Custom resource adapter and MDB
by Takayoshi Kimura
Takayoshi Kimura [http://community.jboss.org/people/tkimura] created the discussion
"Custom resource adapter and MDB"
To view the discussion, visit: http://community.jboss.org/message/620023#620023
--------------------------------------------------------------
Hi,
I'm using AS7 head (7.1.0.Alpha1-SNAPSHOT) and I've created a basic resource adapter for twitter and an MDB. The files are twitter-ra.rar and twittermdb.jar. My code is hosted at GitHub https://github.com/nekop/twitter-resource-adapter https://github.com/nekop/twitter-resource-adapter .
There are 2 issues in EJBUtilities.
1. When I put those files in the standalone/deployment directory the MDB deployment failed with the following exception:
java.lang.IllegalStateException: Not found RA registered as twitter-ra
EJBUtilities tries to find a corresponding rar in the following way:
for (String id : getMdr().getResourceAdapters()) {
if (getMdr().getRoot(id).getName().indexOf(resourceAdapterName) != -1) {
but this doesn't work because the File#getName() method of the deployment root File returns just "content". It's not a rar name.
2. @ResourceAdapter("twitter-ra.rar") doesn't work but @ResourceAdapter("twitter-ra") works
Because the resource adapter id is "twitter-ra". I thought we support both with and without ".rar".
What's the design behind the current logic? Could it be a problem if we replaced the code with the following?
String resourceAdapterId =
resourceAdapterName.endsWith(".rar") ?
resourceAdapterName.substring(0, resourceAdapterName.length() - ".rar".length()) :
resourceAdapterName;
if (!raFound && getMdr().getResourceAdapter(resourceAdapterId) != null) {
ResourceAdapter ra = getMdr().getResourceAdapter(resourceAdapterId).getResourceadapter();
if (ra instanceof ResourceAdapter1516
&& ((ResourceAdapter1516) ra).getInboundResourceadapter() != null) {
String className = ((ResourceAdapter1516) ra).getResourceadapterClass();
if (className.lastIndexOf(".") != -1)
packageName = className.substring(0, className.lastIndexOf("."));
else
packageName = "";
raFound = true;
}
}
Thanks,
Takayoshi
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620023#620023]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 11 months
[jBPM Development] - [jbpm5.1]Can get the current nodeId, correctly??
by leo li
leo li [http://community.jboss.org/people/leo87601] created the discussion
"[jbpm5.1]Can get the current nodeId,correctly??"
To view the discussion, visit: http://community.jboss.org/message/638682#638682
--------------------------------------------------------------
Dear all,
We want to get the current node name after completed a task.But it is not working correctly some time.
we found the error happen here.
long nodeId = wfInstance.getNodeInstances().iterator().next().getNodeId();
BTW, Before we setted the persistence, this issue does not happen.
The data seem had problem too, we found that the PROCESSINSTANCEINFO's lastmodificationdate(12:44:36) is the same as the pending node's log time, but the workflow had been run into Qualified at 12:44:43.
We can not see the processinstancebytearray, so not sure the processintanceinfo had been updated correctly or not?
select * from nodeinstancelog where processinstanceid =134 order by id desc;
|| ID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || TYPE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || NODEINSTANCEID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || NODEID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || PROCESSINSTANCEID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || PROCESSID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || LOG_DATE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || NODENAME (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) ||
| 683 | 0 | 5 | 9 | 134 | LeadProcess | 2011-11-28 12:44:43.048 | Qualified |
| 682 | 1 | 4 | 8 | 134 | LeadProcess | 2011-11-28 12:44:43.048 | Gateway |
| 681 | 0 | 4 | 8 | 134 | LeadProcess | 2011-11-28 12:44:43.048 | Gateway |
| 680 | 1 | 3 | 5 | 134 | LeadProcess | 2011-11-28 12:44:43.033 | Pending |
| 679 | 0 | 3 | 5 | 134 | LeadProcess | 2011-11-28 12:44:36.36 | Pending |
SELECT * FROM PROCESSINSTANCEINFO where iNSTANCEID =134;
|| INSTANCEID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || LASTMODIFICATIONDATE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || LASTREADDATE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || PROCESSID (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || PROCESSINSTANCEBYTEARRAY (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || STARTDATE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || STATE (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) || OPTLOCK (http://localhost:8082/query.do?jsessionid=eba938cf1dbf38d4a410125bbe377788#) ||
| 134 | 2011-11-28 12:44:36.376 | 2011-11-28 12:57:39.437 | LeadProcess | aced00057765000852756c65466c6f770000000000000086000b4c65616450726f6365737300000001000000000000000400000000001200000000000000030000000000000005001b00000000000000fd00000000000100000000000000020006616374696f6e0000000074000750656e64696e67770c0006757365724964000000007400056b72697376 |
Environment : Jboss 5.1, h2 database, windows 2003. we are using the default setting of jbpm-5.1.0.Final-installer-full.zip
Here is our code of complete task.
public ProcessInstanceBO completeUserTask(long instanceId, String toState){
ProcessInstance instance = ksession.getProcessInstance(instanceId); // init process by instanceid
WorkflowProcessInstance wfInstance = ((WorkflowProcessInstance)instance);
// get currently Node instances
Iterator<NodeInstance> iterator = wfInstance.getNodeInstances().iterator();
NodeInstance nodeInstance = iterator.next();
// compelte workitem.
final long workItemId = workItemNodeInstance.getWorkItemId();
final Map<String, Object> results = new HashMap<String, Object>();
results.put(this.ACTION, toState);
ksession.getWorkItemManager().completeWorkItem(workItemId, results);
ksession.getWorkItemManager().abortWorkItem(workItemId);
// retrieve the process instance again.
instance = ksession.getProcessInstance(instanceId);
WorkflowProcessInstance wfInstance = (WorkflowProcessInstance) instance;
//retrieve the current node again. we expect that , here is the next step's nodeid, but it doesn't work correctly every time. some time it still in the last stage.
long nodeId = wfInstance.getNodeInstances().iterator().next().getNodeId();
logger.debug("Process current node id: " + nodeId );
WorkflowProcess wfProcess = (WorkflowProcess) readKnowledgeBase().getProcess(wfInstance.getProcessId());
//We cannot get the correct Node name because.
Node node = wfProcess.getNode(nodeId);
....
}
We are confusing on this issue, please help. Thanks a lots.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/638682#638682]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 11 months