Hello Stephen,

Thank you for the swift reply - the stacktrace produced by the exception follows:

Error: The namespace associated with the prefix 'xsi' could not be resolved.
The namespace associated with the prefix 'xsi' could not be resolved.
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:589) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:735) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:848)
       at simplestuff.TestJDOM.unformMessage(TestJDOM.java:138)
       at simplestuff.TestJDOM.sendMessage(TestJDOM.java:67)
       at simplestuff.TestJDOM.main(TestJDOM.java:226)
Caused by: org.xml.sax.SAXException: The namespace associated with the prefix 'xsi' could not be resolved. at org.exolab.castor.xml.UnmarshalHandler.processAttributeList(UnmarshalHandler.java:3186) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1429) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:245) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.processChildren(DOMEventProducer.java:333) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:247) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.java:110) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:584)
       ... 5 more
Caused by: org.xml.sax.SAXException: The namespace associated with the prefix 'xsi' could not be resolved. at org.exolab.castor.xml.UnmarshalHandler.processAttributeList(UnmarshalHandler.java:3186) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1429) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:245) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.processChildren(DOMEventProducer.java:333) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:247) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.java:110) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:584) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:735) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:848)
       at simplestuff.TestJDOM.unformMessage(TestJDOM.java:138)
       at simplestuff.TestJDOM.sendMessage(TestJDOM.java:67)
       at simplestuff.TestJDOM.main(TestJDOM.java:226)
Caused by: org.xml.sax.SAXException: The namespace associated with the prefix 'xsi' could not be resolved. at org.exolab.castor.xml.UnmarshalHandler.processAttributeList(UnmarshalHandler.java:3186) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1429) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:245) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.processChildren(DOMEventProducer.java:333) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:247) at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.java:182) at org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.java:110) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:584) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:735) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:848)
       at simplestuff.TestJDOM.unformMessage(TestJDOM.java:138)
       at simplestuff.TestJDOM.sendMessage(TestJDOM.java:67)
       at simplestuff.TestJDOM.main(TestJDOM.java:226)
BUILD SUCCESSFUL (total time: 7 seconds)


Stephen Bash wrote:

Steve-

Can you post the stack trace from this error?  It would help in
localizing the problem.

Thanks,
Stephen


On 4/4/06, Steve Pitchford <[EMAIL PROTECTED]> wrote:
Hi,

I am getting the following error when trying to unmarshall an array-list
from an org.w3c.dom.Node
into castor:

Error: The namespace associated with the prefix 'xsi' could not be resolved.

I pass the following xml into an axis soap client:

<SOAP-ENV:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:java='java' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body>
  <array-list>
     <greeting-planet
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:type='java:genbeans.GreetingPlanet'>
        <planet>Hello</planet>
        <greeting>World</greeting>
     </greeting-planet>
     <greeting-planet>
        <planet>Bonjour</planet>
        <greeting>le monde</greeting>
     </greeting-planet>
  </array-list>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is then returned from Axis using the following code ( axis returns
a soap envelope):

  SOAPBody sb = envelope.getBody();
  org.w3c.dom.Node result = sb.getFirstChild();

  if ( result != null)
  {
     Unmarshaller unmar = new Unmarshaller();
     Object o = null;
     try
     {
        unmar.setValidation(true);
        o = unmar.unmarshal(c,result);
     }
     catch ( Exception e )
     {
        System.out.println("Error: "+e.toString());
     }

     return o;
  }

  return null;

I used some code I found on the web to output the xml stored in result -
I got the following:

<?xml version="1.0" encoding="UTF-8"?>
<array-list>
   <greeting-planet
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="java:genbeans.GreetingPlanet">
       <planet>Hello</planet>
       <greeting>World</greeting>
   </greeting-planet>
   <greeting-planet>
       <planet>Bonjour</planet>
       <greeting>le monde</greeting>
   </greeting-planet>
</array-list>

As you can see - the xsi namespace seems to be specified.

I am using Castor 1.0M2

Any help would be much appreciatted.

Cheers,

Steve


-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to