-
1. Re: Where to set ROLLBACK_ON_FAULT ("org.switchyard.rollbackOnFault")?
igarashitm May 20, 2016 9:21 AM (in response to j_ri)That's weird. for JCA/JMS service binding if OperationSelector throws Exception then transaction should be rolled back here
switchyard/EndpointProxy.java at master · jboss-switchyard/switchyard · GitHub
switchyard/EndpointProxy.java at master · jboss-switchyard/switchyard · GitHub
Can you attach a minimal reproducer project here?
-
2. Re: Where to set ROLLBACK_ON_FAULT ("org.switchyard.rollbackOnFault")?
j_ri May 23, 2016 5:46 AM (in response to igarashitm)Thanks for the link to the relevant lines of code.
I haven't created a small reprocuder yet, but I started debugging with my real project.
Unfortunately line 320 is never reached, because in line 319 the variable "commit" is true, although I have created a NullPOinterExcpetion in my custom Operation Selector....
This is the Stacktrace:
RK3983nodeESB1 | 2016-05-23 11:37:13.126 | ERROR | org.apache.activemq.ActiveMQSession | default-threads - 13 | error dispatching message: : java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy120.onMessage(Unknown Source)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1038)
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:215)
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_71]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_71]
at org.switchyard.component.jca.EndpointProxy.delivery(EndpointProxy.java:194) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
at org.switchyard.component.jca.EndpointProxy.invoke(EndpointProxy.java:159) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 12 more
Caused by: org.switchyard.SwitchYardException: java.lang.NullPointerException
at org.switchyard.component.jca.endpoint.JMSEndpoint.onMessage(JMSEndpoint.java:211) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 18 more
Caused by: java.lang.NullPointerException
at org.switchyard.component.jca.endpoint.JMSEndpoint.onMessage(JMSEndpoint.java:172) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 18 more
| org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1041)
org.switchyard.component.jca.endpoint.JMSEndpoint
throws a SwitchyardExpeption, that wraps the NullPOinterExcpetion from line 172
final String operation = _selector != null ? _selector.selectOperation(bindingData).getLocalPart() : null;
where .getLocalPart() cuases the NullPointer.
But why is a UndeclaredThrowableException in the stacktrace?
We have our switchyard application deploeyed within an EAR, but "jboss-deployment-structure.xml" contains <module name="org.switchyard.api" export="true" />
I'll try to post a reproducer later today
-
3. Re: Where to set ROLLBACK_ON_FAULT ("org.switchyard.rollbackOnFault")?
j_ri May 23, 2016 10:42 AM (in response to igarashitm)Hi,
here's my reproducer.
I just took the "jca-inflow-activemq" quickstart and replaced the XPath operation selector with a Java operation selector that returns null (which happend in our real code because logic didn't find a result).
Do you think this is a bug?
I think I'll open a support case....
-
4. Re: Where to set ROLLBACK_ON_FAULT ("org.switchyard.rollbackOnFault")?
j_ri May 24, 2016 3:00 AM (in response to j_ri)I just recognized that the reproducer can even be simpler.
the original "jca-inflow-activemq" quickstart shows the same behaviour if you use an XPATH expression that has no match....
RK3983nodeESB1 | 2016-05-24 08:57:04.160 | ERROR | org.apache.activemq.ActiveMQSession | default-threads - 7 | error dispatching message: : java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy57.onMessage(Unknown Source)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123) [activemq-ra-5.11.0.redhat-621107.jar:5.11.0.redhat-621107]
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64) [activemq-ra-5.11.0.redhat-621107.jar:5.11.0.redhat-621107]
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1038) [activemq-client-5.11.0.redhat-621107.jar:5.11.0.redhat-621107]
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169) [activemq-ra-5.11.0.redhat-621107.jar:5.11.0.redhat-621107]
at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:215) [ironjacamar-core-impl-1.0.36.Final-redhat-1.jar:1.0.36.Final-redhat-1]
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_71]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_71]
at org.switchyard.component.jca.EndpointProxy.delivery(EndpointProxy.java:194) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
at org.switchyard.component.jca.EndpointProxy.invoke(EndpointProxy.java:159) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 12 more
Caused by: org.switchyard.SwitchYardException: java.lang.Exception: SWITCHYARD034503: No node has been matched with the XPath expression '//*[local-name()='personXXX' and namespace-uri()='urn:switchyard-quickstart:jca-inflow-activemq:0.1.0']/language' in the payload. It couldn't determine the operation.
at org.switchyard.component.jca.endpoint.JMSEndpoint.onMessage(JMSEndpoint.java:211) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 18 more
Caused by: java.lang.Exception: SWITCHYARD034503: No node has been matched with the XPath expression '//*[local-name()='personXXX' and namespace-uri()='urn:switchyard-quickstart:jca-inflow-activemq:0.1.0']/language' in the payload. It couldn't determine the operation.
at org.switchyard.component.common.selector.BaseOperationSelector.xpathMatch(BaseOperationSelector.java:121) [switchyard-component-common-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
at org.switchyard.component.common.selector.BaseOperationSelector.selectOperation(BaseOperationSelector.java:66) [switchyard-component-common-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
at org.switchyard.component.jca.endpoint.JMSEndpoint.onMessage(JMSEndpoint.java:172) [switchyard-component-jca-2.0.1.redhat-621107.jar:2.0.1.redhat-621107]
... 18 more
-
5. Re: Where to set ROLLBACK_ON_FAULT ("org.switchyard.rollbackOnFault")?
igarashitm May 26, 2016 8:45 AM (in response to j_ri)Thank you for reporting this one. It was a bug in JCA EndpointProxy. Submitted a pull request.