Bug 1152891 - Switchyard XPath operation selector works differently on JBossFuse and EAP because of different XPath imlementations
Summary: Switchyard XPath operation selector works differently on JBossFuse and EAP be...
Keywords:
Status: MODIFIED
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: tcunning
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-15 07:15 UTC by Martin Basovník
Modified: 2016-12-01 00:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SWITCHYARD-2402 0 Major Resolved Switchyard XPath operation selector works differently on JBossFuse and EAP because of different XPath imlementations 2016-04-25 11:32:51 UTC

Description Martin Basovník 2014-10-15 07:15:57 UTC
=== Description of problem:
According to the XPath specification, we have to use XPath with prefixes to search elements with namespaces.

Example:
The XPath expression //person/name should NOT match any element in the following example but in some XPath implementations it does.

<person xmlns="xxx">
   <name>Martin</name>
</person>

JBoss EAP (6.3.0.GA)
XPathFactory.newInstance() =>_redirected._XPathFactory
But internally is used default JDK XPathFactory implementation => org.apache.xpath.jaxp.XPathFactoryImpl.
This implementation does NOT work properly.

JBoss Fuse (jboss-fuse-6.1.0.redhat-379)
XPathFactory.newInstance() =>net.sf.saxon.xpath.XPathFactoryImpl
This implementation does works properly.

Switchyard XPath operation selector works differently on both containers.

https://github.com/jboss-switchyard/components/blob/2.0.0.Alpha3/common/common/src/main/java/org/switchyard/component/common/selector/BaseOperationSelector.java

Some quickstarts are affected e.g. jca-inflow-activemq
https://github.com/jboss-switchyard/quickstarts/blob/2.0.0.Alpha3/jca-inflow-activemq/src/main/resources/META-INF/switchyard.xml#L22
https://github.com/jboss-switchyard/quickstarts/blob/2.0.0.Alpha3/jca-inflow-activemq/src/test/java/org/switchyard/quickstarts/jca/inflow/JCAInflowBindingTest.java#L124


=== Version-Release number of selected component (if applicable):
FSW 6.1 DR2

=== How reproducible:
100%


=== Actual results:
SWITCHYARD034503: No node has been matched with the XPath expression '//person/language' in the payload. It couldn't determine the operation.
        at org.switchyard.component.common.selector.BaseOperationSelector.xpathMatch(BaseOperationSelector.java:121)[349:org.switchyard.components.switchyard-component-common:2.0.0.Alpha2-redhat-1]
        at org.switchyard.component.common.selector.BaseOperationSelector.selectOperation(BaseOperationSelector.java:66)[349:org.switchyard.components.switchyard-component-common:2.0.0.Alpha2-redhat-1]
        at org.switchyard.component.http.InboundHandler.getOperationName(InboundHandler.java:150)[353:org.switchyard.components.switchyard-component-http:2.0.0.Alpha2-redhat-1]
        at org.switchyard.component.http.InboundHandler.invoke(InboundHandler.java:107)[353:org.switchyard.components.switchyard-component-http:2.0.0.Alpha2-redhat-1]
        at org.switchyard.component.http.HttpGatewayServlet.handle(HttpGatewayServlet.java:159)[353:org.switchyard.components.switchyard-component-http:2.0.0.Alpha2-redhat-1]
        at org.switchyard.component.http.HttpGatewayServlet.service(HttpGatewayServlet.java:124)[353:org.switchyard.components.switchyard-component-http:2.0.0.Alpha2-redhat-1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)[91:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]

Comment 1 Rob Cernich 2014-10-15 13:22:55 UTC
Need to determine whether or not this behavior changed from EAP 6.1 to 6.3.

Comment 2 Martin Basovník 2014-10-15 14:43:21 UTC
The behavior did not change from EAP 6.1 to 6.3.

Comment 3 Gomathi Anandan 2014-10-24 18:59:43 UTC
Resetting the flags back to the state it was before Oct-24- 2PM. There was an incorrect bulk update that I'm trying to fix.

Comment 4 tcunning 2015-03-06 03:40:59 UTC
If the Apache XPath implementation doesn't follow the spec, shouldn't we be filing issues against them?

Comment 5 tcunning 2015-06-15 20:42:10 UTC
Should be in first 6.2.1 build.


Note You need to log in before you can comment on or make changes to this bug.