• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Failed to serialize class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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(transScan.java:64)
[java] at cititru.scan.transScan.main(transScan.java:26)
[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 [Lcititru.api.interdict.gi.Sc
annedTextData;weblogic.xml.schema.binding.SerializationException: mapping lookup
failure. class=class [Lcititru.api.interdict.gi.ScannedTextData; class context=
TypedClassContext{schemaType=['java:cititru.api.interdict.gi']:ArrayOfScannedTex
tData}
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
onstructorAccessorImpl.java:39)
[java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
egatingConstructorAccessorImpl.java:27)
[java] at java.lang.reflect.Constructor.newInstance(Constructor.java:27
4)
[java] at weblogic.webservice.core.rpc.StubImpl.throwRemoteException(St
ubImpl.java:266)
[java] at weblogic.webservice.core.rpc.StubImpl.invoke(StubImpl.java:25
1)

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 = "http://www.bea.com/ws_gi_server";
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);
===========================================================================

Regards,
Ankit
[ September 24, 2008: Message edited by: Gandhi Ankit ]
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your POJO implements Serializable?
 
Gandhi Ankit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?

Regards,

Ankit
 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic