Saaj CDATA element exception

Hi, I am trying to insert a soap body but I am getting an exception.
This is what I am trying to achieve:
<Message><![CDATA[hello]]></Message>
My code:
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPPart soapPart = message.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPBody body = envelope.getBody();
body.addChildElement(envelope.createName("Message")).addTextNode("<![CDATA[hello]]>");
This creates an exception:
java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.CDATAImpl
     at com.sun.xml.messaging.saaj.soap.impl.ElementImpl.addTextNode(ElementImpl.java:245)
Can anyone help me with that. I must use the CDATA, escape characters would be of no use.

Of course, it works with PCDATA, but the point is that I want the element's content
to be unparsed.

Similar Messages

  • CDATA element deleted in SOAP receiver adapter

    Hello Everybody!
    I've got a problem with SOAP receiver adapter. I've made a mapping for synchronous HTTP -> XI -> SOAP interface, in which the request mapping is java mapping, which produce a message like this:
    <?xml version="1.0" encoding="UTF-8"?> <ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews">
    <ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">
    <![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=]]>
    </IMAGE></IMAGES>
    </ns0:xmlDocument></ns0:SaveISDocument>
    In CDATA is a Base64 representation of some file.
    I hoped at oubound of SOAP adapter sholud be something like this:
    <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:SaveISDocument xmlns:ns0='http://pl.optix.pl/aews'>
    <ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews">
    <ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">
    <![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=]]>
    </IMAGE></IMAGES>
    </ns0:xmlDocument></ns0:SaveISDocument>
    </SOAP:Body></SOAP:Envelope>
    Unfortunatelly there is something like:
    <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:SaveISDocument xmlns:ns0='http://pl.optix.pl/aews'>
    <ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews"><ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=
    </IMAGE>
    </IMAGES></ns0:xmlDocument></ns0:SaveISDocument>
    </SOAP:Body></SOAP:Envelope>
    ... which is not correct, because CDATA tags are lost!
    Anyone has idea, how to enable adapter to process message right?
    Best regards,
    Mikolaj

    Henrique:
    As I wrote - the webservice was wrote by 3rd party software supplier - so I wasn't sure if I could change a specification at this point - that was a reason why I needed a CDATA element. A CDATA element was at entry of this webservice and I couldn't send to it my data correctly using XI. That was a problem. Hope You got it now.
    Finally I've managed the problem because 3rd party software supplier agreed to change their service and use <CDATA> tag instead of CDATA element.
    I solved the problem but my question still remain not answered.
    At OSS I was asked to upload latest SP (now I've got 12 at Java Stack).
    If this will help I'll close this thread.
    Best regards
    Mikolaj

  • Weblogic throwing "null SOAP element Exception" in multi-part SOAP response

    Hi All,
    I'm using weblogic 10. My application is a webservice client generated using '*clientgen*', which is running on weblogic, and
    is invoking a remotely hosted webservice ( Remotely hoseted webservice may not be running on weblogic).
    I've the wsdl file of remotely hosted webservice.
    Now the problem is with WSDL file (I suppose), have a look at this.
    *&lt;message name="m1"&gt;*
    *&lt;part name="body" element="tns:GetCompanyInfo"/&gt;*
    *&lt;/message&gt;*
    *&lt;message name="m2"&gt;*
    *&lt;part name="body" element="tns:GetCompanyInfoResult"/&gt;*
    *&lt;part name="docs" type="xsd:AnyComplexType"/&gt; ------&gt; assume all elements inside this complex type can be nil or minOccurs set to '0'*
    *&lt;part name="logo" type="xsd:AnyOtherComplexType"/&gt; ------&gt; assume all elements inside this complex type can be nil or minOccurs set to '0'*
    *&lt;/message&gt;*
    &lt;portType name="pt1"&gt;
    &lt;operation name="GetCompanyInfo"&gt;
    &lt;input message="m1"/&gt;
    *&lt;output message="m2"/&gt; -----&gt; multi part message.*
    &lt;/operation&gt;
    &lt;/portType&gt;
    Now here is sample message for the request(I've composed this message for this question):
    &lt;soap:Envelope&gt; MESSAGE1
    &lt;soap:header/&gt;
    &lt;soap:body&gt;
    &lt;tns:m2&gt;
    &lt;tns:GetCompanyInfoResult&gt;
    Blah Blah....
    &lt;/tns:GetCompanyInfoResult&gt;
    &lt;tns:docs&gt;
    Blah Blah....
    &lt;/tns:docs&gt; Assume no data for 'logo', so it's not returned. Since all its elements can be nillable.
    &lt;tns:m2&gt;
    &lt;/soap:body&gt;
    &lt;/soap:Envelope&gt;
    First of all, is this SOAP response is valid? I'm not sure about *'message' and 'parts' in SOAP*, but according to XML schema standards it's invalid.
    Because, according to *'message' m2, 'logo' is missing*, eventhough all it's elements are nillable in such case there should be *&lt;logo/&gt;* at the end.
    I mean valid message should be like below
    &lt;soap:Envelope&gt; '*MESSAGE2*'
    &lt;soap:header/&gt;
    &lt;soap:body&gt;
    &lt;tns:m2&gt;
    &lt;tns:GetCompanyInfoResult&gt;
    Blah Blah....
    &lt;/tns:GetCompanyInfoResult&gt;
    &lt;tns:docs&gt;
    Blah Blah....
    &lt;/tns:docs&gt;
    *&lt;tns:logo/&gt; ------------------&gt; here is the change compared to above message. empty element.*
    &lt;tns:m2&gt;
    &lt;/soap:body&gt;
    &lt;/soap:Envelope&gt;
    Now the concerns are :
    (1) Which is a valid response? Message1 or Message2
    (2) If message1 is valid then why is weblogic throwing an exception 'null SOAP element', I suppose this is due to missing 'logo' element.
    (To confirm this I've used tcpmonitor and found message1 as response but weblogic is still throwing 'null SOAP Element' exception,
    which confirms it needs 'logo' as well, I suppose &lt;logo/&gt; at least). Is there any workaround for this in weblogic for multi-part messages?
    (3) If message1 is invalid according to SOAP standards then You've answered my question. ---&gt; I need to talk to the webservice provider in this case.....
    Thanks in advance...

    Message 1 is not Basic Profile 1.1 compliant. It is specified by BP1.1 in section 4.4.1(http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#Bindings_and_Parts) that when a wsdl:part element is defined using the type attribute, the serialization of that part in a message is equivalent to an implicit (XML Schema) qualification of a minOccurs attribute with the value "1", a maxOccurs attribute with the value "1" and a nillable attribute with the value "false".

  • CDATA element mapping in Biztalk Mapper

    Hi,
    we have a input message which has an element called ParticleName.
    an example is:
     <ns:ParticleName><![CDATA[TestingName]]></ns:ParticleName>
    There is a biztalk map which takes this message and transforms it into another.
    When i try test map, it doesn't output any value on the target ParticleName node.
      it comes as <ns:ParticleName>
                           </ns:ParticleName>
    There are 2 cases:
    a)In one case, I want only the node value (TestingName) in the target node?
    b)In the second case, i want the whole CDATA section in the target?
    Please assist.
    regards,

    Hi,
    If you want to read the values from the CDATA use custom XSLT functoid. Visit below links for your reference :
    http://stackoverflow.com/questions/10323332/how-to-parse-an-xml-dom-inside-a-cdata-element-in-xslt
    http://social.msdn.microsoft.com/Forums/en-US/a6f40a1f-583d-4339-8cf9-d70dd56b20df/cdata
    Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question
    Regards,
    Rahul Madaan
    biztalkvillage.blopspot.com

  • Will anyone please Tell me how to create a CDATA Element

    Hello Guys
    I am hammering my head to create a CDATA Element in Oracle 9i using XMLDOM Package.
    The Element structure should look like this
    <Formula>
    <![CDATA[VALVERB("AC_Fluid_Pressure_Sensor")]]>
    </Formula>
    The Code I used to create in ORACLE 10G is Given below, But The same code when I used for 9i is Not working
    field_elmt := xmldom.createelement(doc,'FORMULA');
    field_node := xmldom.appendchild(ssd_node,xmldom.makenode(field_elmt));
    -- Create a CDATA ELEMENT
    field_text := xmldom.createtextnode(doc,'CDATA ELEMENT');
    field_node := xmldom.appendchild(field_node,xmldom.makenode(xmldom.createCDATASection(doc,SSDRECORD.FORMULA)));
    field_node := xmldom.appendchild(field_node,xmldom.makenode(field_text));
    Please Help me Out.
    Regards
    Madhu

    Hi Manikandan
    i once have a similar problem using a BTE, i solved creating the data element and adding the records in TPS01 and TPS02, i tried to create a record on TBE01 and it says the same mentioning TPS01 and TPS02
    please check this link
    http://scn.sap.com/thread/3173012
    create the data element asking the authorization code to your basis and create the records
    hope this help
    Regards
    Marco Cristobal

  • CDATA element definition

    Does anyone know how a CDATA element should be defined in DTD file so that DOMParser
    will recognize it? I have the following problem: when I define in a DTD file something like
    <!ELEMENT mytag (#CDATA)>
    the DOMParser throws SAXParseException, although it seems to be the correct syntax.
    Another question: given a DOM Node, how can I get a string representing the document
    fragment stored in the tree starting at this node?
    /Sasha

    Of course, it works with PCDATA, but the point is that I want the element's content
    to be unparsed.

  • XMLParser and CDATA-Element

    Why do the XMLParser replace '<' with '<' in a CDATA-Element?
    I have a Stylesheet with an Element like this:
    <script lang...><![CDATA[
    function test(){
    for(i=0; i<2; i++)...
    }]]>
    </script>
    Now I use the oracle.xml.parser.v2.XMLParser to parse the Stylesheet in this way:
    parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    parser.parse(xslURL);
    xsldoc = parser.getDocument();
    and now I print it out this way:
    xsldoc.print(out);
    This is the result:
    ... for(i=0; i<2; i++) ...
    How can I tell him not to do this replacement? I thought all characters inside the <![CDATA[-tag wouldn't be parsed. Am I wrong?
    I use the XMLParser 9.0.1.0.0 Production                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I've found a workaround with <xsl:comment> like this:
    <script ...>
    <xsl:comment>
    <![CDATA[
    ...Javascriptcode...
    ]]>
    </xsl:comment>
    </script>
    null

  • Import server: Undefined elements exception

    Hi,
    I do have a problem with the import server. I get ,'save-update map' structural exceptions in the import server. It complains about undefined elements, and if saved the update it works for one single XML file but other still fail with similar (other element though) error. Mapping the files in the import manager just works. We are using version 5.5.41.70 here of all components. I noticed a thread which explains about sp5 patch 01, hotfix 1, which fixes this, but we're having that one already.
    I did validate the xml already against the xsd used, the xml is valid.
    Error from logfile is:
    "Some portions of this import map are out of date.<LF/>Solution: Please, Launch the Import Manager GUI, preferably using the original source file that the map was generated for, otherwise the same source file and Save Update [File-&gt;Save Update] the map.<LF/> Parent hierarchy: &lt;E1MARAM&gt;.<LF/> Undefined element: &lt;EKWSL&gt;.  ".
    Thanks,
    Wim

    Hi Wim,
    it looks like that your Import Map does not have all IDoc fields mapped to the corresponding repository fields. If you map the fields in Import Manager and choose the Save->Update option, IM adds the new mapping to the old existing one. But of course it is still possible that there are other unmapped IDoc elements which need to be mapped once manually before the Import Server can process the file automatically. The best way to solve this is creating a "Dummy" IDoc file that contains a value for each and every field. Then use this "Dummy" IDoc in Import Manager, load the Map and check the mappings. You can add/delete mappings according to your expected real data. Save->Update once again and you should not into the issue any longer.
    Best regards
    Michael

  • Dreaded "unexpect root element" exception

    For some reason, most of my subject was cutoff from my previous topic posting:
    Anyway, here is my stack trace:
    org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"CancelPenalty"). Expected elements are
         at generated.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:113)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at generated.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
         at populateDB.Populate.getCancelPenalty(Populate.java:26)
         at populateDB.Populate.main(Populate.java:13)
    --------------- linked to ------------------
    javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"CancelPenalty"). Expected elements are ]
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:298)
         at generated.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:144)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
         at populateDB.Populate.getCancelPenalty(Populate.java:26)
         at populateDB.Populate.main(Populate.java:13)
    Here are XSD and XML files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="CancelPenalty">
    <xs:sequence>
    <xs:element name="SKUGroupCancelPolicySetID" type="xs:int"/>
    <xs:element name="CancelPenaltyDefaultBool" type="xs:boolean"/>
    <xs:element name="CancelPenaltyHourCnt" type="xs:int"/>
    <xs:element name="CancelPenaltyLogID" type="xs:int"/>
    <xs:element name="CancelPenaltyCostAmt" type="xs:float"/>
    <xs:element name="CancelPenaltyCostRate" type="xs:float"/>
    <xs:element name="CancelPenaltyCostDayCnt" type="xs:int"/>
    <xs:element name="CancelPenaltyPriceAmt" type="xs:float"/>
    <xs:element name="CancelPenaltyPriceRate" type="xs:float"/>
    <xs:element name="CancelPenaltyPriceDayCnt" type="xs:int"/>
    <xs:element name="UpdateTPID" type="xs:int"/>
    <xs:element name="UpdateTUID" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    ?xml version="1.0" encoding="UTF-8" ?>
    <CancelPenalty>
    <SKUGroupCancelPolicySetID>27950</SKUGroupCancelPolicySetID>
    <CancelPenaltyDefaultBool>1</CancelPenaltyDefaultBool>
    <CancelPenaltyHourCnt>0</CancelPenaltyHourCnt>
    <CancelPenaltyLogID>1211679</CancelPenaltyLogID>
    <CancelPenaltyCostAmt>0</CancelPenaltyCostAmt>
    <CancelPenaltyCostRate>.0000</CancelPenaltyCostRate>
    <CancelPenaltyCostDayCnt>0</CancelPenaltyCostDayCnt>
    <CancelPenaltyPriceAmt>0</CancelPenaltyPriceAmt>
    <CancelPenaltyPriceRate>1.0000</CancelPenaltyPriceRate>
    <CancelPenaltyPriceDayCnt>0</CancelPenaltyPriceDayCnt>
    <UpdateTPID>20001</UpdateTPID>
    <UpdateTUID>49627832</UpdateTUID>
    </CancelPenalty>
    And my main program:
    public static void getCancelPenalty() {
    String jaxbContext = "generated";
    String cancelPenaltyFilename = "CancelPenaltyOne.xml";
    JAXBContext jc = null;
    Unmarshaller u = null;
    CancelPenaltyImpl cancelPenalty = null;
    try {
    jc = JAXBContext.newInstance(jaxbContext);
    u = jc.createUnmarshaller();
    cancelPenalty = (CancelPenaltyImpl) u.unmarshal(
    new FileInputStream(cancelPenaltyFilename));
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    int updateTUID = cancelPenalty.getUpdateTUID();
    System.out.println("These values were retrieved from " +
    "the Cancel Penalty object:");
    System.out.println("UpdateTUID: "+ updateTUID);
    }

    I simplified my schema and xml file to be:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="CancelPenalty">
    <xs:sequence>
    <xs:element name="UpdateTUID" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <?xml version="1.0" encoding="UTF-8" ?>
    <CancelPenalty>
    <UpdateTUID>1</UpdateTUID>
    </CancelPenalty>
    Appreciate any help on this.
    Matthew

  • No such element exception when applet window closed

    My applet can throw a NoSuchElementException as it closes during sudden death. The Java Console reports:
    Exception in thread "AWT-EventQueue-2" java.util.NoSuchElementException
         at java.util.LinkedList.getFirst(Unknown Source)
         at java.awt.SequencedEvent.getFirst(Unknown Source)
         at java.awt.SequencedEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)Sometimes that sequence displays once, sometimes twice. The error appears to be 90% or more repeatable.
    1) open link in new window http://r0k.us/graphics/SIHwheel.html
    2) view Color Log (menu item Help -=> Show Log)
    3) close the whole browser window
    It does not appear to happen without the dialog for the Color Log displayed. Nor does it appear to happen simply upon leaving that page. I'm guessing it is some sort of race condition as the applet is shut down and it doesn't have the surrounding window it started with. It only happens when running as an applet. When ran as a program, it always shuts down cleanly.
    It occurs less often if you:
    1) open the link in new window
    2) leave the page
    ) come back to it while the Java Console is still alive (before JVM goes away)
    3) view the Color Log
    4) close the browser window.
    I am running 64-bit Windows 7, and have observed this problem in Firefox, IE, and Chrome.
    With no hints as to where within my code this is occurring (if indeed it is within "my" code), I have no idea how to write an SSCCE. The exception seems to relate to enumerations, which I believe must be occuring during the shut down seqence. See:
    * http://download.oracle.com/javase/1.5.0/docs/api/java/util/NoSuchElementException.html
    What can I try doing to prevent the error from occurring? (Besides not closing the browser window while my applet is running and has a dialog open. ;) )
    *(added immediately before posting)* I just noticed that if any of the first three dialogs in the Help Menu are open, this behavior can occur. So it probably has nothing to do with the tables in the Color Log. The fourth, About, item is a simpler modal dialog, and you aren't even able to close the browser window while it is open.
    Now that I know the crash can happen with any of the non-modal dialogs, I will write an SSCCE, just to see if it occurs in a much simpler applet, if nothing else.

    As promised, an SSCCE with build instructions and an applet environment.
    CloseMyWindow.java import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.*;
    public class CloseMyWindow  extends JApplet
        public JPanel makeContent() {
         JButton help = new JButton("Help");
         help.addActionListener( new ActionListener() {
             public void actionPerformed(ActionEvent e) {
              Dimension size = new Dimension(400, 250);
              HelpBox hb = new HelpBox("CloseMyWindow Help",
                  "cmwHelp.html", false, size);
         JPanel jp = new JPanel();
         jp.add(help);
         return jp;
        // method expected by applets
        public void init()
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
              public void run() {
                  JPanel frame = makeContent();
                  setContentPane(frame);
         } catch (Exception e) {
             System.err.println("makeContent() failed to complete: " + e);
             e.printStackTrace();
        public static void main(String[] args)
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.add(new CloseMyWindow().makeContent());
                    frame.pack();
                    frame.setVisible(true);
    class HelpBox extends JDialog
    {   // general window for display of HTML page
        HelpBox(String title, String pUrlS, boolean modal, Dimension pSize)
         super((Frame)null, title, modal);
         final String     urlS  = pUrlS;
         final Dimension     size  = pSize;
         SwingUtilities.invokeLater(new Runnable() {
             public void run() {
              setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
              JEditorPane ep = new JEditorPane();
              ep.setEditable(false);
              try {
                  URL url = getClass().getResource(urlS);
                  ep.setPage(url);
                  JScrollPane eps = new JScrollPane(ep);
                  eps.setPreferredSize(size);
                  getContentPane().add(eps, BorderLayout.CENTER);
              } catch (IOException ioE) {
                  System.err.println("Unable to display help pane");
                  ioE.printStackTrace();
              pack();
              setLocationRelativeTo(null);
              setVisible(true);
    }cmwManifest.txt (be sure to end line with a carriage return) Main-Class: CloseMyWindowcmwHelp.html <html>
    <head><title>Help for CloseMyWindow</title></head>
    <body>
    Good, you've opened this dialog.  Now close the browser window containing
    my applet.
    </applet>
    </body>
    </html>cmw.html <html>
    <head><title>Close My Window</title></head>
    <body>
    <applet code="CloseMyWindow.class"
            archive="CloseMyWindow.jar"
            width="450" height="300">
    Your browser is completely ignoring the <i>applet</i> tag!
    </applet>
    </body>
    </html>1) capture the 4 code segments above and save them as correspondingly-named files.
    2) compile:
    ] javac CloseMyWindow.java
    3) build the jar:
    ] jar cvfm CloseMyWindow.jar cmwManifest.txt *.class cmwHelp.html
    4) test the jar:
    ] java -jar CloseMyWindow.jar
    5) run the applet. Open page cmw.html in a new browser window
    6) enable Java Console (mine is set to autostart on any applet or JNLP)
    7) click the applet's Help button. A new dialog should open up.
    8) close the browser window
    9) observe if an error is reported in Java Console
    I am seeing the error in this small applet. Maybe the .java file will give you guys some clues.

  • How would I get information out of a Cdata tag?

    Read in CDATA[] based information? I can never find out how to access the data inside of Cdata. Any one got any ideas? we never covered this in school and google just confuses me. So how do you get all the data out of Cdata to do what ever with it? this is for converting xml to cvs - which I think I can do, I just need to get the data out of cdata ...
    Edited by: 910481 on 26-Jan-2012 20:35

    Ok so now I have some code but its spitting out the second return, which states "there isn't anything there"
    package xmlcsv;
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.CharacterData;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    * @author Adam Balan
    public class XmlCSV {
          * @param args
         public static void main(String[] args) throws Exception {
              File file = new File("Data.xml");
              DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              Document doc = db.parse(file);
              NodeList nodes = doc.getElementsByTagName("TransmissionWrapper");
              for (int i = 0; i< nodes.getLength(); i++){
                   Element element = (Element) nodes.item(i);
                   NodeList cData = element.getElementsByTagName("TransmissionData");
                   Element line = (Element) cData.item(0);
                   //test
                   System.out.println("Data: " + getCData(line));
          * We want to get all the data out of the CData Section
          * @param e
          * @return
         public static final String getCData(Element e)
              Node child = e.getFirstChild();
              if(child instanceof CharacterData)
                   CharacterData cd = (CharacterData) child;
                   return cd.getData();
              return "Theres nothing there";
    }the tag would be:
    <TransmissionWrapper>
        <TransmissionData Name="bla" Value="bla bla">
           <![Cdata[Bla|bla]]>
        </TransmissionData>
    </TransmissionWrapper>So...What am I doing wrong for it to spit out: Theres nothing there
    Thanks for your help and paitence
    Edited by: Salacious on 27-Jan-2012 11:46
    Edited by: Salacious on 27-Jan-2012 11:46

  • How to get a value from the previous element (XSLT/XPATH gurus ahoy!)

    Hi All,
    I am building an RTF template for a "letter of reference"-report. Sometimes there are several rows in the data, that need to be printed as one. This is due to consecutive temporary contracts, which will be printed out as one period of service.
    Here's a simplified data example to illustrate the problem.
    <ROW>
    <START_DATE>01-01-1980</START_DATE>
    <END_DATE>01-01-1988</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-1988</START_DATE>
    <END_DATE>01-01-1990</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-2000</START_DATE>
    <END_DATE>01-01-2005</END_DATE>
    </ROW>
    With the data above, I should print two lines:
    01-01-1980 - 01-01-1990
    01-01-2000 - 01-01-2005
    I need to compare START_DATE of an element (except for the first one) with the END_DATE of the previous element, to find out whether to print the END_DATE for that element or not. How can I get that value from the previous element?
    Thanks & Regards, Matilda

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • Elements default format appear as blocks instead of inline text

    I am creating an EDD and I have some issues with the way FrameMaker breaks each element instead of leaving it inline. This wouldn't be a problem if I was allowed to format children instead of elements; then I could fix the problems I am having.
    Short question is, is there a way to tell FrameMaker to open unformatted elements inline instead of as blocks?
    For instance, I have acronym elements within the text that wrap the definition and then wrap the term. When formatting it, it must show up as text and then the acronym after it with parentheses around it. I was able to make that happen by using run-ins, but the acronym element itself is no longer a part of the para. It is broken down to its own paragraph.
    Example: <para>Reference will be made to the <acronym><def>Air Force</def><term>AF</term></acronym> serial number.</para>
    should look like this:
    Reference will be made to the Air Force (AF) serial number.
    but instead looks like this:
    Reference will be made to the
    Air Force (AF) serial number.
    because I can't edit the EDD to have any para element with an acronym within it to format as a run-in.

    If you have solved the problem, fine; but let me clarify a few things:
    Example: <para>Reference will be made to the <acronym><def>Air Force</def><term>AF</term></acronym> serial number.</para>
    I also have <acronym> as a text range and it does not appear inline; it is still blocked as a paragraph.
    The FrameMaker EDD rules assume every element is to be formatted as a paragraph unless you tell it otherwise. Giving the acronym element text range formatting (inline) is not enough; you must also set def and term elements to be text range. This is a little bit of a guess on my part, because I have never tried putting paragraph-formatted elements inside a text-range-formatted element.
    Regarding the children without parents, the parent is there in the structure view but when typing down through the page view to make sure paragraph tags were placed correctly, some don't appear.
    This is still not clear; every element (except the document root element) must have a parent; othewise, the structure is invalid. You see the parent in the structure view, so the parent IS there.
    Not every element has to have a paragraph tag associated with it. The typical examples are elements that serve no formatting purpose but simply contain other elements. For example, suppose you have a chapter that has several sections. Each section may have a title element and several paragraph elements. The title element and the paragraph elements are formatted as paragraphs, each with a paragraph tag (if the EDD assigns paragraph tags). The containing section element does not have a paragraph tag; it simply contains the title and paragraph elements.
    NOTE that the EDD can assign formatting without assigning a paragraph tag. Maybe this is the cause of your concern. If your EDD is doing this, then some elements will not have tags, even thought the formatting is correct. {CAVEAT: My EDD assigns a default format list to the root element in a document. Except for a very few elements, all formatting is done as overrides to the default tag. In my case, each element displays the same tag, the default tag. I am not sure what happens when NO tag is assigned as the default.}}
    I haven't even begun to grasp how I'm going to work out building the
    LEP, TOC, LOI, LOT, and Indices yet. I know the build can be done
    manually, because I've done it and have templates for that already
    (although they are about ten years old).
    You likely need not do these lists manually. In a structured document or book, you can create these lists either as lists of paragraph tags (as one does in unstructured documents) or as lists of elements (for example, an LOT is a list of Table elements, if Table is the name of your table element). The elements in the list need not have paragraph tags in the document; typically they do not. See the FrameMaker user manual for details.
    Van

  • How to remoce CDATA tag from XSLT mapping

    Hi Sharma,
    Please remove all CDATA elements from your code and execute so that you will get expected output. Because CDATA term we will use while writing
    DTD for your source xml, so this is not required in XSL Program.  check below code....
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <DlrDiscItemWise>
                   <DlrDiscItemWiseXML>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                        <xsl:copy-of select="."/>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                   </DlrDiscItemWiseXML>
              </DlrDiscItemWise>
         </xsl:template>
    </xsl:stylesheet>
    thanks,
    madhu

    Thanks Madhusudan, but i doubt it wil work by removing all CDATA tags. I removed and this is the response. Please check
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <DlrDiscItemWise>
                   <DlrDiscItemWiseXML>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                        <xsl:copy-of select="."/>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                        <xsl:text disable-output-escaping="yes"></xsl:text>
                   </DlrDiscItemWiseXML>
              </DlrDiscItemWise>
         </xsl:template>
    </xsl:stylesheet>
    result
    <?xml version="1.0" encoding="UTF-8"?><DlrDiscItemWise><DlrDiscItemWiseXML><ns0:MT_DlrDis_Sender xmlns:ns0="http://MTSINDIA/TC/DealerDiscount"><ITEM><nDlrAddEdit>1</nDlrAddEdit><nItemCode>1001000080</nItemCode><nItemDisc>15</nItemDisc><dtDiscFromdt>11/May/2010</dtDiscFromdt><dtDiscToDt>31/Dec/2010</dtDiscToDt><nItemAddDisc/><dtAddDiscFromDt/><dtAddDiscToDt/><nDlrTypeCode/><nItemDisQtyMulti/><nItemDiscQtyFree/><sItemDiscPerAmt/><sItemDiscType/><nDlrCode>1001</nDlrCode><nCircleCode>4</nCircleCode></ITEM></ns0:MT_DlrDis_Sender></DlrDiscItemWiseXML></DlrDiscItemWise>
    But in target structure I am not able to see it as single string.
    Please suggest

  • Adapter Engine handling for CDATA in XML

    Gurus:
    I had a question on the Dapter Engines behavious, specifically the SOAP Sender.
    The Source is sending something like:
               <Data><![CDATA[<?xml version="1.0" encoding="ISO-8859-1" ?><response><forms><form ObjectId="4070" Form_Name="P40 Action"><EMP_NAME>Howard Roark</EMP_NAME><PERNR>P1111111</PERNR><WORKAUTH></WORKAUTH><HR_NAME>Scott Manager</HR_NAME><HR_PNUM>P1234567</HR_PNUM><ESIG>Scott Manager</ESIG><ELECTRONIC_SIGNATURE>Scott Manager (electronically signed)</ELECTRONIC_SIGNATURE><ESIG_VERIFICATION>Scott.Manager [Tue Jun 2 12:03:56 EDT 2009]</ESIG_VERIFICATION><ESIG_DATE>06/02/2009</ESIG_DATE></form></forms></response>]]></Data>
             </GetFormXMLResult>
    What the Integration Engine sees is the Data elelment with the CDATA section trimmed, i.e., it sees:
    <Data> <?xml version="1.0" encoding="ISO-8859-1" ?><response><forms><form ObjectId="4070" Form_Name="P40 Action"><EMP_NAME>Howard Roark</EMP_NAME><PERNR>P1111111</PERNR><WORKAUTH></WORKAUTH><HR_NAME>Scott Manager</HR_NAME><HR_PNUM>P1234567</HR_PNUM><ESIG>Scott Manager</ESIG><ELECTRONIC_SIGNATURE>Scott Manager (electronically signed)</ELECTRONIC_SIGNATURE><ESIG_VERIFICATION>Scott.Manager [Tue Jun 2 12:03:56 EDT 2009]</ESIG_VERIFICATION><ESIG_DATE>06/02/2009</ESIG_DATE></form></forms></response> </Data>
    Is this an issue with the Aapter Engine, or has anyone come accross this before? This is on PI7.0 SPS 13.
    Thanks
    Feroz

    Hi,
    the CDATA section should not be a problem. It's mostly used to include information / XML in one tag and to include special characters that should not be changed or ignored by the system. All informaiton within a CDATA element is ignored by PI and handled as "blackbox" string. PI just receives it and passes it out without really looking what's inside the tag.
    If you want to extract what's inside the CDATA element, you need to use an XSLT in your mapping (see: Handling CDATA in PI)
    Regards,
    Kai

Maybe you are looking for

  • MacBook Power Consumption

    We operate tens of macbooks at our campus for student loans. We are trying to cut on the power consumption of the loans operation. I am interested to know how much power does the power brick consume when: a) nothing is connected to the MagSafe jack.

  • How to send a new text message without appending it to a previous message to the intended recipient

    I have a new iPhone 5c with IOS 7. When I try to send a new text message to my sister, the new message is appended to an old one I sent her. I do not want to delete the old one, but I don't want the new message tied to the old one. How might I get ar

  • Purchase Group - Purchase Executive

    Hi, Each Purchase Group has 3 executives.  when PR is generated it will generate for PG only,  Here the requirement is after creating the PR, based on Purchase Group, he will assign to the respective executive for further processing.  How can it be m

  • Fall back systemwhen multiple SAP systems trying to acheive SSO with BOEXI

    Friends, I need a small clarification on ' SSO between BOE XI 3.1 and SAP BI 7' Scenario, Say when multiple users log on through their  SAP EP Portals or Netwever Portals, they use their tokens generated by their respective EP portals which are passe

  • Question about JEditorPane

    I've loaded a HTML in e JEditorPane. What I want is to get html's tag <TITLE>. I've tried whith HTMLDocument htmlDoc = (HTMLDocument)jep.getDocument(); //where jep is JEditorPane Element root = htmlDoc.getDefaultRootElement(); // Extract root element