You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by "Millies, Sebastian" <Se...@ids-scheer.com> on 2011/01/24 18:06:09 UTC

Escaping illegal characters during (un)marshalling

Hello there,

I’m using SDO’s over an RMI binding in Tuscany 1.6.1.
I'm running into a problem when the SDO has a String attribute 
(defined as <xsd:string>) and the string contains valid UTF-8 
characters that are illegal in XML (e.g. ‘\u001f’). The SDO gets 
serialized by JAXB without escaping/encoding these bytes, effectively 
producing illegal XML. 

When I later try to unmarshal these objects, the unmarshaller crashes.
Here’s the relevant part of the stack trace:

Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
	java.io.EOFException
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
	... 41 more
Caused by: java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
	at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2774)
	at java.io.ObjectInputStream.readInt(ObjectInputStream.java:950)
	at org.apache.tuscany.sdo.spi.HelperProviderBase$ResolvableImpl.readDataObject(HelperProviderBase.java:211)
	at org.apache.tuscany.sdo.spi.HelperProviderBase$ResolvableImpl.readExternal(HelperProviderBase.java:161)
	at commonj.sdo.impl.ExternalizableDelegator.readExternal(ExternalizableDelegator.java:83)

I guess this is purely a JAXB issue? But could it not be worked around in Tuscany?

-- Sebastian

Re: Escaping illegal characters during (un)marshalling

Posted by Simon Nash <na...@apache.org>.
Millies, Sebastian wrote:
> Hello there,
> 
> I’m using SDO’s over an RMI binding in Tuscany 1.6.1.
> I'm running into a problem when the SDO has a String attribute 
> (defined as <xsd:string>) and the string contains valid UTF-8 
> characters that are illegal in XML (e.g. ‘\u001f’). The SDO gets 
> serialized by JAXB without escaping/encoding these bytes, effectively 
> producing illegal XML. 
> 
> When I later try to unmarshal these objects, the unmarshaller crashes.
> Here’s the relevant part of the stack trace:
> 
> Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
> 	java.io.EOFException
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
> 	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
> 	... 41 more
> Caused by: java.io.EOFException
> 	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
> 	at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2774)
> 	at java.io.ObjectInputStream.readInt(ObjectInputStream.java:950)
> 	at org.apache.tuscany.sdo.spi.HelperProviderBase$ResolvableImpl.readDataObject(HelperProviderBase.java:211)
> 	at org.apache.tuscany.sdo.spi.HelperProviderBase$ResolvableImpl.readExternal(HelperProviderBase.java:161)
> 	at commonj.sdo.impl.ExternalizableDelegator.readExternal(ExternalizableDelegator.java:83)
> 
> I guess this is purely a JAXB issue? But could it not be worked around in Tuscany?
> 
> -- Sebastian
 >
Why is JAXB involved when serializing an SDO?  The serialization
should be done by SDO, not by JAXB.  Can you give more details about
what you are doing in the application that results in an SDO being
serialized by JAXB?

   Simon