Problem casting org.w3c.dom.Document to oracle.xml.parser.v2.XMLDocument

I have the following problem:
I get my xml-documents as an XMLType from the database and want to compare these using the supplied Oracle class oracle.xml.differ.XMLDiff (i use the java version supplied with Oracle 9i r2).
XMLType.getDOM() returns the xml-document as a org.w3c.dom.Document,
what i need for oracle.xml.differ.XMLDiff is a oracle.xml.parser.v2.XMLDocument.
How can i cast/convert between these two formats?
thanks!
p.s. cross-posting with Re: Casting/Converting XMLType to XMLDocument? (but i think this forum is more relevant).

Hi,
thanks for the suggestion: i have written the code shown below. It results in a casting error.
As far as i know, i don't use a oracle.xdb.dom.XDBDocument, i only use a oracle.xdb.XMLType as the input parameter for my conversion-method:
any new suggestions ???
p.s. the second method which is commented does work, but is a bit verbose.
   private static oracle.xml.parser.v2.XMLDocument convert2XMLDocument(XMLType xml) {
     // simple version (should work according to tech. doc. 9i r2/ 10g r1 database)
     oracle.xml.parser.v2.XMLDocument doc = null;
     try {
        // n.b. probleem is dat XMLType.getDOM() een w3c.Document object teruggeeft ipv een oracle.XMLDocument.
        System.out.println("convert2XMLDocument(): casting w3c.Document naar oracle.XMLDocument.");
        doc = (oracle.xml.parser.v2.XMLDocument) xml.getDOM(); // public org.w3c.dom.Document getDOM()
        System.out.println("convert2XMLDocument(): done casting w3c.Document naar oracle.XMLDocument.");
     catch (Exception e) {
        e.printStackTrace(System.out);
    return doc;
   private static XMLDocument convert2XMLDocument(XMLType xml) {
     // complex version: works ok !!!
     XMLDocument doc = null;
     try{
        DOMParser parser  = new DOMParser();
        parser.setValidationMode(oracle.xml.parser.v2.XMLParser.NONVALIDATING);
        parser.setPreserveWhitespace (true);   
        parser.parse(new StringReader(xml.getStringVal()));
        doc = parser.getDocument();
    catch ( XMLParseException e ) {
      e.printStackTrace(System.out);
    catch ( SQLException e ) {
      e.printStackTrace(System.out);
    catch ( Exception e ) {
      e.printStackTrace(System.out);
    return doc;
convert2XMLDocument(): casting w3c.Document naar oracle.XMLDocument.
    java.lang.ClassCastException: oracle.xdb.dom.XDBDocument
     at pnb.bdb.xml.testJDBC.convert2XMLDocument(testJDBC.java:305)
     at pnb.bdb.xml.testJDBC.main(testJDBC.java:187)

Similar Messages

  • How to write the org.w3c.dom.Document  into an XML file.

    The file doesn't not exist. I have a class to form an XML Document object with giving parameters. And then how to write this Document object to an specialitied
    file?

    The easiest way is to use a Transformer to do an default transform of the document from a DOMSource to a StreamResult.
    something like
             TransformerFactory tf = TransformerFactory.newInstance();
             tf.setAttribute("indent-number", new Integer(4));
             Transformer t = tf.newTransformer();
             t.setOutputProperty(OutputKeys.INDENT, "yes");
             t.setOutputProperty(OutputKeys.METHOD, "xml");
             t.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/xml");
             t.transform(new DOMSource(yourDOMDocument), new StreamResult(new OutputStreamWriter(yourFileOutputStream)));

  • XDK 10.1.0.2.0 NT XMLType and org.w3c.dom.Document problem/bug?

    Hi Chaps,
    I have Oracle 11g1 server side and am using the Oracle XDK 10.1.0.2.0 for Windows client side with Sun Java JDK 6 (1.6.0_06-b02).
    (I couldnt find an XDK for 11g1???)
    I have a table in my database that has an XMLType, its a very simple table -
    CREATE TABLE hcr_xml_test
    RRN VARCHAR(24) PRIMARY KEY,
    ClipID VARCHAR2(27),
    Lodgement XMLType
    XMLTYPE COLUMN Lodgement
    STORE AS OBJECT RELATIONAL
    ELEMENT "/www.hcrregister.com/RequestServices/Messages/ConditionReportCreateRequest_1.xsd#ConditionReportCreateRequest_1"
    Thats all fine, however with the XDK I am trying to construct an XMLType for use with JDBC from a valid org.w3c.dom.Document so that I can insert a row into my table. My code looks like this -
    XMLType xml = new XMLType(realCon, doc);
    stmt = (OraclePreparedStatement) realCon.prepareStatement(sql);
    stmt.setString(1, id.getRRN());
    stmt.setString(2, id.getCenteraClipID());
    stmt.setObject(3, xml);
    stmt.execute();
    doc is a org.w3c.dom.Document
    realCon is a java.sql.Connection
    That code throws a SQLException at the line "stmt.setObject(3, xml);" -
    java.sql.SQLException: Fail to convert to internal representation
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
    at oracle.sql.OPAQUE.<init>(OPAQUE.java:85)
    at oracle.xdb.XMLType.toDatum(XMLType.java:480)
    at oracle.jdbc.driver.OraclePreparedStatement.setORADataInternal(OraclePreparedStatement.java:7437)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8158)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8149)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:229)
    at uk.co.landmarkinfo.registers.datawarehouse.tools.oracle.lodgementloader.DocumentProcessor.run(DocumentProcessor.java:232)
    Inspecting the exception I can see that the vendorCode is 17059.
    If I use "XMLType xml = XMLType.createXML(realCon, doc);" then xml is null instead of throwing a SQLException, so something isnt working here...
    However, if I serialize my Document to a String first and give that String to either the XMLType Constructor or XMLType.createXML() then it all works fine -
    /////TEMP
    Transformer transformer = saxTransformerFactory.newTransformer();
    transformer.setOutputProperty("omit-xml-declaration", "no");
    transformer.setOutputProperty("indent", "yes");
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    transformer.transform(new DOMSource(doc), new StreamResult(baos));
    XMLType stringXML = new XMLType(realCon, new String(baos.toByteArray()));
    ////END TEMP
    stmt = (OraclePreparedStatement) realCon.prepareStatement(sql);
    stmt.setString(1, id.getRRN());
    stmt.setString(2, id.getCenteraClipID());
    stmt.setObject(3, stringXML);
    stmt.execute();
    But why do I need to serialize to a String first??? Looking at the javadoc I dont think I should have to do this. So is there a problem in Oracles XDB handling of Document or have I missed something?

    Anyone has any idea? Please help!!!
    xu

  • How to convert clobDomain to org.w3c.dom.Document

    Hi
    We have store the xml data into oracle database as clobDomain.We are reading the same data from db and want to convert it into org.w3c.dom.Document type.We used the method getXMLContentNode() but its doesn't help us.See the below code.
    ClobDomain pedigreeXML = (ClobDomain) pedigreeDocumentRow.getAttribute("PedigreeDocument");
    DocumentBuilderFactory docBuildFactory= DocumentBuilderFactory.newInstance();
    Document containerDoc = docBuildFactory.newDocumentBuilder().newDocument();
    System.out.println(containerDoc.toString()); // this sop statement printing the xml fine
    Node node= pedigreeXML.getXMLContentNode(containerDoc);
    System.out.println(node); // this sop statement is printing data as "oracle.xml.parser.v2.XMLCDATA@1de6ded"
    Please let me know can we convert clobDomain to Document type.
    Thanks
    Baji

    Baji,
    it would help if you give the jdev version you are working on...
    I don't see a problem with the output you get from System.out.println(node); // this sop statement is printing data as "oracle.xml.parser.v2.XMLCDATA@1de6ded"as it only prints you the address of the node, but not the content. Try
    String str = node.getTextContent();and check if this get you the content.
    Timo

  • Org.w3c.dom.Document to/from String ?

    I need to be able to parse (once) an XML string, and then pass the parsed object around to/from different objects.
    I tried to use org.w3c.dom.Document,
    generated by javax.xml.parsers.DocumentBuilder .
    HOWEVER - I don't see any way to parse an xml String!
    The doc-builder parse() method accepts either a file/url, or an InputStream.
    When I tried to use the StringBufferInputStream I found-out it is deprecated, and that I should use StringReader.
    BUT I cannot parse using StringReader ! (the method parse() doesn't work with it)
    Is there anyway to parse a String to create a Document ?
    ========================================================
    And that's only HALF my problem:
    I did parse an input file into a Document, to experiment a little.
    I then wanted to convert it to an XML String - but couldn't.
    How do I get the xml String from a Document ?
    I cannot: How do I save it to a file ?
    I must say that under .NET both tasks are TRIVIAL:
    XmlDocument.LoadXML()
    XmlDocument.OuterXml
    Thanks
    Meir

    The doc-builder parse() method accepts either a file/url, or an InputStream.This isn't true. Look it up again. There are overridden versions of parse() that use File, InputSource, InputStream, or String. The String one isn't what you want, because the String it takes is a URL pointing to the XML and not the XML itself. The File one doesn't work for you because you don't have a file, and you've already said why the InputStream one doesn't work for you.
    So that leaves the version that takes an InputSource. So, what is an InputSource anyway? You could look it up just by clicking on the link in the API docs...

  • Security Exception in trying to get a org.w3c.dom.Document

    Hi,
    I'm trying to get an org.w3c.dom.Document using the following code----
         String configFileName = "discoveryconsts.xml";
              DocumentBuilder db = null;
              Document xmlDocument = null;
              DocumentBuilderFactory dbf = null;
         dbf = DocumentBuilderFactory.newInstance();
    System.out.println("The DocumentBuilderFactory is :" + dbf);     
    //the exception happens here,while building the DocumentBuilder.
         db = dbf.newDocumentBuilder();
    System.out.println("The DocumentBuilder is :" + db);          try
         xmlDocument = db.parse(configFileName);
    System.out.println("The Document Builder is :" + db);
    catch(Exception e)
         System.out.println("The Exception is :"+ e);
    System.out.println("The XML Document is :" + xmlDocument);
    The error obtained is in the ---
    java.lang.SecurityException: sealing violation
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(DocumentBuilderImpl.java:98)
    atorg.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:87)
    at Prototype.ChangingDiscConstsFile.discoveryConstants(ChangingDiscConstsFile.java:36)
    at Prototype.ChangingDiscConstsFile.main(ChangingDiscConstsFile.java:74)
    This error is obtained at runtime(ie.The file gets compiled).
    Kindly let me know the reason for the exception.
    regards,
    Karan.

    Hello Satya,
    Have you checked if the cross domain security between the domain WLS 10.3.5 and the backend server is enabled?
    Trust between domains is established so that principals in a Subject from one WebLogic domain can make calls in another domain. In previous releases of WebLogic Server, there was only one type of domain trust that is now referred to as Global Trust. WebLogic Server now supports a type of domain trust that is referred to as Cross Domain Security. The following sections explain how to configure each domain trust type:
    Enabling Cross Domain Security Between WebLogic Server Domains
    Enabling Global Trust
    http://docs.oracle.com/cd/E21764_01/web.1111/e13707/domain.htm#i1176046

  • Org.w3c.dom.Document not found

    I'm using jdk 1.6 and I'm getting "cannot find symbol" element when I try to compile to following simple code:
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Element;
    import org.w3c.dom.Document;
    import org.xml.sax.SAXException;
    public class TestXml {
        public static void main(String[] args) {
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = factory.newDocumentBuilder();
          Document = builder.newDocument();
          Element root = (Element) document.createElement("gene");
    }What do I need to get this to compile? I thought jaxp was built into jdk1.6, so why is it not being found?

    javac TestXml.java
    TestXml.java:14: cannot find symbol
    symbol  : variable Document
    location: class TestXml
          Document = builder.newDocument();
          ^
    TestXml.java:15: cannot find symbol
    symbol  : variable document
    location: class TestXml
          Element root = (Element) document.createElement("gene");
                                   ^
    2 errorsIn eclipse, the problem is shown as "Document cannot be resolved."

  • Org.w3c.dom.Document object in oSB

    Hi,
    I am getting a org.w3c.dom.Document type object in return from a Java Callout. When I try to access this object in OSB, I get a reference to some Java content. Can anybody tell me how to handle this object so that i can access its elements

    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html#wp1039298
    "The input and return types for Java callouts are not restricted. However, any return types other than primitives, Strings, or XmlObjects can *only be passed (unmodified) to other Java callouts*."
    It means you can't access Document object elements in OSB proxy flow. You can only pass them to another Java callout. To overcome this easily, you can change the return type from org.w3c.dom.Document to XmlObject.

  • How to parse & update org.w3c.dom.Document

    Hi,
    I have a org.w3c.dom.Document "w3Doc" object which is converted to org.jdom.Document object using DOMBuilder().build(w3Doc) method.
    Now the problem which I'm facing is that this org.w3c.dom.Document object contains an illegal xml character & when DOMBuilder().build() method tries to create JDOM doc/tree from org.w3c.dom.Document it raises IllegalDataException & the application errors up.
    Now, I want to parse org.w3c.dom.Document "w3Doc" object & check for illegal xml character in the w3Doc & remove this character.
    Can anyone help me out in finding which parser should I use to read w3Doc & update the doc(by removing the illegal data).
    Thanks in advance,

    Normally a Document is the output of a parser, not the input to one. And all the parsers I know of will not allow invalid XML characters to pass. So it must be that you're creating Text nodes in your program that include invalid XML characters and adding them to a Document. (I'm surprised that the DOM implementation allows you to do that.)
    So you should just stop doing that, instead of trying to find something to clean up the mess after the fact. The XML Recommendation, in section 2.2, tells you what characters are valid in XML. You can find it here:
    http://www.w3.org/TR/REC-xml/

  • How to put org.w3c.dom.Document into String

    Hello!
    I have some sample xml file with xml schema (xsd file). After parsing this sample file into org.w3c.dom.Document I would like to put it into the string and print out for test purpose only. But I don't know how to do it.
    I would like to print something like
    <somebody>
    <first>First somenthing</first>
    <second>Second something</second>
    </somebody>
    Thanks for your advices.

    The function you have specified works fine and gives back the string from DOM object.But it ruins all the formatting associated with the XML (like new line character)
    Is there any way to overcome it?
    Currently if i have a xml as
    <student>
    <firstname>
    </firstname>
    </student>
    The output of the code u have sent strips off the new line characters and returns everything in a single line as below:
    <student> <firstname> </firstname> </student>
    Thanks for any help associated with above problem.

  • Java.lang.StackOverflowError when invoking a method, returning a org.w3c.dom.Document object, on a SessionBean

    Hello,
    I hope someone can help me with this.
    I have a stateless session bean, which is returning a
    org.w3c.dom.Document object. The whole object is getting created
    but at the client side I am getting the following exception:
    java.rmi.RemoteException: ; nested exception is:
    weblogic.rmi.ServerError: A RemoteException occurred in the server method
    - with nested exception:
    [java.lang.StackOverflowError:
    Start server side stack trace:
    java.lang.StackOverflowError
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetEx
    ception.java:58)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(Compiled Code)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at java.io.ObjectOutputStream.outputClassFields(Compiled Code)
    at java.io.ObjectOutputStream.defaultWriteObject(Compiled Code)
    Then multiple occurences of the last few lines followed by
    at org.apache.xerces.dom.ParentNode.writeObject(Compiled Code)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(Compiled Code)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at java.io.ObjectOutputStream.outputClassFields(Compiled Code)
    at java.io.ObjectOutputStream.defaultWriteObject(Compiled Code)
    at org.apache.xerces.dom.ParentNode.writeObject(Compiled Code)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(Compiled Code)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeSpecial(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(Compiled
    Code)
    at weblogic.rmi.extensions.AbstractOutputStream2.writeObject(Compiled
    Code)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_WLSkel.invoke(Compiled
    Code)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(Compiled Code
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
    Code)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(Compiled Code)
    at weblogic.kernel.ExecuteThread.run(Compiled Code)
    End server side stack trace
    at weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.j
    ava:76)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_WLStub.getRegionAnalyst
    Data(CMSInterestDataEJBEOImpl_WLStub.java:558)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_ServiceStub.getRegionAn
    alystData(CMSInterestDataEJBEOImpl_ServiceStub.java, Compiled Code)
    at CMSJavaScript.main(CMSJavaScript.java:87)
    The structure of the XML document is
    <Maillist>
         <Region>
              <RegionCode>7</RegionCode>
              <RegionName>Asia Pacific</RegionName>
              <Analyst>
                   <Id>11111</Id>
                   <Name>AAAAAAAAAAAAAAAAA</Name>
              </Analyst>
              <Analyst>
                   <Id>22222</Id>
                   <Name>BBBBBBBBBBBBBBBBBB</Name>
              </Analyst>
         </Region>
    </Maillist>
    If the no. of Anlayst elements are 219, I am getting this error ( the same thing
    is working for less no. of analyst).
    Surprisingly when I access this ejb, by deploying it on my local server instance
    on Win-NT, it works fine. I am getting this
    exception, when the server is running on Sun Solaris.
    The weblogic version is 5.1.
    It will be really helpful if someone can reply to mee ASAP
    Thanks.
    Suren.

    Thanks a lot guys for all that information.
    Rajesh Mirchandani <[email protected]> wrote:
    Suren,
    More info at
    http://edocs.bea.com/wls/docs60/faq/java.html#251197
    Rob Woollen wrote:
    The quick fix is probably to use the -Xss argument on the Solaris JVMto increase the
    thread stack size.
    -- Rob
    Suren wrote:
    Thanks for your quick response.
    But how do we overcome with this?
    I tried to look for some help with this, but if you have any idea,
    can you suggest
    something ?
    Thanks
    Suren.
    Rob Woollen <[email protected]> wrote:
    It looks like the stack is overflowing when your DOM Tree is being
    serialized.
    Perhaps the Solaris JVM has a lower stack size by default.
    -- Rob
    Suren wrote:
    Hello,
    I hope someone can help me with this.
    I have a stateless session bean, which is returning a
    org.w3c.dom.Document object. The whole object is getting created
    but at the client side I am getting the following exception:
    java.rmi.RemoteException: ; nested exception is:
    weblogic.rmi.ServerError: A RemoteException occurred in
    the
    server method
    - with nested exception:
    [java.lang.StackOverflowError:
    Start server side stack trace:
    java.lang.StackOverflowError
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetEx
    ception.java:58)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(Compiled
    Code)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at java.io.ObjectOutputStream.outputClassFields(CompiledCode)
    at java.io.ObjectOutputStream.defaultWriteObject(CompiledCode)
    Then multiple occurences of the last few lines followed by
    at org.apache.xerces.dom.ParentNode.writeObject(CompiledCode)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(CompiledCode)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at java.io.ObjectOutputStream.outputClassFields(CompiledCode)
    at java.io.ObjectOutputStream.defaultWriteObject(CompiledCode)
    at org.apache.xerces.dom.ParentNode.writeObject(CompiledCode)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Compiled Code)
    at java.io.ObjectOutputStream.invokeObjectWriter(CompiledCode)
    at java.io.ObjectOutputStream.outputObject(Compiled Code)
    at java.io.ObjectOutputStream.writeObject(Compiled Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeSpecial(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled
    Code)
    at weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(Compiled
    Code)
    at weblogic.rmi.extensions.AbstractOutputStream2.writeObject(Compiled
    Code)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_WLSkel.invoke(Compiled
    Code)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(CompiledCode
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
    Code)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(CompiledCode)
    at weblogic.kernel.ExecuteThread.run(Compiled Code)
    End server side stack trace
    at weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.j
    ava:76)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_WLStub.getRegionAnalyst
    Data(CMSInterestDataEJBEOImpl_WLStub.java:558)
    at com.ssmb.teams.model.CMSInterestDataEJBEOImpl_ServiceStub.getRegionAn
    alystData(CMSInterestDataEJBEOImpl_ServiceStub.java, Compiled
    Code)
    at CMSJavaScript.main(CMSJavaScript.java:87)
    The structure of the XML document is
    <Maillist>
    <Region>
    <RegionCode>7</RegionCode>
    <RegionName>Asia Pacific</RegionName>
    <Analyst>
    <Id>11111</Id>
    <Name>AAAAAAAAAAAAAAAAA</Name>
    </Analyst>
    <Analyst>
    <Id>22222</Id>
    <Name>BBBBBBBBBBBBBBBBBB</Name>
    </Analyst>
    </Region>
    </Maillist>
    If the no. of Anlayst elements are 219, I am getting this error( the
    same thing
    is working for less no. of analyst).
    Surprisingly when I access this ejb, by deploying it on my local
    server
    instance
    on Win-NT, it works fine. I am getting this
    exception, when the server is running on Sun Solaris.
    The weblogic version is 5.1.
    It will be really helpful if someone can reply to mee ASAP
    Thanks.
    Suren.

  • Save org.w3c.dom.Document to File

    Hi all,
    I can save org.jdom.Document to a file but I don't know how do it with org.w3c.dom.Document.
    My code Java can convert org.w3c.dom.Document to org.jdom.Document but I want to save org.w3c.dom.Document direct.
    thanks a lot
    best regards
    dsea

    As an xml file?
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html

  • Covert org.jdom.Document to org.w3c.dom.Document

    Hello,
    How would I convert org.jdom.Document to org.w3c.dom.Document??
    I'm creating org.jdom.Document from the servlet that reads from the database, which gets output like following.
    // doc is org.jdom.Document
    Document doc = new Document( root );
    reportName = new Element( "REPORT_NAME" );
    root.addContent( reportName );
    reportName.setText( "Current Account Balance" );
    // skip...
    XMLOutputter outputter = new XMLOutputter(" ", true, "UTF-8");
    outputter.output(doc, out);
    And in my caller servlet, I read from the previous servlet using URL and parse it, trying to get Document, but it
    InputSource xmlSource = new InputSource( url.openStream());
    //Use a DOM Parser (org.apache.xerces.parsers.DOMParser)
    DOMParser parser = new DOMParser();
    parser.parse( xmlSource );
    Document doc = parser.getDocument();
    // and I do transformation.
    DOMSource inXML = new DOMSource( doc );
    StreamResult outXML = new StreamResult( out );
    transformer.transform( inXML, outXML )
    I'd like to skip passing around XML and share the same Document object so that I don't have parse it again...
    Help!

    Convert jdom document to dom document with class DOMOutputter.
    org.jdom.output.DOMOutputter domOut=new DOMOutputter();
    org.w3c.dom.Document domDocument=domOut.output(org.jdom.Document jdomDocument);

  • Org.w3c.dom.Document -- text

    Hello.
    I have parsed org.w3c.dom.Document.
    Is here a library that can print it to a xml file?
    Secondly I wish print it as .html, so output should a bit differ from standard .xml output.

    Yes. In both cases you use a Transformer. (That's in package javax.xml.transform.) You get it via one of the TransformerFactory.newTransformer() methods. To do a straight copy you use the method with no parameters, which does an "identity transformation". To transform to HTML, you use the method with an XSLT for its parameter.

  • Org.w3c.dom Document newbie question

    hello
    I have a string of an XML document that i want to make into a dom.Document. i can't seem to create it though.
    DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    org.w3c.dom.Document doc =  db.parse(new StringBufferInputStream(s.substring(s.indexOf("?>") + 2).trim()));the String s has a xml header with <? and ?> and you see here i am stripping that off the top... i tried with it on, and w/o, but i keep getting back a Document that is null. what is required for a document to be made? can't i just do <sometag>blah</sometag>
    and thats good enough?

    getting back a Document that is nullIf that means that the variable doc contains a null reference after you execute that statement, then most likely the statement is throwing an exception that you are ignoring. And that exception is probably because you're passing malformed XML to the parser... you have done some debugging to see what string you are passing to it, haven't you?
    And why StringBufferInputStream? The whole class is deprecated. Better to use a StringReader instead:doc = db.parse(new InputSource(new StringReader(...)));(This is posted frequently on this forum but here it is yet again.)

Maybe you are looking for

  • JTree not showing plus/minus signs

    Hi, I'm having a strange problem with JTree when implementing my own DefaultTreeCellRenderer: the renderer is shown correctly, but the plus and minus signs are gone! My getTreeCellRendererComponent implementation actually creates a new JPanel and ret

  • CHANGING UOM in material master

    Q1. Which unit of messurement is linked with the net value in purchase Order. Q2. Can we change the unit of messurement of a material.

  • Mapviewer/Mapbuilder versus other map serving products

    Mapviewer/Mapbuilder versus other map serving products Oracle Mapviewer is an attractive map serving option for organisations that have large data holdings in Oracle Spatial. Similarly, Mapbuilder is very useful for cartographic assembly of data to b

  • Confirmation-Related Invoice Verification

    Has anybody had the issue that when using SRM 5.0 (extended classic) a purchase order falls into "error in process" because the Confirmation-Related Invoice Verification has been checked on by SRM even though the vendor master never had this GR based

  • Can't Open PDFs Inside Firefox

    I have installed the latest Adobe Reader 9 and want to open PDF documents inside of the Firefox browser on Vista. No matter what I do, I  always get a popup window asking me if I want to download or open in Adobe Reader when I click on a pdf file. I