[JBoss jBPM] - Re: EJB3 Stateless Session Bean and jbpm-enterprise.ear
by mputz
If you use jBPM in a managed environment, in your case from within an EJB3 bean, you have to set the proper configuration parameters. Otherwise jBPM will delegate transaction handling to Hibernate instead of enrolling in CMT.
See: http://docs.jboss.org/jbpm/v3/userguide/persistence.html#thedbpersistence...
For jBPM to use managed transactions, it must be configured correctly in jbpm.cfg.xml and hibernate.cfg.xml. In particular in jbpm.cfg.xml set the isTransactionEnabled attribute to 'false'. By setting isTransactionEnabled to false we are telling jBPM to NOT close the hibernate session when the client calls jbpmContext.close(). This is important in a managed environment, since we want hibernate to close the session only after the transaction manager tells Hibernate that it has committed the transaction.
| <jbpm-context>
| <service name="persistence">
| <factory>
| <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
| <field name="isTransactionEnabled"><false /></field>
| </bean>
| </factory>
| </service>
| </jbpm-context>
|
In hibernate.cfg.xml, you should set:
| <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
|
| <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
|
This will make jBPM work with container managed transactions.
In your hibernate.cfg.xml remove the property "jta.UserTransaction", as you are enrolling in CMT.
Regards,
Martin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033914#4033914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033914
19 years
[JBoss jBPM] - jbpm-console example in jBPM 3.2 not working
by hashir
Hello,
I am evaluating jBPM 3.2. I downloaded the latest release of jBPM 3.2 suite & tried to run the jbpm-console example.
I looged in successfully but received this error when tried to create an instance of web sales order process from the process list page.
Note: I am using JDK 1.5.3
Stack trace:
javax.faces.FacesException: Stream error while reading XML: www.w3.org
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:522)
at com.ctc.wstx.sr.WstxStreamReader.next(WstxStreamReader.java:978)
at org.jbpm.webapp.tag.jbpm.ui.XmlPrinter.encodeBegin(XmlPrinter.java:113)
at org.jbpm.webapp.tag.jbpm.ui.ComponentBase.doEncode(ComponentBase.java:31)
at org.jbpm.webapp.tag.jbpm.ui.ComponentBase.doEncode(ComponentBase.java:58)
at org.jbpm.webapp.tag.jbpm.ui.Tab.encodeChildren(Tab.java:112)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
at org.jbpm.webapp.application.JbpmViewHandler.renderView(JbpmViewHandler.java:58)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033912#4033912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033912
19 years
[JBoss jBPM] - Errors with global transactions on oracle
by freerider
Hi,
I'm trying to move an application, which uses jBPM, from Postgres to Oracle 8.1.7.
My setup is:
JBoss 4.0.3SP1
jBPM 3.1 which uses Hibernate 3.1.2 which is configured by Spring 1.2.7.
My problem is, that oracle doens't allow the following SQL in a global transaction:
analyze table MOSSWORKFLOW_TEST1.JBPM_ACTION estimate statistics
Error encountered: ORA-02089
Here is my xa-datasource configuration:
<xa-datasource>
<jndi-name>MossJbpmXADS</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@IP:1521:dbName</xa-datasource-property>
<xa-datasource-property name="User">user</xa-datasource-property>
<xa-datasource-property name="Password">pwd</xa-datasource-property> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools/>
<type-mapping>Oracle8i</type-mapping>
</xa-datasource>
I haven't found any entry concerning this problem in the forum.
Thanks for helping me out.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033911#4033911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033911
19 years
[EJB 3.0] - how to realize distributetransaction between 2 containers?
by lugibin
There are two jboss servers, and there is on EJB A and EJB B in server A, there is one EJB C in server B,I want to invoke EJB B and C in EJB A, and I would like to make them in one transaction, code list, but it throw exceptions:
Properties localProps = new Properties();
//localProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
//localProps.setProperty("java.naming.provider.url", "iiop://localhost:1099");
//localProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
InitialContext localContext = new InitialContext(localProps);
//Properties remoteProps = new Properties();
//remoteProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
// remoteProps.setProperty("java.naming.provider.url", "iiop://10.1.16.38:1099");
// remoteProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
// InitialContext remoteContext = new InitialContext(remoteProps);
UserTransaction trans = (UserTransaction) localContext.lookup("UserTransaction");
try {
trans.begin();
// Member member = (Member) localContext.lookup("MemberBean/remote");
// PotentialMemberEntity memberEntity = new PotentialMemberEntity();
// memberEntity.setMobilenumber("13811111111");
// member.addPotentialMember(memberEntity);
BoothMember boothMember = (BoothMember) localContext.lookup("corbaname:iiop:1.2@qbh:3528#BoothMemberBean/remote");
BoothMemberKindEntity kindEntity = new BoothMemberKindEntity();
kindEntity.setBoothid(1L);
kindEntity.setKindtitle("QbhTest");
boothMember.addMemberKind(kindEntity);
trans.commit();
} catch (Exception e) {
trans.rollback();
throw e;
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033909#4033909
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033909
19 years