Hi,

Please help me on this, struck for a long time.

I am getting the following error....

ERROR
======

Exception in thread "main" org.exolab.castor.xml.MarshalException: Illegal
Text data found as child of: Error_Msg
  value: "<ns0:ErrorReport
xmlns:ns0="http://www.tibco.com/pe/EngineTypes";><StackTrace>error generated
by Generate Error&#xD;
        at
com.tibco.pe.core.GenerateErrorActivity.eval(GenerateErrorActivity.java:150)&#xD;
        at com.tibco.pe.plugin.Activity.eval(Activity.java:209)&#xD;
        at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:541)&#xD;
        at com.tibco.pe.core.Job.a(Job.java:709)&#xD;
        at com.tibco.pe.core.Job.l(Job.java:499)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)&#xD;
</StackTrace><Msg>error generated by Generate
Error</Msg><FullClass>com.tibco.pe.plugin.ActivityException</FullClass><Class>ActivityException</Class><ProcessStack>HISTemplate-WithoutResolution/Starter
Process/Order Books.process/Inventory
Check&gt;HISTemplate-WithoutResolution/SubProces/Check
Inventory.process/Generate
Error</ProcessStack><MsgCode>-</MsgCode><Data><ns1:Error_Prop
xmlns:ns1="http://xmlns.example.com/unique/default/namespace/1099955715563";><ns1:ActivityName>INV</ns1:ActivityName><ns1:ErrorFlag>true</ns1:ErrorFlag></ns1:Error_Prop></Data></ns0:ErrorReport>"{File:
; line: 39; column: 713}
        at
org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:755)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:721)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)
        at Test3.main(Test3.java:25)
Caused by: org.xml.sax.SAXException: Illegal Text data found as child of:
Error_Msg
  value: "<ns0:ErrorReport
xmlns:ns0="http://www.tibco.com/pe/EngineTypes";><StackTrace>error generated
by Generate Error&#xD;
        at
com.tibco.pe.core.GenerateErrorActivity.eval(GenerateErrorActivity.java:150)&#xD;
        at com.tibco.pe.plugin.Activity.eval(Activity.java:209)&#xD;
        at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:541)&#xD;
        at com.tibco.pe.core.Job.a(Job.java:709)&#xD;
        at com.tibco.pe.core.Job.l(Job.java:499)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)&#xD;
</StackTrace><Msg>error generated by Generate
Error</Msg><FullClass>com.tibco.pe.plugin.ActivityException</FullClass><Class>ActivityException</Class><ProcessStack>HISTemplate-WithoutResolution/Starter
Process/Order Books.process/Inventory
Check&gt;HISTemplate-WithoutResolution/SubProces/Check
Inventory.process/Generate
Error</ProcessStack><MsgCode>-</MsgCode><Data><ns1:Error_Prop
xmlns:ns1="http://xmlns.example.com/unique/default/namespace/1099955715563";><ns1:ActivityName>INV</ns1:ActivityName><ns1:ErrorFlag>true</ns1:ErrorFlag></ns1:Error_Prop></Data></ns0:ErrorReport>"
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:860)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:1099)
        at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
        at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
        ... 2 more
Caused by: org.xml.sax.SAXException: Illegal Text data found as child of:
Error_Msg
  value: "<ns0:ErrorReport
xmlns:ns0="http://www.tibco.com/pe/EngineTypes";><StackTrace>error generated
by Generate Error&#xD;
        at
com.tibco.pe.core.GenerateErrorActivity.eval(GenerateErrorActivity.java:150)&#xD;
        at com.tibco.pe.plugin.Activity.eval(Activity.java:209)&#xD;
        at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:541)&#xD;
        at com.tibco.pe.core.Job.a(Job.java:709)&#xD;
        at com.tibco.pe.core.Job.l(Job.java:499)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)&#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)&#xD;
</StackTrace><Msg>error generated by Generate
Error</Msg><FullClass>com.tibco.pe.plugin.ActivityException</FullClass><Class>ActivityException</Class><ProcessStack>HISTemplate-WithoutResolution/Starter
Process/Order Books.process/Inventory
Check&gt;HISTemplate-WithoutResolution/SubProces/Check
Inventory.process/Generate
Error</ProcessStack><MsgCode>-</MsgCode><Data><ns1:Error_Prop
xmlns:ns1="http://xmlns.example.com/unique/default/namespace/1099955715563";><ns1:ActivityName>INV</ns1:ActivityName><ns1:ErrorFlag>true</ns1:ErrorFlag></ns1:Error_Prop></Data></ns0:ErrorReport>"
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:860)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:1099)
        at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
        at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)
        at Test3.main(Test3.java:25)

