null exception when uploading file

Using Hermes with JBoss

null exception when uploading file

Postby buk » Wed Feb 06, 2008 6:07 am

Hi, I keep getting an exception error when sending xml message. I've had our support team look into logs and they have asked if default schema can be changed. Instead of parsing with SAX Parser, to use the XML schema. Or to set SAX not to validate xml file?

I've attached the XML file.

<MTOSI_Envelope mlns="tmf854.v1">
<MTOSI_Header>
<domain>Inventory</domain>
<activityName>getInventory</activityName>
<msgName>getInventoryRequest</msgName>
<msgType>REQUEST</msgType>
<payloadVersion>1.0</payloadVersion>
<senderURI>queue/OMSResponseQueue</senderURI>
<destinationURI>queue/OMSRequestQueue</destinationURI>
<failureReplytoURI>queue/OMSResponseQueue</failureReplytoURI>
<communicationPattern>BulkResponse</communicationPattern>
<communicationStyle>MSG</communicationStyle>
<fileLocationURI>ftp://root:password@11.2.1.17/mtosi/ME200801081007.zip</fileLocationURI>
<compressionType>GZIP</compressionType><timestamp>20080204121219.484+0000</timestamp>
</MTOSI_Header>
<MTOSI_Body>
<getInventory_T xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="getInventory_T">
<filter><includedObjectType><objectType>ME</objectType><granularity>FULL</granularity></includedObjectType></filter>
</getInventory_T></MTOSI_Body></MTOSI_Envelope>
buk
 
Posts: 2
Joined: Wed Feb 06, 2008 5:32 am

Re: null exception when uploading file

Postby Colin » Wed Feb 06, 2008 11:20 am

Hi,

Can you tell me what the exception and stack trace is in the hermes.log file?

Which version of Hermes are you using?

Can you check you have the same problem in the lasest build at http://hermesjms.com/patches?

Regards,

Colin.
Colin
Site Admin
 
Posts: 913
Joined: Sun Sep 19, 2004 4:49 pm
Location: London, UK

Re: null exception when uploading file

Postby buk » Wed Feb 06, 2008 12:16 pm

Colin,

I am using version 1.12. I havent tried the latest version, will give it a go tomorrow. The log shows

2008-02-06 17:05:37,649 [Hermes ThreadPool-1] ERROR hermes.impl.DefaultXMLHelper -
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"MTOSI_Envelope"). Expected elements are <{}content>]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
at hermes.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:144)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at hermes.impl.DefaultXMLHelper.readContent(DefaultXMLHelper.java:110)
at hermes.impl.DefaultXMLHelper.fromXML(DefaultXMLHelper.java:145)
at hermes.impl.DefaultHermesImpl.fromXML(DefaultHermesImpl.java:1160)
at hermes.browser.tasks.SendMessageTask.invoke(SendMessageTask.java:137)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"MTOSI_Envelope"). Expected elements are <{}content>
at hermes.xml.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:114)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at hermes.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
... 9 more
2008-02-06 17:05:37,665 [Hermes ThreadPool-1] DEBUG hermes.impl.jms.ThreadLocalSessionManager - all sessions closed, closing Connection
2008-02-06 17:05:37,665 [Hermes ThreadPool-1] DEBUG hermes.browser.HermesBrowser - Connection TestSession closed
2008-02-06 17:05:37,665 [Hermes ThreadPool-1] ERROR hermes.browser.tasks.HermesBrowserTaskListener - No message, linked exception is : null
hermes.HermesException: No message, linked exception is : null
at hermes.impl.DefaultXMLHelper.fromXML(DefaultXMLHelper.java:151)
at hermes.impl.DefaultHermesImpl.fromXML(DefaultHermesImpl.java:1160)
at hermes.browser.tasks.SendMessageTask.invoke(SendMessageTask.java:137)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"MTOSI_Envelope"). Expected elements are <{}content>]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
at hermes.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:144)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at hermes.impl.DefaultXMLHelper.readContent(DefaultXMLHelper.java:110)
at hermes.impl.DefaultXMLHelper.fromXML(DefaultXMLHelper.java:145)
at hermes.impl.DefaultHermesImpl.fromXML(DefaultHermesImpl.java:1160)
at hermes.browser.tasks.SendMessageTask.invoke(SendMessageTask.java:137)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"MTOSI_Envelope"). Expected elements are <{}content>
at hermes.xml.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:114)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at hermes.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
... 9 more
2008-02-06 17:05:37,665 [Hermes ThreadPool-1] DEBUG hermes.browser.tasks.ThreadPool - task hermes.browser.tasks.SendMessageTask@de6b02 stoppe
buk
 
Posts: 2
Joined: Wed Feb 06, 2008 5:32 am

Re: null exception when uploading file

Postby Colin » Wed Feb 06, 2008 1:33 pm

Read this section about what hermes means when it talks about hermes XML files:

http://hermesjms.com/confluence/display ... with+Files

To upload any XML file other than the specific jms2xml.xsd schema type, just upload them as a regular text file.

Regards,

Colin.
Colin
Site Admin
 
Posts: 913
Joined: Sun Sep 19, 2004 4:49 pm
Location: London, UK

Re: null exception when uploading file

Postby annaeholm » Wed Jun 25, 2008 7:34 am

Hi!

I have the same problem, and I can solve it by uploading the xml as a text file for sure. But I want to set header properties and I have not been able to post a text message with header properties. What should it look like?

Sample would be deeply appreciated.

Thanks,
Anna
annaeholm
 
Posts: 2
Joined: Wed Jun 25, 2008 7:32 am

Re: null exception when uploading file

Postby annaeholm » Wed Jun 25, 2008 7:45 am

Found the answer to this question in another thread. Sorry.

//Anna
annaeholm
 
Posts: 2
Joined: Wed Jun 25, 2008 7:32 am


Return to JBoss

Who is online

Users browsing this forum: No registered users and 0 guests