File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Failed to serialize class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Failed to serialize class" Watch "Failed to serialize class" New topic

Failed to serialize class

Gandhi Ankit

Joined: Sep 24, 2008
Posts: 2

I am using Weblogic8.1 to deploy my webservice. I am using servicegen and clientgen task of ant. I am implementing Dynamic Proxy client to invoke my webservice. While invoking webservice, i am passing array of my POJO class as an input parameter and getting below error message -

[java] java.lang.reflect.UndeclaredThrowableException
[java] at $Proxy0.lookup(Unknown Source)
[java] at cititru.scan.transScan.createGiService(
[java] at cititru.scan.transScan.main(
[java] Caused by: java.rmi.RemoteException: Failed to invoke; nested except
ion is:
[java] javax.xml.rpc.JAXRPCException: web service invoke failed: javax.
xml.soap.SOAPException: failed to serialize class [
annedTextData;weblogic.xml.schema.binding.SerializationException: mapping lookup
failure. class=class [; class context=
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
[java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
[java] at java.lang.reflect.Constructor.newInstance(
[java] at weblogic.webservice.core.rpc.StubImpl.throwRemoteException(St
[java] at weblogic.webservice.core.rpc.StubImpl.invoke(

Can anyone tell me what needs to be done to resolve the above error. I am also pasting my Dynamic Client code snipet below -

String wsdlURL = "http://localhost:7001/ws_gi_server/GiService?WSDL";
String namespace = "";
String serviceName = "GiService";
String portName = "GiServicePort";

ServiceFactory serviceFactory = ServiceFactory.newInstance();
QName service_Name = new QName(namespace, serviceName);
Service sampleService = serviceFactory.createService(new URL(wsdlURL), service_Name);

TypeMappingRegistry tmr = sampleService.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping)tmr.createTypeMapping();
tm.register(ScannedTextData.class, service_Name, new ScannedTextDataCodec(), new ScannedTextDataCodec());

/* Service access */
GiServerInterface gi = (GiServerInterface) sampleService.getPort(new QName(namespace, portName), GiServerInterface.class);

/* Service invocation */
bluReplyData = gi.lookup("MUMBAI",ruleSet,"EXECUTOR1",std);

[ September 24, 2008: Message edited by: Gandhi Ankit ]
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
Does your POJO implements Serializable?

My Blog
Gandhi Ankit

Joined: Sep 24, 2008
Posts: 2
Hi Vinod,

My POJO class doesn't implement the Serializable. But my build script is generating Seriliazable class for my POJO class automatically by setting 'generateType=true' attribute of the 'service' ant task.

The same approach working fine with the Static client but not working with Dynamic Proxy client. Can you guide me why is it ?


I agree. Here's the link:
subject: Failed to serialize class
It's not a secret anymore!