[jBPM] - Problem configuring hibernate.cfg.xml to point to datasource located under jbpm-gwt-console-server.war>WEB-INF>classes
by satish polasi
satish polasi [http://community.jboss.org/people/satishpolasi] created the discussion
"Problem configuring hibernate.cfg.xml to point to datasource located under jbpm-gwt-console-server.war>WEB-INF>classes"
To view the discussion, visit: http://community.jboss.org/message/620485#620485
--------------------------------------------------------------
Hi community,
My requirement is not to have password as clear text in hibernate.cfg.xml and persistence.xml file located in jbpm-human-task.jar so I modified the hibernate.cfg.xml to point to datasource. Can anyone please help how to over come this problem.
*My hibernate.cfg.xml is*
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
" http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
* <property name="connection.datasource">java:workflow-Datasource</property> // This is my datasource i am using to connect to oracle database*
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">false</property>
<mapping resource="AuditLog.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I am able to login to jbpm-console but on task creation i am getting the following exception
*16:41:45,747 ERROR [JDBCTransaction] JDBC commit failed*
*java.sql.SQLException: You cannot commit during a managed transaction!*
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:660)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:487)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
*16:41:45,751 INFO [STDOUT] 16:41:45,749 ERROR [SingleSessionCommandService] Could not commit session*
*org.hibernate.TransactionException: JDBC commit failed*
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:161)
at org.jbpm.process.audit.WorkingMemoryDbLogger.addProcessLog(WorkingMemoryDbLogger.java:68)
at org.jbpm.process.audit.WorkingMemoryDbLogger.logEventCreated(WorkingMemoryDbLogger.java:44)
*Caused by: java.sql.SQLException: You cannot commit during a managed transaction!*
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:660)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:487)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
I have attached the complete server log.
Thanks,
Satish.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620485#620485]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - rule.ConsequenceException only with JPA
by Gary Struthers
Gary Struthers [http://community.jboss.org/people/GaryS] created the discussion
"rule.ConsequenceException only with JPA"
To view the discussion, visit: http://community.jboss.org/message/620233#620233
--------------------------------------------------------------
I've adapted Salaboy's /04-jBPM5-PersistentEmergencyServiceProcess to my process and rule. I copied it's 2 process managers and jpa configuration and adapted his test class. The h2 database connection works. I made another process manager that doesn't use
JPAKnowledgeService, it just calls kbase.newStatefulKnowledgeSession()
My rule execute with kbase.newStatefulKnowledgeSession()
AFTER RULEFLOW COMPLETED process...
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.788 sec
But with JPAKnowledgeService
Hibernate: update ProcessInstanceInfo set lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?
BEFORE ACTIVATION FIRED rule:applicationReady activationId:applicationReady [3, 2] declarations: $process=WorkflowProcessInstance1 [processId=XXX,state=1](2); $vars=FreshmanReadPIvars [XXX](3) ruleflow-group: assignApplication
1 09/08 17:44:59,788[main] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction - Could not commit session
org.drools.runtime.rule.ConsequenceException: rule: applicationReady
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620233#620233]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - Re: How to fix: "The chosen transaction strategy requires access to the JTA TransactionManager" issue?
by sharyak
sharyak [http://community.jboss.org/people/sharyak] created the discussion
"Re: How to fix: "The chosen transaction strategy requires access to the JTA TransactionManager" issue?"
To view the discussion, visit: http://community.jboss.org/message/620451#620451
--------------------------------------------------------------
This one:
Caused by: java.lang.Throwable: Substituted for missing class org.hibernate.HibernateException - The chosen transaction strategy requires access to the JTA TransactionManager
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:46)
at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
at weblogic.deployment.EarPersistenceUnitRegistry.initialize(EarPersistenceUnitRegistry.java:72)
at weblogic.application.internal.flow.InitJpaFlow.prepare(InitJpaFlow.java:38)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620451#620451]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - Unclear on how to get a Process param into my WorkItem
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"Unclear on how to get a Process param into my WorkItem"
To view the discussion, visit: http://community.jboss.org/message/620414#620414
--------------------------------------------------------------
Hi,
I am defining my workflows using the BPMN2 Eclipse tool. When I run my WorkItem I need to get access to a parameter defined in the Process. I use this, which is not good because many Process may be running witht this same parameter in thei Stateful session.
[code]
|
|
| AClass myContext = null; |
|
|
|
| Iterator<ProcessInstance> it = ksession.getProcessInstances().iterator(); |
|
|
|
| while(it.hasNext()) { |
|
|
|
|
| ProcessInstance procInst =it.next(); |
|
|
|
|
| Map<String,Object> contxt = procInst.getProcess().getMetaData(); |
|
|
|
|
| if(contxt.containsValue("myContext")) { |
|
|
|
|
|
| myContext = (AClass) contxt.get("myContext"); |
|
|
|
| } |
|
|
|
| } |
|
|
|
| if(myContext != null) |
|
|
|
|
| service.run(aGrp, myContext); |
|
|
|
| manager.completeWorkItem(workItem.getId(), null); |
|
[/code]
salaboy pointed to his general examples for a similar question and I looked in all of them and could not see where theh recommended way of accessing a Process parameter is shown.
Thx.
David
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620414#620414]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - Unclear on how to get a Process param into my WorkItem
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"Unclear on how to get a Process param into my WorkItem"
To view the discussion, visit: http://community.jboss.org/message/620412#620412
--------------------------------------------------------------
Hi,
I am defining my workflows using the BPMN2 Eclipse tool. When I run my WorkItem I need to get access to a parameter defined in the Process. I use this, which is not good because many Process may be running witht this same parameter in thei Stateful session.
[code]
|
|
| AClass myContext = null; |
|
|
| Iterator<ProcessInstance> it = ksession.getProcessInstances().iterator(); |
|
|
| while(it.hasNext()) { |
|
|
|
| ProcessInstance procInst =it.next(); |
|
|
|
| Map<String,Object> contxt = procInst.getProcess().getMetaData(); |
|
|
|
| if(contxt.containsValue("myContext")) { |
|
|
|
|
| myContext = (AClass) contxt.get("myContext"); |
|
|
|
| } |
|
|
| } |
|
|
| if(myContext != null) |
|
|
|
| service.run(aGrp, myContext); |
|
|
| manager.completeWorkItem(workItem.getId(), null); |
[/code]
salaboy pointed to his general examples for a similar question and I looked in all of them and could not see where theh recommended way of accessing a Process parameter is shown.
Thx.
David
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620412#620412]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months