[jBPM] - Spring + JBpm 5.2 + Bitronix - JTA Transaction not rolling back
by S Jegan
S Jegan [https://community.jboss.org/people/jegan] created the discussion
"Spring + JBpm 5.2 + Bitronix - JTA Transaction not rolling back"
To view the discussion, visit: https://community.jboss.org/message/714963#714963
--------------------------------------------------------------
Hi All,
We are using JBpm 5.2 with Spring 3 and Bitronix as transaction manager. JBpm is integrated inside our application, we use the LocalTaskService to create tasks etc. All JBpm relates tables are co-existing with our application.
And another thing is that, we do not use JPA, but rather Hibernate. So there is one datasource, an Entity Manager for JBpm and a SessionFactory for our application. We have configured JTA using Bitronix and spring. Below is the configuration.
{code:xml}
<bean id="transactionManager"
class="com.tarshan.onebill.common.bpm.service.JTATransactionMgr">
<property name="transactionManager" ref="bitronixTransactionManager" />
<property name="userTransaction" ref="bitronixTransactionManager" />
</bean>
<bean id="btmConfig" factory-method="getConfiguration"
class="bitronix.tm.TransactionManagerServices">
<property name="serverId" value="spring-btm" />
<property name="defaultTransactionTimeout" value="300" />
</bean>
<bean id="bitronixTransactionManager" factory-method="getTransactionManager"
class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig"
destroy-method="shutdown">
</bean>
<bean id="jbpmDataSource" class="com.tarshan.onebill.common.bpm.vendor.jbpm.ObPoolingDataSource"
init-method="init" destroy-method="close">
<property name="className" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" />
<property name="uniqueName" value="jdbc/jbpm" />
<property name="minPoolSize" value="1" />
<property name="maxPoolSize" value="3" />
<property name="acquisitionInterval" value="1" />
<property name="acquisitionTimeout" value="15" />
<property name="maxIdleTime" value="15" />
<property name="useTmJoin" value="true" />
<property name="deferConnectionRelease" value="true" />
<property name="automaticEnlistingEnabled" value="true" />
<property name="allowLocalTransactions" value="true" />
<property name="driverProperties" ref="driverProperties" />
</bean>
{code}
Entity Manager configuration:
{code:xml}
<bean id="entityMF2"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="btmConfig">
<property name="dataSource" ref="jbpmDataSource" />
<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
</property>
<property name="persistenceUnitName" value="org.jbpm.persistence.jpa" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
</bean>
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.connection.autocommit">false</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.BTMTransactionManagerLookup
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.current_session_context_class">jta</prop>
</props>
</property>
</bean>
{code}
Now, we have a service which starts a process and then inserts some records in our application database. If any of the operation fails, JBpm is not rolling back the transaction. The weird thing is that, I could see from the log that Bitronix is rolling back the transaction. I could also see that JBpm is only joining the existing transaction at TaskServiceSession (because we have set transactionType as "local-JTA" while starting the task service).
{quote}
126224 07/02 18:46:01,358[main] DEBUG bpm.service.JTATransactionMgr.processRollback - Initiating transaction rollback
Inside doRollback
129134 07/02 18:46:04,268[main] DEBUG bitronix.tm.BitronixTransactionManager.debug - rolling back transaction a Bitronix Transaction with GTRID [737072696E672D62746D0000013557F39D0A00000000], status=ACTIVE, 1 resource(s) enlisted (started Tue Feb 07 18:44:37 IST 2012)
129135 07/02 18:46:04,269[main] DEBUG tm.timer.TaskScheduler.debug - cancelling transaction timeout task on a Bitronix Transaction with GTRID [737072696E672D62746D0000013557F39D0A00000000], status=ACTIVE, 1 resource(s) enlisted (started Tue Feb 07 18:44:37 IST 2012)
129136 07/02 18:46:04,270[main] DEBUG tm.timer.TaskScheduler.debug - removing task by a Bitronix Transaction with GTRID [737072696E672D62746D0000013557F39D0A00000000], status=ACTIVE, 1 resource(s) enlisted (started Tue Feb 07 18:44:37 IST 2012)
{quote}
I am really not clear why the records are still persisted in JBpm tables. Please help me fix this issue. Not sure what I am doing wrong. I could be missing something very basic. Have also uploaded the persistence.xml file.
Thanks for your time.
Regards,
Jegan
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714963#714963]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[jBPM] - I have a problem to use TaskQuery when find group tasks
by Israel Elías Salgado
Israel Elías Salgado [https://community.jboss.org/people/ielias] created the discussion
"I have a problem to use TaskQuery when find group tasks"
To view the discussion, visit: https://community.jboss.org/message/714959#714959
--------------------------------------------------------------
Hello guys , I have a problem to use TaskQuery when find group Tasks, specifically when I have ordered tasks , the jbpm's version is 4.4, I think that public String hql() method has a bug because never execute this code:
if (candidate == null && !count)
appendOrderByClause(hql);
And I need it , then I want override this method ,does anyone know how?, the method is on TaskQueryImpl,class.
I want to do my self method, How do I can do it?
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714959#714959]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss Web Services] - Using relative wsdl location and maven-jaxws-tools-plugin.
by Jeremy Whiting
Jeremy Whiting [https://community.jboss.org/people/whitingjr] created the discussion
"Using relative wsdl location and maven-jaxws-tools-plugin."
To view the discussion, visit: https://community.jboss.org/message/714252#714252
--------------------------------------------------------------
Hi,
I am having difficulty creating a ws client api using a wsdl. My mavenised project is using the maven-jaxws-tools-plugin plugin version 1.1.0.GA.
Your example on the Wiki indicates the user can declare a relative wsdl location in the module.
https://community.jboss.org/docs/DOC-13542#Examples_168533 https://community.jboss.org/wiki/JBossWS-Wsconsume#Examples_168533
I have tested it with a HTTP url and that works. But that option needs a running AS7 to provide the response.
Instead I want to use a relative path. Which should work. Given the example provided earlier. But my maven console shows no java classes are generated or saved in the source directory.
This is my pom.xml.
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.perf.test</groupId>
<artifactId>envEntryLookupClient</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- Compiler plugin enforces Java 1.6 compatibility and activates
annotation processors -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>maven-jaxws-tools-plugin</artifactId>
<version>1.1.0.GA</version>
<configuration>
<wsdlLocation> http://burtha02-wireless:8080/envEntryEmulatorSampleWeb/StaticService?wsdl http://burtha02-wireless:8080/envEntryEmulatorSampleWeb/StaticService?wsdl</wsdlLocation>
<wsdls>
<wsdl>${basedir}/src/main/resources/StaticService.wsdl</wsdl>
</wsdls>
<targetPackage>org.jboss.performance.jndi.test.client</targetPackage>
<sourceDirectory>src/main/java</sourceDirectory>
<extension>true</extension>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
...
<dependency>
<groupId>org.jboss.spec.javax.xml.ws</groupId>
<artifactId>jboss-jaxws-api_2.2_spec</artifactId>
<version>2.0.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>4.0.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-api</artifactId>
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
maven console output
$ mvn clean compile -DskipTests
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building envEntryLookupClient 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ envEntryLookupClient ---
[INFO] Deleting ..../envEntryLookupClient/target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ envEntryLookupClient ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ envEntryLookupClient ---
[INFO] Compiling 1 source file to ...../envEntryLookupClient/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.815s
[INFO] Finished at: Fri Feb 03 10:52:06 GMT 2012
[INFO] Final Memory: 20M/162M
[INFO] ------------------------------------------------------------------------
The wsdl is located here
./src/main/resources:
StaticService.wsdl
Is there something else I should be doing with the plugin configuration to get this working with the plugin ?
Regards,
Jeremy
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714252#714252]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss Messaging] - ConnectionFactory returns invalid URL which causes MessagingNetworkFailureException
by Duane Zamrok
Duane Zamrok [https://community.jboss.org/people/dewthefifth] created the discussion
"ConnectionFactory returns invalid URL which causes MessagingNetworkFailureException"
To view the discussion, visit: https://community.jboss.org/message/714389#714389
--------------------------------------------------------------
Hello, and thank you in advance for any assistence you might offer.
I am trying to connect two JBoss servers, executing on separate machines, to one another using JMS through JBoss Messaging. Due to network topography and proxying requirements, the each machine is referenced differently than the machine's hostname. I'll elaborate.
Network one contains a machine which we will call Jboss01.
Network two contains two machines, Jboss02 and Jboss03.
Network one and Network two communicate through a shared domain controller which we'll call DC01.
When Jboss01 attempts to access Jboss02 then DC01 directs Jboss01 to JbossProxy which will proxy traffic on port 443 to port 8443.
Jboss01 is incapable of reaching Jboss02 directly
When Jboss02 attempts to access Jboss03 then DC01 directs Jboss02 to JbossProxy which will proxy traffic on port 443 to port 8443.
Jboss02 is capable of reaching Jboss03 directly by asking specifically for Jboss03-vm which DC01 understands to be a direct link
Jboss01>hostname will return Jboss01
Jboss02>hostname will return Jboss02
Jboss03>hostname will return Jboss03
I am trying to send JMS messages from Jboss02 to Jboss03, but the org.jboss.jms.server.connectionfactory.ConnectionFactory returned from JNDI attempts to connect to Jboss03 instead of Jboss03-vm. This causes the connection to be routed through the proxy, which does not service the JMS port, and results in the MessageNetworkingFailureException mentioned in the topic. My JNDI connection is through Jboss03-vm, and I have set several properties (bind.addres, java.rmi.server.hostname) to Jboss03-vm to facilitate the direct connection that I require, but I cannot figure out how to configure the org.jboss.remoting.transport.Connector to use Jboss03-vm instead of Jboss03.
Thanks again for any help you might offer.
*Environment*
I am currently working within a customer controlled environment, which limits some of my options for upgrades and solutions.
*JbossAS*
jboss-eap-4.3
*JbossMessaging*
jboss.messaging.jmsVersion=1.1
jboss.messaging.jmsMajorVersion=1
jboss.messaging.jmsMinorVersion=1
jboss.messaging.jmsProviderName=JBoss Messaging
jboss.messaging.providerVersion=1.4.0.SP3-CP08.patch01
jboss.messaging.providerMajorVersion=1
jboss.messaging.providerMinorVersion=4
jboss.messaging.providerIncrementingVersion=32
*JbossRemoting*
Name: JBossRemoting
Specification-Title: JBossRemoting
Implementation-Title: JBossRemoting
Specification-Vendor: JBoss Inc.
Specification-Version: 2.2.3
Implementation-Vendor-Id: http://www.jboss.org http://www.jboss.org
Implementation-Version: 2.2.3
Implementation-Vendor: JBoss Inc.
*Properties*
bind.address=intellex-vm
jboss.bind.address=0.0.0.0
java.rmi.server.hostname=intellex-vm
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714389#714389]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months