XML DOM getDocumentElement() working in Java, not in Tomcat

This is a really strange one (to me anyway) !
We have some XML parsing classes tested in Eclipse that run just fine as Java code. When we try to use them in Tomcat, though, we get an error with getDocumentElement() - it always truncates at the beginning of the XML. This is the XML string we are using for testing in Eclipse:
"<rft><pollcfg><tmo>200</tmo><retry>5</retry>"
          + "<mapping>"
          + "<name>Simulation</name>"
          + "<subnet>0</subnet>"
          + "<comm>com8</comm>"
          + "</mapping>"
          + "<comm>com11</comm>"
          + "<comm>com12</comm>"
          + "<subnet>1</subnet>"
          + "<subnet>2</subnet>"
          + "<subnet>3</subnet>"
          + "<subnet>4</subnet>"
          + "</rft>";
And we load this string into a DOM as follows
               DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
               dbf.setValidating(false);
               dbf.setNamespaceAware(true);
               dbf.setIgnoringElementContentWhitespace(true);
               DocumentBuilder builder = dbf.newDocumentBuilder();
ByteArrayInputStream bais = new ByteArrayInputStream(XMLRetrievedData.getBytes());
doc = builder.parse(bais);
ANd then we can say :
System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
and we get the XML.
If we run this in Tomcat the line
System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
produces
[rft: null]
instead of the XML we get when we run the same code in Eclipse !!
We want to parse the DOM, delete some elements and add some new elements. Then we want to return the altered DOM as a String .. for whatever client needs it.
Any ideas about this ? What could be wrong ?
Thanks !!

Hi there,
I've got the same problem, except it doesn't even work as a Java application... getDocumentElement() always returns null... any idea?
I checked the classpath and tried several versions of Document/Element, but without success.
Regards,
Laurent.

