Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

We have a java code that split the XML file into multiple files. The same code works as expected whe

user8673275May 8 2015 — edited May 8 2015

Hi All,

We have a java code that split the XML file into multiple files. The same code works as expected when we call it from eclipse & also from unix machine. But when we call the same code from BPEL using Java Embedding it reads the content from file but it fails to find the node. It shows node length as 0. Please find below the java code:

    <bpelx:exec import="java.io.*"/>

    <bpelx:exec import="javax.xml.parsers.DocumentBuilderFactory"/>

    <bpelx:exec import="javax.xml.xpath.XPath"/>

    <bpelx:exec import="javax.xml.xpath.XPathConstants"/>

    <bpelx:exec import="javax.xml.xpath.XPathFactory"/>

    <bpelx:exec import="org.w3c.dom.Document"/>

    <bpelx:exec import="org.w3c.dom.NodeList"/>

try {

  File input = new File(FilePath+FileName);

  DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

  Document doc = dbf.newDocumentBuilder().parse(input);

  XPath xpath = XPathFactory.newInstance().newXPath();

  NodeList nodes = (NodeList) xpath

  .evaluate("//ItemMaintenance/Batch/Item", doc,

  XPathConstants.NODESET);

  System.out.println("Node Length " + nodes.getLength());

  } catch (Exception e) {

  e.printStackTrace();

  }

Could you please let me know what would be the problem? we suspect the jar containing org.w3c.dom.Document and org.w3c.dom.NodeList classes used while running the java code from unix prompt (Server environment variables) and while running the BPEL code are different (SOA server classpath) are different. Could it be the case? If so how can i overcome this? please help...

Java Version: 1.6

SOA Version: 11.1.1.5.0 (PS4)

Thanks in Advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2015
Added on May 8 2015
0 comments
779 views