Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » How to capture at activity exception thrown by camel producer route
How to capture at activity exception thrown by camel producer route [message #1695444] Thu, 14 May 2015 16:41 Go to next message
Gudrun Koko is currently offline Gudrun KokoFriend
Messages: 20
Registered: January 2013
Junior Member
Hi

I have a few modeling questions in particular about exception handling for Camel Producer routes in a Stardust process.

I am developing an integration process flow in Stardust 2.1.1 using application Stardust Camel Application Type. See attached pictures. The camel producer route attached to activity HRMSMN01_CAMEL_01 is throwing an exception because of a missing input parameter for the executed PL/SQL procedure; however, my attached boundary event is not aborting the activity.

First, since I might be trying to do something that is not possible with Stardust

Can a boundary event detect an exception thrown in a Camel producer route ?

If YES which exception if 'Other' do I have to trigger the event for ? The one tried did not cause the activity to abort.

If NO how else can I capture this exception which should ultimately abort the associated activity ? Other solution I could think of is to add an errorHandler at the Camel context level which passes back information to the Stardust process if possible ?

If not this how do I ensure that activity HRMSMN01_CAMEL_01 activity is properly aborted using either a boundary event or other solution - a sub process maybe ?

Thanks for sharing any of your insights

Gudrun

[Updated on: Thu, 14 May 2015 16:51]

Report message to a moderator

Re: How to capture at activity exception thrown by camel producer route [message #1695456 is a reply to message #1695444] Thu, 14 May 2015 20:00 Go to previous messageGo to next message
Gudrun Koko is currently offline Gudrun KokoFriend
Messages: 20
Registered: January 2013
Junior Member
Issue got half resolved. New insights however also new questions - the activity did abort according to LOG ?!! Smile -- see log snippet below.

However, an exception was thrown after activity was set to 'Aborting'. Here, it appears a rollback of a JTA transaction failed which caused the process itself to not start up properly.

Another timeout linked to a JTATransactionManager I assume which needs to be changed in file carnot-spring-jta-jencks-context.xml ? Has anyone else had to make changes to this file ? What is the name of the property to be added for a timeout ?

Content of file carnot-spring-jta-jencks-context.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
- Application context with TX-manager definition for a Infinity Process Engine client.
-->
<beans>
<alias alias="carnotTxManager" name="jtaTxManager" />

<bean id="jtaTxManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransaction" ref="xaTransactionManager" />
</bean>

<bean name="xaTransactionManager"
class="org.jencks.factory.TransactionManagerFactoryBean" />

<bean id="jencksConnectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">

<property name="transactionManager" ref="xaTransactionManager" />
<property name="transaction" value="xa" />
<property name="poolMinSize" value="20" />
<property name="poolMaxSize" value="50" />

</bean>

<bean id="xaAuditTrailConnectionFactory"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
<property name="managedConnectionFactory">
<bean class="org.eclipse.stardust.engine.core.persistence.jca.XaDataSourceMCF">
<constructor-arg index="0"
ref="carnotXaAuditTrailDataSource" />
</bean>
</property>
<property name="connectionManager"
ref="jencksConnectionManager" />
</bean>
</beans>



in carnot.log found

--- log snippet

....
13:14:15 WARN - [bio-8080-exec-4] TransactionErrorHandler - Transaction rollback (0x521f299b) redelivered(unknown) for (MessageId: ID-lenado-is-colostate-edu-45147-1431630695144-0-5 on ExchangeId: ID-lenado-is-colostate-edu-45147-1431630695144-0-6) caught: org.springframework.dao.InvalidDataAccessApiUsageException: Required input parameter 'P_PIDM' is missing
13:14:15 INFO - [bio-8080-exec-4] DebugInterceptor - --> isolate
13:14:15 INFO - [bio-8080-exec-4] Security - Partition: default, Domain: default.
13:14:15 INFO - [bio-8080-exec-4] DebugInterceptor - <-- isolate
13:14:15 INFO - [bio-8080-exec-4] AuditTrailLogger - Processing event Event: [objectOID = 15, type = 1, handlerOID = -1, handlerModelElementOID = 30064772470] for handler Event Handler: (User: motu (Realm: carnot) (Of the Universe, Master))
13:14:15 INFO - [bio-8080-exec-4] ActivityInstanceBean - State change for Activity instance 'HRMSMN01_CAMEL_01', oid: 15 (process instance = 4) (model oid = 7, version = 1, revision = 0): Created-->Aborting.
13:14:15 INFO - [bio-8080-exec-4] Security - Partition: default, Domain: default.
13:14:15 INFO - [bio-8080-exec-4] DebugInterceptor - <-- startProcess
13:14:15 ERROR- [bio-8080-exec-4] ExceptionHandler -
org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1014)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:148)
at org.eclipse.stardust.engine.api.spring.SpringTxInterceptor.invoke(SpringTxInterceptor.java:56)
at org.eclipse.stardust.engine.core.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:130)
at org.eclipse.stardust.engine.core.runtime.interceptor.MethodInvocationImpl.execute(MethodInvocationImpl.java:68)
at org.eclipse.stardust.engine.core.runtime.beans.InvocationManager.invoke(InvocationManager.java:53)
at com.sun.proxy.$Proxy63.startProcess(Unknown Source)

Re: How to capture at activity exception thrown by camel producer route [message #1695632 is a reply to message #1695456] Mon, 18 May 2015 09:07 Go to previous messageGo to next message
Fradj Zayen is currently offline Fradj ZayenFriend
Messages: 6
Registered: October 2011
Location: Tunis, Tunisia
Junior Member
Hi,
you need to add onException element in your route and mark the thrown exception as handled:
<onException>
<exception>...InvalidDataAccessApiUsageException</exception>
<handled>
<constant>true</constant>
</handled>
</onException>

this will prevent the transaction to be roll ed back at Camel route level.

The exception will be propagated to Stardust and you will be able to handle it using


for more details please refer to the example at https://wiki.eclipse.org/Stardust/Knowledge_Base/Integration/Camel/Exception_Handling_in_Generic_Camel_Application

Best Regards
Re: How to capture at activity exception thrown by camel producer route [message #1695697 is a reply to message #1695632] Mon, 18 May 2015 13:33 Go to previous message
Gudrun Koko is currently offline Gudrun KokoFriend
Messages: 20
Registered: January 2013
Junior Member
Merci!

I missed that from Vikash P posted in the knowledge base and I will give it a try.

Frankly I was off on a tangent to all of this checking out JTA and its implementation in various Java EE servers. Tomcat as used with Stardust is not a Java EE server just a servlet container and user transactions as encountered can't be configured in server.xml as far as I know given information read.

Further Stardust appears to use jencks for JTA and not geronimo, it is using jencks. Yet for user transactions tomcat relies on geronimo. (For reference checked out http://arjan-tijms.omnifaces.org/2014/05/implementation-components-used-by.html).

In addition did unearth a possible bug with geronimo - see https://issues.apache.org/jira/browse/GERONIMO-6543.. See attached pic.

The only conclusion I could draw from these novice inquiries is that JTA seems to be less standard across Java EE servers than JPA and hence to be avoided if possible by using more REST webservices for integration than multi-db transactions ?! Lets hope that a container db might solve this issue or whatever but I won't.

Gudrun

[Updated on: Mon, 18 May 2015 14:08]

Report message to a moderator

Previous Topic:Calculate Criticality based on user input
Next Topic:Deployment Problem - Urgent help!
Goto Forum:
  


Current Time: Fri Nov 16 03:53:41 GMT 2018

Powered by FUDForum. Page generated in 0.02227 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top