Similar Messages

  • Payload XML DOM Object Update using Java Embedding

    Hi,
    I have a Java Embedding activity which updates the payload after making
    a call to a local EJB. The EJB sends back updated information. In my Java
    Embedding activity i try to update the payload nodes with the new information.
    It get's really cumbersome to do this sort of thing in BPEL. Basically i am trying
    to remove an existing node in the payload and replace it with a new node.
    I did so may things that i really don't remember what are they. Finally i managed to
    update the payload with the following code.
    org.w3c.dom.Element payload = (org.w3c.dom.Element)getVariableData("inputVariable","payload","/MSG");
    org.w3c.dom.Element oldNode = (org.w3c.dom.Element)getVariableData("inputVariable","payload","/MSG/TSLData");
    org.collaxa.thirdparty.dom4j.Element tslElem = com.collaxa.cube.xml.dom.DOMFactory.convertToCollaxaElement(oldNode);
    oldNode = (org.w3c.dom.Element)getVariableData("inputVariable","payload","/MSG/REC");
    payload.removeChild(oldNode);
    msgElem = com.collaxa.cube.xml.dom.DOMFactory.convertToCollaxaElement(payload);
    msgElem.add(recElem);
    I feel that there no proper interface to update the data in the payload values with
    nodes, string etc. It would be nice if we don't have to work with
    com.collaxa.cube.xml.dom.DOMFactory
    org.collaxa.thirdparty.dom4j.Element
    the collaxa classes.
    We need to have more than setVariableData, bascally good payload manipulation API's.
    Let me know if there are any alternatives to do this.
    Thanks,
    Senthil L

    I have been having the same difficulties. Were you able to find any documentation or javadocs for the Collaxa libraries? If so, I would greatly appreciate locating them.

  • Xml parsing, one works, one does not?

    I am using the xerces parser to validate a xml against a schema. it works fine if i just specified the location of the xml file. however, if i converted the xml file into byte[], it does not work.
    something i did not do right?
    thanks.
    //works
    myParser.parse("C://test.xml");
    //does not work, xml_data is the byte[] of test.xml
    ByteArrayInputStream bais = new ByteArrayInputStream (xml_data);
    myParser.parse(new InputSource(bais));
    errors:
    [warning] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'stuff.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    [error] org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'ElectronicPayment'.
    cvc-elt.1: Cannot find the declaration of element 'Person'.

    You have:
    ByteArrayInputStream bais = new ByteArrayInputStream (xml_data);
    myParser.parse(new InputSource(bais));
    ERROR is: xml_data is a string, not bytes
    so: try
    ByteArrayInputStream bais = new ByteArrayInputStream (xml_data.getBytes());
    myParser.parse(new InputSource(bais));

  • XML DOM working in Java, not working in Tomcat

    This is a really strange one (to me anyway) !
    We have some XML parsing classes tested in Eclipse that run just fine as Java code. When we try to use them in Tomcat, though, we get an error with getDocumentElement() - it always truncates at the beginning of the XML. This is the XML string we are using for testing in Eclipse:
    "<rft><pollcfg><tmo>200</tmo><retry>5</retry>"
    + "<mapping>"
    + "<name>Simulation</name>"
    + "<subnet>0</subnet>"
    + "<comm>com8</comm>"
    + "</mapping>"
    + "<comm>com11</comm>"
    + "<comm>com12</comm>"
    + "<subnet>1</subnet>"
    + "<subnet>2</subnet>"
    + "<subnet>3</subnet>"
    + "<subnet>4</subnet>"
    + "</rft>";
    And we load this string into a DOM as follows
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(false);
    dbf.setNamespaceAware(true);
    dbf.setIgnoringElementContentWhitespace(true);
    DocumentBuilder builder = dbf.newDocumentBuilder();
    ByteArrayInputStream bais = new ByteArrayInputStream(XMLRetrievedData.getBytes());
    doc = builder.parse(bais);
    ANd then we can say :
    System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
    and we get the XML.
    If we run this in Tomcat the line
    System.out.println( "getDocumentElement() was " + doc.getDocumentElement() );
    produces
    [rft: null]
    instead of the XML we get when we run the same code in Eclipse !!
    We want to parse the DOM, delete some elements and add some new elements. Then we want to return the altered DOM as a String .. for whatever client needs it.
    Any ideas about this ? What could be wrong ?
    Thanks !!

    Beg pardon - I should have said we are loading the XML string shown into the String XMLRetrievedData. That's how the 'rft' part of the [rft: null] gets into Tomcat's output.
    Strange ...

  • Oracle XML DOM parser - attribute values are not printing on the screen ??

    Hi Everyone,
    I am just trying to use oracle DOM parser to paerse one of my xml file, java file can be compiled and run agianst a xml file, But I cannot see any attribute values printing on the screen..
    Appreciate if anyone can help, where I have gone wrong please?
    Below is the java file:
    // menna puthe DOMSample eka - duwanawa 19/12/2005
    import java.io.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import oracle.xml.parser.v2.*;
    public class DOMSample {  //public class eka ***
    static public void main(String[] argv){  // main method eka ###
    try {
    if (argv.length != 1){
    // Must pass in the name of the XML file...
    System.err.println("Usage: java DOMSample filename");
    System.exit(1);
    // Get an instance of the parser
    DOMParser parser = new DOMParser();
    // Generate a URL from the filename.
    URL url = createURL(argv[0]);
    // Set various parser options: validation on,
    // warnings shown, error stream set to stderr.
    parser.setErrorStream(System.err);
    parser.showWarnings(true);
    // Parse the document.
    parser.parse(url);
    // Obtain the document.
    Document doc = parser.getDocument();
    // Print document elements
    System.out.print("The elements are: ");
    printElements(doc);
    // Print document element attributes
    System.out.println("The attributes of each element are: ");
    printElementAttributes(doc);
    catch (Exception e){
    System.out.println(e.toString());
    } // main method eka ###
    static void printElements(Document doc) {
    NodeList nl = doc.getElementsByTagName("*");
    Node n;
    for (int i=0; i<nl.getLength(); i++){
    n = nl.item(i);
    System.out.print(n.getNodeName() + " ");
    System.out.println();
    static void printElementAttributes(Document doc){
    NodeList nl = doc.getElementsByTagName("*");
    Element e;
    Node n;
    NamedNodeMap nnm;
    String attrname;
    String attrval;
    int i, len;
    len = nl.getLength();
    for (int j=0; j < len; j++){
    e = (Element)nl.item(j);
    System.out.println(e.getTagName() + ":");
    nnm = e.getAttributes();
    if (nnm != null){
    for (i=0; i<nnm.getLength(); i++){
    n = nnm.item(i);
    attrname = n.getNodeName();
    attrval = n.getNodeValue();
    System.out.print(" " + attrname + " = " + attrval);
    System.out.println();
    static URL createURL(String filename) {  // podi 3 Start
    URL url = null;
    try {
    url = new URL(filename);
    } catch (MalformedURLException ex) { /// BBBBBB
    try {
    File f = new File(filename);
    url = f.toURL();
    } catch (MalformedURLException e) {
    System.out.println("Cannot create URL for: " + filename);
    System.exit(0);
    } // BBBBBB
    return url;
    } // podi 3 End
    } //public class eka ***
    // End of program
    output comes as below:
    Isbn:
    Title:
    Price:
    Author:
    Message was edited by:
    chandanal

    Hi Chandanal,
    I edited your code slightly and I was able to get the correct output.
    I changed the following line:
    for (int j=0; j >< len; j++)to:
    for (int j=0; j < len; j++)I have included the complete source below:
    // menna puthe DOMSample eka - duwanawa 19/12/2005
    import java.io.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import oracle.xml.parser.v2.*;
    public class DOMSample {
        //public class eka ***
        public static void main(String[] argv) {
            // main method eka ###
            try {
                if (argv.length != 1) {
                    // Must pass in the name of the XML file...
                    System.err.println("Usage: java DOMSample filename");
                    System.exit(1);
                // Get an instance of the parser
                DOMParser parser = new DOMParser();
                // Generate a URL from the filename.
                URL url = createURL(argv[0]);
                // Set various parser options: validation on,
                // warnings shown, error stream set to stderr.
                parser.setErrorStream(System.err);
                parser.showWarnings(true);
                // Parse the document.
                parser.parse(url);
                // Obtain the document.
                Document doc = parser.getDocument();
                // Print document elements
                System.out.print("The elements are: ");
                printElements(doc);
                // Print document element attributes
                System.out.println("The attributes of each element are: ");
                printElementAttributes(doc);
            } catch (Exception e) {
                System.out.println(e.toString());
        // main method eka ###
        static void printElements(Document doc) {
            NodeList nl = doc.getElementsByTagName("*");
            Node n;
            for (int i = 0; i < nl.getLength(); i++) {
                n = nl.item(i);
                System.out.print(n.getNodeName() + " ");
            System.out.println();
        static void printElementAttributes(Document doc) {
            NodeList nl = doc.getElementsByTagName("*");
            Element e;
            Node n;
            NamedNodeMap nnm;
            String attrname;
            String attrval;
            int i, len;
            len = nl.getLength();
            for (int j = 0; j < len; j++) {
                e = (Element)nl.item(j);
                System.out.println(e.getTagName() + ":");
                nnm = e.getAttributes();
                if (nnm != null) {
                    for (i = 0; i < nnm.getLength(); i++) {
                        n = nnm.item(i);
                        attrname = n.getNodeName();
                        attrval = n.getNodeValue();
                        System.out.print(" " + attrname + " = " + attrval);
                System.out.println();
        static URL createURL(String filename) {
            // podi 3 Start
            URL url = null;
            try {
                url = new URL(filename);
            } catch (MalformedURLException ex) {
                /// BBBBBB
                try {
                    File f = new File(filename);
                    url = f.toURL();
                } catch (MalformedURLException e) {
                    System.out.println("Cannot create URL for: " + filename);
                    System.exit(0);
            // BBBBBB
            return url;
        // podi 3 End
    } //public class eka ***-Blaise

  • Applet, works locally, but NOT thru tomcat?

    Can someone explain to me WTF is oging on?
    My applet works locally, say if the address in my browser is D:\blahblah\OX.html (the name of the html file containing reference to applet),
    but not thru http://localhost/blahblah/OX.html ?
    What the hell is going on?

    It sure would help people help you if you provided an url that is not starting with: http://localhost ;-)

  • Error starting WL - weblogic.xml.dom.ChildCountException: missing child home in ejb-ref

    hi,
    i get this following error when i start the WL 7.0. The web application fails
    to start but the ejbs are started properly. This is an example from the Monson
    Haefel book, on the CMP: Entity bean relationships.
    Can anybody tell me what is happening ??
    -thanks
    -vasanth
    Error log:
    =============
    <Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Web appplication
    "C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
    te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear", URI="tit
    an.war"
    weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
            at weblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
            at weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
            at weblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
            at weblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
    .java:247)
            at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
    ptorLoader.java:540)
            at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    .java:253)
            at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    .java:215)
            at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
    va:282)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:714)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
            at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
            at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
            at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
            at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
            at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
            at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
            at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
            at weblogic.Server.main(Server.java:32)
    >
    <Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The Slave Deployer
    f
    ailed to initialize the application titan due to error weblogic.management.Appli
    cationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    weblogic.management.ApplicationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:720)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >

    It is working now.
    For a local entity bean, i was using <ejb-ref> instead of <local-ejb-ref>
    Once i changed that, it worlked.
    thanks
    -vasanth
    "Sanjeev Chopra" <[email protected]> wrote:
    correct url for doc...
    http://e-docs.bea.com/wls/docs81/webapp/web_xml.html#1020090
    "Sanjeev Chopra" <[email protected]> wrote in message
    news:[email protected]...
    Seems like titan.war's WEB-INF/web.xml has an ejb-ref element witha
    missing
    <home> element .
    see http://e-docs/wls/docs81/webapp/web_xml.html#1020090
    "Vasanth" <[email protected]> wrote in message
    news:[email protected]...
    hi,
    i get this following error when i start the WL 7.0. The web applicationfails
    to start but the ejbs are started properly. This is an example from
    the
    Monson
    Haefel book, on the CMP: Entity bean relationships.
    Can anybody tell me what is happening ??
    -thanks
    -vasanth
    Error log:
    =============
    <Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Webappplication
    "C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
    te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear",URI="tit
    an.war"
    weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
    atweblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
    at
    weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
    atweblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
    atweblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
    java:247)
    atweblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
    ptorLoader.java:540)
    atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    java:253)
    atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    java:215)
    atweblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
    va:282)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:714)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >
    <Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The SlaveDeployer
    f
    ailed to initialize the application titan due to errorweblogic.management.Appli
    cationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    weblogic.management.ApplicationException: Prepare failed. Task Id
    = null
    Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:720)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >

  • Works in java, but not in JSP

    anyone can advice on this ? =/
    processAddEntry.jsp
    <%@ page import = "javax.xml.parsers.*"%>
    <%@ page import = "org.jdom.*"%>
    <%@ page import="org.w3c.dom.*"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import = "java.io.IOException"%>
    <%@ page import = "org.jdom.JDOMException"%>
    <%@ page import = "org.jdom.input.DOMBuilder"%>
    <%@ page import = "org.jdom.output.XMLOutputter "%>
    <%@ page import = "org.xml.sax.InputSource"%>
    <%@ page import = "org.apache.xerces.parsers.DOMParser"%>
    <html>
    <body>
    <%
    String xmlFile = request.getParameter("xmlFile");
    String formDate = request.getParameter("formDate");
    String formRisk = request.getParameter("formRisk");
    String formDesc = request.getParameter("formDesc");
    String xmlFileDir = "http://172.16.225.28:8080/security/security_table.xml";
    org.w3c.dom.Document domDoc = null;
    DOMParser parser = new DOMParser();
    try{
         parser.parse(new InputSource(xmlFileDir));
         domDoc = parser.getDocument();
         Node rootElt = domDoc.getDocumentElement();
         Node newEntry = domDoc.createElement("Entry");
         rootElt.appendChild(newEntry);
         Node childNode = domDoc.createElement("Date");
         newEntry.appendChild(childNode);
         Node textNode = domDoc.createTextNode(formDate);
         childNode.appendChild(textNode);
    catch(Exception e){
         e.printStackTrace();
    try{
         DOMBuilder builder = new DOMBuilder();
         org.jdom.Document jdomDoc = builder.build(domDoc);
         writeToFile("http://localhost/security/backup.xml", jdomDoc);
    catch (Exception e){
         e.printStackTrace();
    %>
    <%!
    public void writeToFile(String fname, org.jdom.Document doc)
         try {
              FileOutputStream out = new FileOutputStream(fname);
              XMLOutputter serializer = new XMLOutputter(" ", true);
              serializer.output(doc, out);
              out.flush();
              out.close();
         catch (IOException e) {
              System.err.println(e);
    %>
    <h1>xmlFile is <%out.println(xmlFile);%></h1>
    <h1>formDate is <%out.println(formDate);%></h1>
    <h1>formRisk is <%out.println(formRisk);%></h1>
    <h1>formDesc is <%out.println(formDesc);%></h1>
    <h1>xmlFileDir is <%out.println(xmlFileDir);%></h1>
    </body>
    </html>

    What error you are getting...please provide error details.
    It is working fine for me.
    Rgds
    Bala Murali

  • Xerces for XSD 1.1 Validation not working in Java Mapping

    Hi Experts,
    We are trying to use XSD 1.1 (assertion feature) validation for the XML payload in a Java mapping program. But I am getting the following exception:
    java.lang.IllegalArgumentException: http://www.w3.org/XML/XMLSchema/v1.1 at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:186)
    This is happing for the statement:
    SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
    The reason (apparently) is because it is not able to instantiate the class org.apache.xerces.jaxp.validation.XMLSchema11Factory , which is the Xerces implementation of the SchemaFactory class.
    I have tried following things so far -
    1. If I try to validate an xml against an xsd 1.1 schema in a standalone program, it works perfectly fine.
    2. If I try to deploy this whole functionality on to the server through an EAR (like an adapter module), there again it works.
    3. Also tried this before instantiating the SchemaFactory -
    System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/XML/XMLSchema/v1.1","org.apache.xerces.jaxp.validation.XMLSchema11Factory");
    4. I tried by creating the Imported Archive objects for all the Xerces jars that we require for validation, within the same SWCV, namespace. But still I get the same exception as above (IllegalArgumentException)
    5. The link [http://help.sap.com/saphelp_nw70/helpdata/en/b6/8097f5a5edea4f8dfc87ac87082b22/content.htm ] mentions that we need to place all the necessary jars at location <SAP_J2EE_Engine_install_dir>/cluster/server/bin/ext /. But even after placing the jars there, I get the same exception.
    I am not sure how we need to handle this. Has anybody faced a similar situation? Any suggestions?
    Regards,
    Sudheer

    Hi Stefan,
    Thanks for the reply.
    We are on PI 7.1 SP 06. The standard XML tools from jdk supports only XSD 1.0, as far as I know. And XSD 1.0 does not have the Assert feature (also known as, co-occurrence constraint). More details are provided here - [http://www.ibm.com/developerworks/library/x-xml11pt2/]
    To use XSD 1.1, we need a different implementation like Xerces-J. I am not sure how we can use it without external jars. I would like to mention again that I could achieve this by using an adapter module (EAR containing the jars), but I need to do this in Java Mapping (imported archive).
    Do you know how we can achieve this in any other way? Any other suggestions welcome.
    Thanks & Regards,
    Sudheer

  • Applets not working with Java 1.7.0_51 in MII 14.0 SP4 Patch 5

    Hi,
    I'm currently evaluating the migration of our MII 12.0 developments to MII 14.
    But I'm running in several issues just trying to use simple things like a SQL query template with an iGrid Display template in test mode.
    Used versions are: MII 14.0 SP4 Patch 5 and on client side the latest Mozilla Firefox with Java 1.7.0_51
    At first I always get a java security warning when the applet is being loaded about unsigned applications.
    At second the applet itself is not running. It always shows "No data available" and the java console shows the following errors (iResult is the id of the applet):
    iResult [ERROR] - Couldn't set query template: No Query Defined
    iResult [ERROR] - Couldn't set display template: null
    iResult [ERROR] - Couldn't set display template: null
    Is this perhaps a general problem, that the MII applets are not working with Java 1.7.x versions?
    If I call the same MII page from a client with Java 1.6.x it is working without errors.
    Do you have some suggestions for me?
    Regards Timo

    please clear your JAVA Cache. that should solve the JRE issue. thanks

  • Java not working in Internet Explorer

    I normally use another browser (Google Chrome) but need to use Internet Explorer for a particular online banking service. This service requires a Java applet.
    I have the current Java environment (as at 21.3.12), SE 6 Update 31.
    Java works in Chrome but does not work in IE8 or IE9.
    I have un-installed and re-installed Java several times, tried going back to IE8, turned off ActiveX filtering, confirmed Java scripting is on, checked add-ins are managed correctly and so on and so on, without success. Given Java works it is not a Java
    issue but must be an IE issue.
    Are there any additional steps or diagnostics I can run to try to identify the problem as I need this to be resolved for the purposes of running my business.
    Many thanks!

    Hi guys.
    I'm having an issue like this and none of the solutions above helped me.
    I'm trying to open a specific web page that is not working with Java only on Internet Explorer (7, 8 nor 9). If I try to open in Google Chrome or Firefox it goes fine.
    I've tried various versions of Java and all my tries were done both on Windows XP Professional and Windows 7 Professional.
    The weird thing is that when I test it through Java webpage or some other page, it goes fine. It is not working only for this specific webpage.
    This is the webpage:
    http://iweb03ds.magnaclosures.com/stconf.nsf/meeting/mid3FC5EBB1D59C830685257A2900420436
    It is a meeting webpage for our company to present their work to our clients and suppliers. I've also followed their own step-by-step advises, but no good either.
    Could anyone help me on that?

  • Java not working on clean install of Mavericks

    I play a Java-based game (Wakfu) on my MacBook Pro. A few weeks ago, it stopped working. The update launcher would work just fine, but playing the game results in opening a blank Java application. I tried a lot of different solutions and eventually just decided to back up my hard drive and do a clean install of the OS and game on a reformatted drive. Because I have no problems running the same game on my iMac desktop, it seemed to me that this was probably something to do with conflicting applications on my MacBook Pro.
    My assumption was that a clean install would allow Java and the game to work as expected, but this has not been the case. I have done clean installs multiple times now. I have tried installing Java 1.6 from the prompt that pops up when I go to run the game, and it doesn't work. I have tried installing the latest version of Java from the Java website and it doesn't work. I have tried repairing my disk permissions and restarting my computer. I have tried reverting from 1.6 to 1.7 using the Apple Support Instructions, and that has worked occasionally, but not consistently, and as soon as I have to do some kind of forced reboot, the game stops working again—so I assume there is something else going on.
    Additionally, I have tried downloading the MacGameStore app and the Big Fish Games Game Manager and neither of them will run either.
    Showing the Java version in Terminal results in the following:
    java version "1.6.0_65"
    Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
    Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
    Does anyone have any suggestions for getting Java applications to work on my laptop?

    To add information that might be more helpful, I just did a boot in Safe Mode and the application worked fine. Back in regular boot mode, it still doesn't work. I don't know where to go from here.

  • BAPI not working in Java Webdynpro

    Hi,
    My BAPI from SAP is working in Netweaver perfectly, but when I call the same with the equal parameters in Java webdynpro, no results.
    I'm using following function: 'CVAPI_DOC_VIEW'.
    Any idea why the BAPI is not working in Java Webdynpro?
    Regards,
    Tim

    Hi Tim,
    AFAIK 'CVAPI_DOC_VIEW'  will work only in standard SAP Dynpro. Inside Webdynpro it is forbidden to save files in the background and using GUI class with execute, so you cannot use that Standard FM.
    Check this thread .
    Thanks
    Katrice

  • How to typecast string to xml DOM element in java

    hai
          i need a string to be converted to xml DOM element in java, can any help me
          i have done in this way
         NodeList children = lParentRule.getElementsByTagName("parentruledetails").item(0).getChildNodes();
    for  
    (int i = 0; i < children.getLength(); i++) {Node nod = children.item(i);
    if  
    (nod.getNodeName().contains("parentcustomdetails")){Element parentcustom = (Element)nod.getNodeName();   // i get typecast error at this line}
    i need to convert the string to element
    can any one help me
    Thanks in Advance

    Hello. You can't cast a string to an element, you need to create that element.
    Maybe this can help up: http://www.genedavis.com/library/xml/java_dom_xml_creation.jsp

  • The attached VI works when I run it initially creating the XML file, but when run after the XML file is created, it's not updated. What am I doing wrong?

    The attached VI works when I run it initially creating the XML file, but when I change data and run after the XML file is created, it's not updated with new data. What am I doing wrong?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    Attractive Force XML.vi ‏23 KB

    That looks like the logic which was written into the VI
    Inner true/ false case:
    (file exists : false) write to XML file, unflatten for display
    (file exists : true) read from XML file, unflatten for display
    At no time when the file exists (true case) is the XML file updated...

Maybe you are looking for

  • Why can I not open a new tab?

    I have three tabs open. There is the "+" tab to open a new one. When I click on this "+" tab or I select FILE->NEW TAB....then a new tab will not open. I am currently limited to three tabs.

  • Problem burning DVD+R

    Hello, I bought a mbp in june 2007 and burned about 50 Verbatim DVD+ until January 08. I'm trying to burn on the same DVD model now, and I'm having a media error: Burn: Burn started, Sat May 24 16:22:28 2008 Burn: Burning to DVD+R media with DAO stra

  • File saving problems after updating to 10.7.2

    I updated to Mac OS X 10.7.2 on the 12th. Right after this update, I started having problems under XCode (I had updated it to 4.2). I can not save any changes to my source code. I get an error code saying "The document ImportView.m can not be saved.

  • Mouse scroll ball

    Scroll ball works only in one direction. I only move screen up by rolling the ball upward. It does not response when I scroll down. I think something inside the mouse, roller or sensor or anything, though the movement of the ball is just fine. Is the

  • Plz Help sas drive What should i do?

    So I have an awesome late 2009 macbook pro 13.3", with a 2.53 GHz intel core duo processor, 500GB 5400rpm HDD, 4GB ram. I just ordered an 8GB ram upgrade from newegg, because a lot of stuff I do with my computer takes ALOT of resources. Im also looki