Xpath & J2ee

Hello,
i have a problem, when i'm trying to parse XML file using XPath expressions i nedd to define a new Class that implements a NameSpaceContext, like this
public class TesteNameSpace implements NamespaceContext {
and then code it like this
public String getNamespaceURI(String prefix) {
     if(prefix.compareToIgnoreCase("rdf") == 0)
          return "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
     else if(prefix.compareToIgnoreCase("prf") == 0)
          return "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#";
     else if(prefix.compareToIgnoreCase("mms") == 0)
          return "http://www.wapforum.org/profiles/MMS/ccppschema-20010111#";
     return null;
     }Then i use it like this
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.setNamespaceContext(new TesteNameSpace());the problem is that sometime XML files define the same prefix but with a different NameSpace, and my application stops working.
Is there any way a can make a generic code, that i don't need to say what's the namespace ?
Thank you

    private void queryDocument(String fileName, String expr)
        throws XPathFactoryConfigurationException, SAXException {
        try {
            XPathFactory factory = XPathFactory.newInstance();
            XPath xpath = factory.newXPath();
            Document xmlDoc;
            try {
                xmlDoc = getXMLDocument(fileName);
                MyNamespaceContext ctx = new MyNamespaceContext( xmlDoc );
                xpath.setNamespaceContext( ctx );
                NodeList nodes = (NodeList)xpath.evaluate(expr, xmlDoc, XPathConstants.NODESET);
                for(int i = 0; i < nodes.getLength(); i++) {
                    Node n = nodes.item ( i );
                    System.out.println( n.getLocalName() + " = " + n.getTextContent());
            } catch (IOException ex) {
                ex.printStackTrace();
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
        } catch (XPathExpressionException ex) {
            ex.printStackTrace();
    }The previous code use one context configured to access the Namespaces (prefix and URI in a trasnparent fashion). Here is the NamespaceContext.
final class MyNamespaceContext implements NamespaceContext {
        private HashMap namespaces = new HashMap();
        Document xmlDoc;
        public MyNamespaceContext(Document xmlDoc) {
            this.xmlDoc = xmlDoc;
        public java.util.Iterator getPrefixes(String namespaceURI) {
            return( null );
        public String getPrefix(String namespaceURI) {
            return( xmlDoc.lookupPrefix( namespaceURI )  );
        public String getNamespaceURI(String prefix) {
            return( xmlDoc.lookupNamespaceURI( prefix ));
        public void setNamespace(String prefix, String uri) {
            namespaces.put( prefix, uri );
}Also the small code to load the XML Document requiered in previous queryDocument
private Document getXMLDocument(final String fileName) throws SAXException, ParserConfigurationException, IOException {
DocumentBuilderFactory docBuilderFac = DocumentBuilderFactory.newInstance();
docBuilderFac.setNamespaceAware(true);
DocumentBuilder docBuilder = docBuilderFac.newDocumentBuilder();
Document xmlDoc = docBuilder.parse( new File(fileName) );
return xmlDoc;
I hope that this can help you.
For more information contact me at
Ing. Ilver Anache Pupo
[email protected]
Universidad Peruana de Ciencias Aplicadas (UPC), Per�

Similar Messages

  • Error(64) : invalid xpath in JDeveloper 10.1.3.1 Developer

    Hi,
    I am migrating the BPEL Project which was desinged for the BPEL(10.1.2) to SOA Suite using the JDeveloper 10.1.3.1 Developer Preview version.
    The taken the project which is buildin and deploying correctly in the BPEL Desg&ser (10.1.2).
    But the same project is not compiling in the newer preview version.i got invalid xpath exception.
    my xpath is like
    bpws:getVariableData('inputVariable','payload','/client:commonProjectProcessRequest/client:input/ns1:listOfProducts')
    if i change like this xpath, woking fine...
    bpws:getVariableData('inputVariable','payload','/client:commonProjectProcessRequest/client:input')
    the element defined as string in wsdl.however am expecting in runtime process will recive an xml string as a value input element so the xpath will work fine..
    is the any facility turn of xpath validation while building bpel project in the jdev10.1.3.1. preview version.
    could you please any one give me solution ?
    Thanks
    bogi

    yes, i found an URL and I try to access this via browser, and the following message appears:
    Error instantiating web-application
    Error compiling :C:\My Documents\Java\Webservice\Service3\public_html: Syntax error in source or compilation failed in: E:\master\Oracle JDeveloper 10.1.3 Early Access\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Webservice-Service3-webapp\galih\service\runtime\MyWebService1SoapHttp_Tie.java E:\master\Oracle JDeveloper 10.1.3 Early Access\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Webservice-Service3-webapp\galih\service\runtime\GalihServiceService_SerializerRegistry.java:36: error #300: MyWebService1_getMessage_ResponseStruct__LiteralSerializer not found in class galih.service.runtime.GalihServiceService_SerializerRegistry
    CombinedSerializer serializer = new galih.service.runtime.MyWebService1_getMessage_ResponseStruct__LiteralSerializer(type, DONT_ENCODE_TYPE);
    ^
    1 error

  • B2B Document Definition - Using xpath 'or' in Identification Value

    Hello,
    I have a requirement similar to the one below, this is an example from the Oracle documentation,
    In the below example, Oracle B2B compares the value of the country attribute to the value set for Identification Value. If the values match, then the document is identified successfully.  I have a scenario, where I will receive data with value in the country attribute to be "US" or "France" or "India". Can an 'or' be used in the identification value? such as US or France or India as the Identification values for the Identification Expression "//*/@country".
    Any ideas / suggestions are greatly appreciated.
    Option 3: Check the Value of an Attribute
    Assume that the value of the country attribute is US. Set the parameters as follows:
    Field
    Value
    Identification Value
    US
    Identification Expression
    //*/@country
    Here is the excerpt of the XML payload for this option.
    Check the Value of an Attribute
    <?xml version="1.0" encoding="windows-1252" ?>
    <MyAddress country="US" xmlns="http://www.example.org"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="PO.xsd">
      <name>B2B Buyer</name>
      <street>100 Oracle Parkway</street>
      <city>Redwood City</city>
      <state>CA</state>
      <zip>94065</zip>
    </MyAddress>
    Thanks,
    Venkatesh

    Hi,
    I am interested to know if you managed to make any progress on this issue?
    We have a similar requirement whereby a trading partner sends an ebMS request using a single document type with the ebMS ACTION header identifying the action the request relates to. For example, the following are the key fields from two requests:
    1)
      SENDER_NAME = TradingPartnerX
      RECEIVER_NAME = OurCompanyName
      SERVICE_NAME = Manage Work
      SERVICE_TYPE = v1.0
      BUSINESS_ACTION_NAME = assignWork
      Payload = <ManageWorkRequest>...</ManageWorkRequest>
    2)
      SENDER_NAME = TradingPartnerX
      RECEIVER_NAME = OurCompanyName
      SERVICE_NAME = Manage Work
      SERVICE_TYPE = v1.0
      BUSINESS_ACTION_NAME = updateWork
      Payload = <ManageWorkRequest>...</ManageWorkRequest>
    Where the Payloads of the two requests could potentially be identical.
    Currently, we have the following configuration:
    - Custom xml document type for ManageWorkRequest:
      - Action name: (blank)
      - Service name: (blank)
      - Service type: (blank)
      - From Role: (blank)
      - To Role: (blank)
      - Validate ebMS Header: unchecked
    - Custom xml document definition for ManageWorkRequest:
      - XML Identification Expression (XPath): //*[local-name() = 'ManageWorkRequest']
      - XML Identification Value: (blank)
    - TradingPartnerX Documents:
      - Definition added for ManageWorkRequest
        - both 'Sender' and 'Receiver' checked
      - Document Details:
        - Override DocType Param: checked
        - Document Type ebMS:
          - Action name: (blank)
          - Service name: Manage Work
          - Service type: v1.0
          - From Role: Buyer
          - To Role: Supplier
          - Validate ebMS Header: unchecked
    - Agreement setup between OurCompanyName and TradingPartnerX for inbound communication from TradingPartnerX to OurCompanyName
    When TradingPartnerX attempts to send an assignWork ManageWorkRequest, B2B fails to identify which document type and agreement it relates to. After increasing the B2B logging level, the following can be seen in the soa_server1-diagnostic.log file:
    [2013-11-19T11:16:39.881+10:00] [soa_server1] [TRACE] [] [oracle.soa.b2b.repository] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\n] [userId: <anonymous>] [ecid: ccce6c0f16adb222:111ddc50:142539e3958:-7ffd-000000000013a96f,0] [APP: soa-infra] [SRC_CLASS: oracle.tip.b2b.log.ToplinkLogger] [SRC_METHOD: log] 2013.11.19 11:16:39.880--ServerSession(606155273)--Connection(692532584)--Thread(Thread[Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms[[
    ,10,Application Daemon Threads])--SELECT ID, DIRECTION, APPS_DOCTYPE_NAME, DOC_DEF_NAME, APPS_DOC_PROTOCOL_VERSION, DOC_DEF_TIMESTAMP, APPS_DOCUMENT, DOC_PROTOCOL_NAME, APPS_XSLTFILE, DOC_PROTOCOL_VERSION, ATTRIBUTE1, DOC_REF_NAME, ATTRIBUTE3, DOC_ROUTING_ID, ATTRIBUTE5, DOCTYPE_NAME, ATTRIBUTE7, FROM_DC, ATTRIBUTE9, BUSINESS_ACTION_NAME, LABEL, CREATED, LABEL_DESC, APPS_DOC_PROTOCOL_NAME, MODIFIED, APPS_ACTION, RECEIVER_NAME, ATTRIBUTE2, SENDER_NAME, ATTRIBUTE6, SERVICE_NAME, ATTRIBUTE10, SERVICE_TYPE, DEFINITION_MO, STATE, AGREEMENT_ID, TO_DC, ATTRIBUTE8, TPA_NAME, IS_CUSTOM, TPA_REFERENCE, ATTRIBUTE4, CREATED_BY_UI, USER_NAME, CONTROL_NUMBER_SET FROM B2B_LIFECYCLE WHERE ((SENDER_NAME = ?) AND ((RECEIVER_NAME = ?) AND ((BUSINESS_ACTION_NAME = ?) AND ((SERVICE_NAME = ?) AND ((SERVICE_TYPE = ?) AND ((DIRECTION = ?) AND (STATE = ?)))))))
            bind => [TradingPartnerX, OurCompanyName, assignWork, Manage Work, v1.0, INBOUND, Active]
    [2013-11-19T11:16:39.883+10:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\n] [userId: <anonymous>] [ecid: ccce6c0f16adb222:111ddc50:142539e3958:-7ffd-000000000013a96f,0] [APP: soa-infra] Error -:  B2B-50547:  Agreement not found for trading partners: FromTP TradingPartnerX, ToTP OurCompanyName with document type ACTION:assignWork Service:Manage Work ServiceTypev1.0-INBOUND.[[
            at oracle.tip.b2b.tpa.RepoDataAccessor.queryAgreementMO(RepoDataAccessor.java:866)
            at oracle.tip.b2b.tpa.RepoDataAccessor.getAgreementDetails(RepoDataAccessor.java:415)
            at oracle.tip.b2b.tpa.TPAProcessor.processTPA(TPAProcessor.java:465)
            at oracle.tip.b2b.tpa.TPAProcessor.processIncomingTPA(TPAProcessor.java:243)
            at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2560)
            at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1751)
            at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4258)
            at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3856)
            at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3309)
            at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:637)
            at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
            at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
            at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
            at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Error -:  B2B-50547:  Agreement not found for trading partners: FromTP TradingPartnerX, ToTP OurCompanyName with document type ACTION:assignWork Service:Manage Work ServiceTypev1.0-INBOUND.
            at oracle.tip.b2b.tpa.RepoDataAccessor.queryAgreementMO(RepoDataAccessor.java:866)
            at oracle.tip.b2b.tpa.RepoDataAccessor.getAgreementDetails(RepoDataAccessor.java:415)
            at oracle.tip.b2b.tpa.TPAProcessor.processTPA(TPAProcessor.java:465)
            at oracle.tip.b2b.tpa.TPAProcessor.processIncomingTPA(TPAProcessor.java:243)
            at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2560)
            at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1751)
            at oracle.tip.b2b.engine.Engine.incomingContinueProcess(Engine.java:4258)
            at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3856)
            at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:3309)
            at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:637)
            at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
            at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
            at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
            at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Looking at the SQL which has been logged, B2B is looking for an agreement which has the following:
      SENDER_NAME = 'TradingPartnerX'
      RECEIVER_NAME = 'OurCompanyName'
      BUSINESS_ACTION_NAME = 'assignWork'
      SERVICE_NAME = 'Manage Work'
      SERVICE_TYPE = 'v1.0'
      DIRECTION = 'INBOUND'
      STATE = 'Active'
    and it fails to identify any matching agreements which is correct - there aren't any matching these constraints. However, if we specify the 'Action name' field in the DocType param overrides for TradingPartnerX, then B2B is able to identify the agreement and everything works.
    Based on this behaviour, it seems that in this scenario, B2B requires a separate agreement for each possible value which can be passed as the BUSINESS_ACTION_NAME in order to identify the document type and agreement correctly. My question is - is there another way to configure B2B to allow a list of valid 'Action names' rather than having to create a separate agreement for each one with the only difference being the value of the 'Action name' field?
    If anyone is able to provide advice or guidance, it would be much appreciated.
    Thanks
    Kevin

  • Custom XPath Function not working - ORABPEL-09503 error

    I wrote a simple date conversion custom xpath function.
    1. Implemented IXPathFunction as mentioned in Clemens and Antony Reynolds blog.
    2. Also changed the xpath-functions.xml kept at C:\product\10.1.3.1\OracleAS_1\bpel\system\config\xpath-functions.xml and also at C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\config\xpath-functions.xml (Not sure why this xml is in two places)
    3. Placed my class file at C:\product\10.1.3.1\OracleAS_1\bpel\system\classes and also made a jar and placed in C:\product\10.1.3.1\OracleAS_1\j2ee\home\applib.
    But when I run the process which uses this custom function, it is throwing the following error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>ORABPEL-09503 Invalid xpath expression. Error while parsing xpath expression "o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');", the reason is Error in expression: 'o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');'.. Please verify the xpath query "o2c:formatDateString('10/30/2007', 'MM/DD/yyyy', 'YYYY-MM-DD');" which is defined in BPEL process. </faultstring>
    </Fault>
    Can somebody help me to resolve this.

    My bad. I had a semi-colon after the expression. Now I am getting a different error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>ORABPEL-09500 XPath expression failed to execute. Error while processing xpath expression, the expression is "o2c:formatDateString('10/30/2007', 'MM/DD/YYYY', 'YYYY-MM-DD')", the reason is FOTY0001: type error. Please verify the xpath query. </faultstring>
    </Fault>

  • XPath Error

    Hi folks,
    I am making a BPEL process in which I am assigning values from a temp variable to a variable named BEData. Then I am running a parallel flow each containing an adaptor service calling an API from database. Time & again I am encountering the following error:-
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the exception is: XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:processXSLT('XformDPPToPricingHeader.xsl',bpws:getVariableData('BEData'))", the reason is FOTY0001: type error.
    Please verify the xpath query.
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:171)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    <2007-10-05 15:21:56,352> <DEBUG> <default.collaxa.cube.engine.dispatch> <BaseDispatchSet::acknowledge> Acknowledged message 580cde55d471cff3:-3a604526:1156f737287:-7f98 (5)
    <2007-10-05 15:22:00,437> <DEBUG> <default.collaxa.cube.engine.data> <ConnectionFactory::getConnection> GOT CONNECTION 3 Autocommit = false
    <2007-10-05 15:22:00,447> <ERROR> <default.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "finder": Instance not found in datasource.
    The process domain was unable to fetch the instance with key "580cde55d471cff3:-3a604526:1156f737287:-7f9b" from the datasource.
    Please check that the instance key "580cde55d471cff3:-3a604526:1156f737287:-7f9b" refers to a valid instance that has been started and not removed from the process domain.
    Its saying its FOTY0001 type error , what I access from this is that it is not able to process BEData variable. Using Java Embedding checkpoint I am able to find that it is assigning value from temp var to BEData var correctly. Any idea about solving the issue would be very helpful.
    Regards
    Varun

    For some reason JDevloper leaves the third argument to ora:processXSLT out. I have found this to happen when you change from design mode to source mode.
    The statement should have been
    ora:processXSLT('XformDPPToPricingHeader.xsl',bpws:getVariableData('BEData','payload'))
    or something like that.
    Deleting the Transformation and adding it again will fix it, but it will eventually happen again so watch out.

  • Problems with Sun One Web Server 6.1 javax.xml.xpath package not found

    I used myeclipse to build an xml app and tested on jboss. it worked perfectly. However when i deployed it to our solaris sun one web server the app fell apart completely with the following error. I m unable to figure out what went wrong. Any help will be much appreciated.
    Thanks.
    [11/Dec/2007:22:12:37] failure (13539):      for host 121.247.233.169 trying to GET /feeds/rss.jsp, service-j2ee reports: StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
         org.apache.jasper.JasperException: WEB4000: Unable to compile class for JSP
         /opt/SUNWwbsvr/test/ClassCache/test/_jsps/_feeds/_rss_jsp.java:8: package javax.xml.xpath does not exist
         import javax.xml.xpath.*;
         ^

    Thanks for the response. I tried to use xalan package which resolved the javax.xml.xpath package not found error (xalan.jar in WEB-INF/lib folder). However I m now getting the following error. Probably incompatible version is the reason. Please advise!
    [11/Dec/2007:23:46:28] failure (17028):      for host 121.247.233.169 trying to GET /feeds/rss.jsp, service-j2ee reports: StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
         javax.servlet.ServletException: org.apache.xpath.XPathContext.<init>(Z)V
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
         at _jsps._feeds._rss_jsp._jspService(_rss_new_jsp.java:627)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
         ----- Root Cause -----
         java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
         at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
         at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
         at _jsps._feeds._rss_new_jsp._jspService(_rss_jsp.java:165)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)

  • Can't figure out the correct xPath for this...

    Hi,
    I'm using Oracle Service Bus and got into a problem with xPath.
    I need to get two parameters - userId and password - from this XML.
    * All I managed to do is get them with _$body//*:userId/text()_ but then I get a string that contacs both occurrences of this parameter on this XML and I only need one!
    * I also tried getting the exact path using _$body/Butterfly/errorData/UserData/userId/text()_ but got nothing. When trying to add the NS (like bas:userId) It's doesn't comply with validation.
    Here's my XML. I would really appreciate your help here!
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <Butterfly xmlns="http://xml.netbeans.org/schema/Butterfly" xmlns:msgns="http: //j2ee.netbeans.org/wsdl/EquipmentController" xmlns:ns1="http://xml.netbeans.org /schema/Butterfly" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <errorData xmlns="">
    <equ:UserData xmlns:equ="http://xml.netbeans.org/schema/EquipmentSchema" x="" mlns:swap="http://xml.netbeans.org/NewDetails" xmlns:bas="http://xml.netbeans.org /schema/BaseSchema">
    <bas: password >1</bas:password>
    <bas: userId >1</bas:userId>
    <bas:FirstIssue>1</bas:FirstIssue>
    </equ:UserData>
    <operation>CloseArgs</operation>
    <service>FinishProcess_Proxy</service>
    <project>MajorProcess</project>
    <request_data_xml>
    <equ:NewDetailsParams xmlns:equ="http://xml.netbeans.org/schema/Equipment Schema">
    <equ:UserData>
    <bas: password xmlns:swap="http://xml.netbeans.org/NewDetails" xmlns:b="" as="http://xml.netbeans.org/schema/BaseSchema">1</bas:password>
    <bas:FirstIssue xmlns:swap="http://xml.netbeans.org/NewDetails" xm="" lns:bas="http://xml.netbeans.org/schema/BaseSchema">1</bas:FirstIssue>
    <bas: userId xmlns:swap="http://xml.netbeans.org/NewDetails" xmlns:bas="http://xml.netbeans.org/schema/BaseSchema">1</bas:userId>
    </equ:UserData>
    <equ:NewDetailsSetDT>
    <equ:Data>
    <swap:Code xmlns:swap="http://xml.netbeans.org/NewDetails">110</swap:Code>
         <swap:Reason xmlns:swap="http://xml.netbeans.org/NewDetails">60</swap:Reason>
    </equ:Data>
    </equ:NewDetailsSetDT>
    <equ:Off>1</equ:Off>
    </equ:NewDetailsParams>
    </request_data_xml>
    </errorData>
    </Butterfly>
    </soapenv:Body>
    Edited by: kobyssh on 03:28 04/02/2010

    Hi gentleman,
    you need the text of userid and username,I think you need add the namespace which contains tow parts:one is the wsdl defination namespace and the other is
    the namespace which you defination just as bas:http://xml.netbeans.org /schema/BaseSchema.
    by the way you can use the OSB XQuery expression which don't need to write the xpath,you can drag it from variable structrue.
    Rgds,
    Jacky(Yang Yi.)

  • Alternative deployment option for custom xpath- 10.1.2

    Hi,
    BPEL ver: 10.1.2
    What is the best way to deploy custom xpath classes?
    Here is the list of location that I know that it works
    1. Copy extracted classes files in %BPEL_HOME%/integration/orabpel/system/classes with package hierarchy
    2. Copy jar file in %BPEL_HOME%/integration/jdev/j2ee/home/applib
    Somone said in the forum, approach 2 does not work any more in 10.1.3. But our sysadmin team does not like the approach 1 at all because it is in system area.
    Is there an alternative to these deployment that can also work in 10.1.2?
    Thanks for your help,
    ibyon

    The demo is not available through OTN. It ships with jheadstart 10.1.2.2 which is only available for licensed Jheadstart users.
    Please visit the FAQ on our Jheadstart Product Center for information on how to obtain a Jheadstart license:
    http://www.oracle.com/technology/consulting/9iservices/jheadstart.html
    Steven Davelaar,
    JHeadstart Team.

  • Good Java XPath Resources / Tutorials

    Anyone have any good resources / tutorials for XPath in Java? I've been playing with XML in java for the past two days and have found it Math.pow(convoluted, 100). What I'm basically looking for is the equivalent of this C#:
    using System;
    using System.Xml;
    using System.Xml.Xsl;
    class Test {
       static void Main( string[] argv ) {
          XmlDocument xml = new XmlDocument();
          xml.Load(@"c:\database_mapping.xml");
          foreach( Node n in xml.SelectSingleNode("/database[@name='TEST']/table[@name='VEHICLES']").ChildNodes ) {
             // process each node
    {code}I've played around with the javax.xml.xpath package and have found it to be all but useless.  The *best* I've been able to do is find the value of a given node with a compiled XPath expression.  I need it to actually retrieve the Node object from an XML Document (be it from an org.w3c.Document or one of the billions of other possibilities that seem to be available).
    Along those same lines, I have discovered that there are dozens of XML packages in java.  Is this a mix-and-match kinda thing?  Is there one standard package?  I've not found a useful Java XML tutorial, either.  I've tried googling, assuming that Sun would have a nice Java XML tutorial, but googling "java xml tutorial" returns this result:
    Java XML Tutorial
    "This is Sun's tutorial, Working with XML - The Java API for XML Parsing (JAXP). Provides a manual designed to quickly write XML code and XML-based software ..."
    When following the link, you get to: http://java.sun.com/webservices/
    which is certainly not a Sun Tutorial.
    I'm sure that this has got to be more simple than it's being made out to be.  Certainly Microsoft was not capable of creating an infinitely better and more efficient method for parsing XML... someone, please tell me I'm wrong.  Please. :-)
    Thanks for your help!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    DrClap wrote:
    Sun (in its infinite wisdom) decided it would be a good idea if you could plug in your own preferred parser and serializer and transformer, so they designed JAXP as a pluggable architecture. Microsoft (as usual) didn't mess with any of that, they just buried those things in their infrastructure. So you don't have any of those annoying choices to make with Microsoft.
    Actually you don't have to make any annoying choices with JAXP, either. You just ignore the whole pluggability thing and use the components that are already included in Java.
    And yeah, there used to be decent Java XML tutorials out there, but lately they have disappeared and been replaced by less focused tutorials, as you found. The second link that Google gives me is this one: [Java API for XML Processing|http://72.5.124.55/j2ee/1.4/docs/tutorial-update6/doc/JAXPIntro.html] -- although it seems to be abandoned, Google still knows the IP address of the server.
    Thanks for the clarification and for the tutorial. I saw the link but passed over it as it didn't provide a domain ... didn't know that it actually belonged to Sun.
    The tutorial is good; I was able to skim through it and all seems pretty straight forward. It does appear, though, that what I want to do isn't possible in java. (The only example it gave of "searching for a node" was a custom implementation of traversing every single node* in the DOM hierarchy.
    ... this is discouraging ...
    Thanks again, though, for your help. It was much appreciated.

  • Would using -Xxmn option speed up an xpath/DOM application

    A developer mentioned in another thread
    "You can increase the default maximum heap size. Different OSes and JVM/versions have an upper limit for this.
    For the Sun JVM the command line option is doc'd in the docs. It is "-Xmxn" where n is replaced with something like "80m". The default size is 64m (meg) for 1.3 ."
    My question is would using the -Xxmn speed up a java application using xpath and DOM or no?

    This may speed it up if the amount of time spent garbage collecting is getting too high. As you raise the size of a heap it has to garbage collect less often given a fixed rate of allocations per unit time. Unfortunately, the time it takes to GC also rises a bit with a large heap, so your mileage may vary.
    Take a look at the rate at which you are GC'ing. use -verbose:gc to do that.
    Also, raising -XmsNNm (NN is number of megs) to raise the initial heap size can also help improve startup speed. This should be either the like amount of memory you need or some reasonable fraction of the maximum heap size (perhaps == to the max heap size). This will eliminate extra GC's and time spent to grow the heap as the application runs.
    If you are GC'ing fairly often (every few to 10 seconds) and the GC's take a fair amount of time (consistently greater than .5 to 1 seconds), you might want to further tune the heap. For Sun and Java 1.3.1, I often use something like this to run large programs and J2EE servers (the exact numbers may vary:
    java -server -Xms256m -Xmx512m -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=2
    Take a look at this: http://java.sun.com/docs/hotspot/index.html
    Chuck

  • Crystal Report generate PDF with J2EE problem

    Dear All
    I am having a great problem on generating PDF file by Crystal Report in J2EE.
    I have my J2EE application runs Crystal Report to generate PDF files.
    However for a report, i hit the following error (red color) when the PDF is generating.
    But is no problem for the other reports.
    Here is the code  that i used to generate the PDF
    My OS and Java version as follows
    Window 2003 server.
    Java 1.4.2_04
    Please Kindly Help
    Thanks very much
    public static void export(HttpServletRequest request, HttpServletResponse response, String reportPath, ArrayList paramList, ReportExportFormat outFormat) throws Exception{
         System.gc();
      HttpSession session = request.getSession(false);
      Object reportSource = getReportSource(request, reportPath);
      ReportExportControl exportControl = new ReportExportControl();
      if(paramList != null && paramList.size()>0){
       exportControl.setParameterFields(getParamFields(paramList));
      ExportOptions exportOptions = new ExportOptions();
      exportOptions.setExportFormatType(outFormat);
      PDFExportFormatOptions pdfexpopts = new PDFExportFormatOptions();
      exportOptions.setFormatOptions(pdfexpopts);
      exportControl.setReportSource(reportSource);
      exportControl.setExportOptions(exportOptions);
      exportControl.processHttpRequest(request, response, session.getServletContext(), null);
      exportControl.dispose();
        public static IReportSource getReportSource(HttpServletRequest request, String reportPath) throws Exception{
      ReportClientDocument oReportClientDocument = new ReportClientDocument();
      HttpSession session = request.getSession(false);
      oReportClientDocument.open(reportPath, 0);
      return oReportClientDocument.getReportSource();
    00:57:08,671 ERROR reportdefinition Thread-28 - Report printer was not valid, switching to default printer.
    00:57:08,687 ERROR objectformatter Thread-28 - com.crystaldecisions.reports.dataengine.k: |Y
    00:57:09,343 ERROR b Thread-28 - Disk Exporter: no output file was created by an exporter
    00:57:09,343 ERROR b Thread-28 - PdfExporter: caught Exception in PDFFormatter.finalizeFormatJob (from destination?); java.lang.IllegalArgumentException

    Hi,
    I have tried this code but stil the same.
    However i tried setup another tomcat and application in the other machine and the only job for  the application is exporting the report that has problem, then the error is gone.
    So i guess that is the memory size problem.
    Thanks for this
    One more question about the memory size between Tomcat and Crystal report.
    I have set in catalina.bat as
    set JAVA_OPTS = "-Xms2048M -Xmx1024M"
    and CRConfig as
    <JVMMaxHeap>1024000000</JVMMaxHeap>
    <JVMMinHeap>512000000</JVMMinHeap>
    1. Is that the correct setting.?
    2. The memory in the JAVA_OPT and is the MAX and MIN memory that java would use,
        then is the Max memory in CRConf is 1024M out of the java heap size or the application use another 1024 memory

  • Error while installing J2EE Add- In to the ABAP system

    Error while installing J2EE Add-In to the ABAP system 
    We are installing J2EE Add-In to the ECC5 System in the new hardware.
    When are getting Error while installing J2EE Add-In to the ABAP system.
    Transaction Begin*****************************
    ERROR 2005-08-10 14:58:28
    CJSlibModule::writeLogEntry()
    CJS-20011 J2EE engine configuration error. DIAGNOSIS: Error when
    configuring J2EE Engine. See output of
    logfile /usr/sap/QSS/install/batchconfig.log: 'My Library Path
    is: /usr/j2se/jre/lib/sparcv9/server:/usr/j2se/jre/lib/sparcv9:/usr/j2se/jre/../lib/sparcv9:/tmp/sapinst_exe.13084.1123702275:/usr/lib::/usr/openwin/lib:/usr/sap/QSS/SYS/exe/run:/oracle/QSS/920_64/lib:/oracle/QSS/920_64/lib32:/usr/lib
    ElementInfoTask has finished successfully on dispatcher
    ConsoleLogsTask has finished successfully on dispatcher
    ChangeManagerPropsTask has finished successfully. Manager:
    LockingManager on dispatcher
    ChangeManagerPropsTask has finished successfully. Manager:
    ClusterManager on dispatcher
    ElementInfoTask has finished successfully on server
    ConsoleLogsTask has finished successfully on server
    ChangeManagerPropsTask has finished successfully. Manager:
    LockingManager on server
    ChangeManagerPropsTask has finished successfully. Manager:
    ClusterManager on server
    ChangeServicePropsTask has finished successfully. Service: dbpool on
    server
    ChangePasswordsTask finished successfully.
    Error occured while connecting to database (UploadFile). Msg: No such
    algorithm: DESede
    Transaction end***********************************
    We tried twice clean installation, after removing j2ee dir, SCS and
    resp profiles and droping PSAPQSSDB tablespace and SAPQSSDB user.
    I have also confirmed the passwords in ABAP system/000 for SAPJSF, DDIC, J2EE_ADMIN, J2EE_GUEST.
    We are getting the same error in both tries.
    Kindly advice us to resolve the problem.
    Thanks and Regards,
    Srinivas

    Ananda,
    you saved my day!  I've been banging my head against the wall with this same problem during a J2EE add-in installation for SRM 4.0 on Windows, in preparation of an LAC 2.0 installation.  I had tried deleting the schema first, but that didn't work.  After I removed the sys\global\security folder as well, it worked perfectly.
    Thank you.

  • Getting oracle.j2ee.xml.XMLMessages error while running project in 11g

    when I run a project in JDeveloper 11g for the first time i.,e when it starts the embedded oc4j server, I get "oracle.j2ee.xml.XMLMessages warningException
    WARNING: Exception Encountered" error. I am using TP4. is this a severe error or something we can ignore?
    -Pardha

    hi Pardha
    For questions about JDeveloper 11g you could try this forum:
    "JDeveloper and OC4J 11g Technology Preview"
    JDeveloper and OC4J 11g Technology Preview
    success
    Jan Vervecken

  • Error while deploying ear-file to J2EE via NWDS/SDM

    Hi everybody,
    i have a problem deploying an ear-file. I was looking for similar cases in forums, but didn't find anything. My application is developed by jsp/servlets. The deployment aborts with following error-massage:
    Caught exception during application deployment from SAP J2EE Engine's deploy API:
    com.sap.engine.deploy.manager.DeployManagerException: com.sap.engine.services.deploy.container.DeploymentException: Cannot update archive file Docsndownloads.warcom.sap.engine.services.deploy.ear.exceptions.BaseIOException: Error during replacement of substitution values. Reason: java.io.IOException: Stream closed
    I don't know what the reason could be. The application is running on tomcat. And I can deploy other applications to j2ee with nwds/sdm.
    Maybe somebody had or has the same problem. Or somebody knows the answer for the problem. Please help, points will be regarded. Thanks in advance.
    best regards
    Lu

    Hi,
    I checked the log-files, but there are no helpful informations, but:
    07/04/23 12:08:04 -  Start updating EAR file...
    07/04/23 12:08:04 -  start-up mode is lazy
    07/04/23 12:08:20 -  com.sap.engine.deploy.manager.DeployManagerException: com.sap.engine.services.deploy.container.DeploymentException: Cannot update archive file Docsndownloads.war
                         com.sap.engine.services.deploy.ear.exceptions.BaseIOException: Error during replacement of substitution values. Reason:
                          java.io.IOException: Stream closed
    and
    Apr 23, 2007 12:08:20... Error: Aborted: development component 'Dokusunddownloads'/'sap.com'/'localhost'/'2007.04.23.12.07.47'/'0':
    Caught exception during application deployment from SAP J2EE Engine's deploy API:
    com.sap.engine.deploy.manager.DeployManagerException: com.sap.engine.services.deploy.container.DeploymentException: Cannot update archive file Docsndownloads.war
    com.sap.engine.services.deploy.ear.exceptions.BaseIOException: Error during replacement of substitution values. Reason:
    java.io.IOException: Stream closed
    thanks,
    Lu

  • Error in creating a new user in j2ee 14 admin console

    Hi,
    I am getting the following error while trying to create a new user using the j2ee 1.4 admin console.:
    A "com.sun.enterprise.tools.guiframework.exception.FrameworkError" was caught. The message from the exception: "Unable to get View for ViewDescriptor 'fileUsers'"
    The root cause is "java.lang.ArrayIndexOutOfBoundsException: 0"
    Plz proide me with solutions
    Regads,
    Tanmoy

    This problem wil happen only if you've created a user with an empty group id, and this issue is fixed for FCS .
    You have two workarounds to use adminGUI for managing users:
    1. Use CLI, and create a group id to this user, then you can use adminGUI.
    2. Other option is remove the empty group id user from domain.xml, and then you can come back to adminGUI to create the user with some group id. I prefer the 1st option.

Maybe you are looking for