Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WSWS3037E: Error: Serialization cannot occur for java.lang.String

356 views
Skip to first unread message

roberto...@datatex.it

unread,
Apr 14, 2009, 11:31:51 AM4/14/09
to
fatherData)
[DEBUG] TypeMappingImpl - -getSerializer sf [null]
[DEBUG] TypeMappingImpl - -getSerializer sf [null]
[DEBUG] MCUtils - -interceptSerializationException: java.io.IOException: WSWS3037E: Error: Serialization cannot occur fo
r java.lang.String. java.io.IOException: WSWS3037E: Error: Serialization cannot occur for java.lang.String.
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.throwSerNotFound(SerializationContextImpl.jav
a:1531)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java
:960)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:550)
at com.ibm.ws.webservices.engine.encoding.ser.BeanSerializer.serializeChild(BeanSerializer.java:491)
at com.dat.abs.imp.FatherClassPojo_Ser.addElements(FatherClassPojo_Ser.java:56)
at com.dat.abs.imp.FatherClassPojo_Ser.serialize(FatherClassPojo_Ser.java:29)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java
:993)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:550)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:455)
at com.ibm.ws.webservices.engine.encoding.SerializationContextImpl.outputMultiRefs(SerializationContextImpl.java
:857)
at com.ibm.ws.webservices.engine.xmlsoap.ext.RequestResponseAlternateContent.serialize(RequestResponseAlternateC
ontent.java:118)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPElement.outputImpl(SOAPElement.java:2100)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPElement.outputContentsImpl(SOAPElement.java:2181)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPElement.outputImpl(SOAPElement.java:2156)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPEnvelope.outputImpl(SOAPEnvelope.java:367)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPElement.output(SOAPElement.java:2076)
at com.ibm.ws.webservices.engine.SOAPPart.writeTo(SOAPPart.java:921)
at com.ibm.ws.webservices.engine.SOAPPart.writeTo(SOAPPart.java:840)
at com.ibm.ws.webservices.engine.SOAPPart._getWebServicesInputSource(SOAPPart.java:974)
at com.ibm.ws.webservices.engine.SOAPPart.getString(SOAPPart.java:583)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:663)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:497)
at com.ibm.ws.webservices.engine.client.Call.invoke(Call.java:1728)
at com.ibm.ws.webservices.multiprotocol.AgnosticCall.invoke(AgnosticCall.java:171)
{code}

FatherClassPojo is my bean containing some String

At the beginning I recieve the same exception for missing serializer from my bean.
So I change my client code to register serialized (but I don't understand why I must do it... in this way my client MUST use some WebSphere classes and so it is not anymore fully complient with every engine!!!!)

{code}
javax.xml.rpc.Service vService = createService(....);
TypeMappingRegistry vTMR = vService.getTypeMappingRegistry();
TypeMapping vTM = vTMR.createTypeMapping();
vTMR.register("", vTM);
SerializerFactory vSerializerFactory = BeanSerializerFactory.createFactory(BeanSerializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
DeserializerFactory vDeserializerFactory = BeanDeserializerFactory.createFactory(BeanDeserializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
System.out.println("vDeserializerFactory : " + vDeserializerFactory);
System.out.println("vSerializerFactory : " + vSerializerFactory);
vTM.register(FatherClassPojo.class, QNAME_TYPE_FC, vSerializerFactory, vDeserializerFactory);
{code}

If I try to use the defualt Type Mapping instead to create a new one I recieve an exception "Default type mapping cannot be modified"

I add in that why all my Serialized/Deserialized... but now the java.lang.String Serialized is not found!!! crazy

I try also to add a serializer for java.lang.String using
{code}
TypeMapping vDefaultTM = vTMR.getDefaultTypeMapping();
SerializerFactory vSerializer3Factory = vDefaultTM.getSerializer(String.class, QNAME_TYPE_String);
DeserializerFactory vDeserializer3Factory = vDefaultTM.getDeserializer( String.class, QNAME_TYPE_String);

System.out.println("vDeserializer3Factory : " + vDeserializer3Factory);
System.out.println("vSerializer3Factory : " + vSerializer3Factory);
vTM.register(String.class, QNAME_TYPE_String, vSerializer3Factory, vDeserializer3Factory);
{code}
but... without success.

At this time I try to use a Dynamic Proxy.. at the beginning I have the same issue : missing serialized for my Bean..
Add the same code to register serialized and it seems to works! (no issue related to java.lang.string Serializer)
But I recieve an unauthenticated 401 exception : my WS is a ejb 2.1 stateless session under security and I don't know how to pass credentials to it (using DII I simply set Stub.USERNAME_PROPERTY and Stub.PASSOWORD_PROPERTY properties on Call...

Any idea for this error ?
Maybe it is a bug ?

I'm using WAS 7.0.3 (latest fix.) with latest JDK 1.6 SR4+147109 into a x64 window env.

Thanks
Roberto

roberto...@datatex.it

unread,
Apr 15, 2009, 5:45:14 AM4/15/09
to
fatherData"): and it is worling!!!

So using DII I must register also any String attribute, instead using d dynamic proxy, I can avoid it...
It is very strange to have a so differente behaviours. Is it a bug ? or not ?

But I'm surprise also to do it... I'm really doesn't register it directly .. I try to explain better...

{code}
QName QNAME_TYPE_FC = new QName("http://imp.abs.dat.com/", "FatherClassPojo";
.


SerializerFactory vSerializerFactory = BeanSerializerFactory.createFactory(BeanSerializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
DeserializerFactory vDeserializerFactory = BeanDeserializerFactory.createFactory(BeanDeserializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);

vTM.register(FatherClassPojo.class, QNAME_TYPE_FC, vSerializerFactory, vDeserializerFactory);
{code}

I only ask to the factory to looking for the serializer / deserializer for my bean! The factory found it (FatherClassPojo_Ser and FatherClassPojo_Deser)... so why the WebSphere implementation doesn't looking for it automaticaly ? Maybe I must set a property ?
I believe it is very simple for the WAS WS client implementation to manage it..

Or maybe I make a very big mistake writing my client code ? It is possible....

Can someone give me some suggestion/opinion ?
Thanks
Roberto

0 new messages