My Java Code is as follows

public class Test3 {
          public static void main(String args[]) throws MappingException,
XMLException, ValidationException, XmlException {
               try{
                Log log =LogFactory.getLog(Test3.class);
                
                FileReader reader = new FileReader("GenXML.xml"); 
                
                Unmarshaller unmarshaller = new Unmarshaller(Envelope.class);
                unmarshaller.setIgnoreExtraAttributes(true); 
                unmarshaller.setIgnoreExtraElements(true); 
                Envelope envelope;
                envelope = (Envelope)unmarshaller.unmarshal(reader);
                
                System.out.print( envelope.getBody() .getExceptionInfo()
.getError_Msg()   + ":" + 
                                   envelope.getBody() .getExceptionInfo() 
.getEventData() );
            

            } catch (IOException e) {
              System.out.println(e.toString() );
            }

And my XML is..
==============

<?xml version="1.0" encoding="UTF-8"?>
<Error_Msg>&lt;ns0:ErrorReport
xmlns:ns0="http://www.tibco.com/pe/EngineTypes"&gt;&lt;StackTrace&gt;error
generated by Generate Error&amp;#xD;
        at
com.tibco.pe.core.GenerateErrorActivity.eval(GenerateErrorActivity.java:150)&amp;#xD;
        at com.tibco.pe.plugin.Activity.eval(Activity.java:209)&amp;#xD;
        at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:541)&amp;#xD;
        at com.tibco.pe.core.Job.a(Job.java:709)&amp;#xD;
        at com.tibco.pe.core.Job.l(Job.java:499)&amp;#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)&amp;#xD;
        at
com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)&amp;#xD;
&lt;/StackTrace&gt;&lt;Msg&gt;error generated by Generate
Error&lt;/Msg&gt;&lt;FullClass&gt;com.tibco.pe.plugin.ActivityException&lt;/FullClass&gt;&lt;Class&gt;ActivityException&lt;/Class&gt;&lt;ProcessStack&gt;HISTemplate-WithoutResolution/Starter
Process/Order Books.process/Inventory
Check&amp;gt;HISTemplate-WithoutResolution/SubProces/Check
Inventory.process/Generate
Error&lt;/ProcessStack&gt;&lt;MsgCode&gt;-&lt;/MsgCode&gt;&lt;Data&gt;&lt;ns1:Error_Prop
xmlns:ns1="http://xmlns.example.com/unique/default/namespace/1099955715563"&gt;&lt;ns1:ActivityName&gt;INV&lt;/ns1:ActivityName&gt;&lt;ns1:ErrorFlag&gt;true&lt;/ns1:ErrorFlag&gt;&lt;/ns1:Error_Prop&gt;&lt;/Data&gt;&lt;/ns0:ErrorReport&gt;</Error_Msg>

            <EventData>&lt;Order
xmlns="http://www.hydus.com/HIS/Order"&gt;&lt;OrderID&gt;2-1&lt;/OrderID&gt;&lt;OrderDate&gt;2007-10-15T10:29:09.125-05:00&lt;/OrderDate&gt;&lt;ISBN_Number&gt;123-111-1112-1&lt;/ISBN_Number&gt;&lt;BookName&gt;Java
Programming&lt;/BookName&gt;&lt;Quantity&gt;1&lt;/Quantity&gt;&lt;CreditCardNum&gt;4444
4444 4444
4444&lt;/CreditCardNum&gt;&lt;ExpirationDate&gt;07/07&lt;/ExpirationDate&gt;&lt;/Order&gt;</EventData>

Where Error_Msg and EventData are defined as 

<xs:element name = "Error_Msg" type = "xs:anyType"/>
<xs:element name = "EventData" type = "xs:anyType"/>

Please help me on this. For EventData it was working fine but not able to
get exact value for Error_Msg. None of the posts have appropriate solution.

-Kiran

-- 
View this message in context: 
http://www.nabble.com/Illegal-Text-data-found-as-child-of%3A-Error_Msg-tf4715722.html#a13480471
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to