This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting exception serialization error: java.lang. NullPointerException  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am calling web service using jax rpc call. My web service is returning list type. my code of calling web service is as follow:



when i am calling web service using
method i am getting following exception :


serialization error: serialization error: java.lang.NullPointerException
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:196)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)

CAUSE:

serialization error: java.lang.NullPointerException
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.doSetTargetClass(ValueTypeLiteralSerializer.java:113)
at com.sun.xml.rpc.encoding.literal.GenericLiteralObjectSerializer.setTargetClass(GenericLiteralObjectSerializer.java:117)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.<init>(ValueTypeLiteralSerializer.java:104)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.createLiteralValueTypeSerializer(DynamicInternalTypeMappingRegistry.java:768)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:190)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)

CAUSE:

java.lang.NullPointerException
at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:101)
at sun.reflect.misc.ReflectUtil.isPackageAccessible(ReflectUtil.java:123)
at java.beans.Introspector.getBeanInfo(Introspector.java:154)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.introspectTargetClass(ValueTypeLiteralSerializer.java:120)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.doSetTargetClass(ValueTypeLiteralSerializer.java:110)
at com.sun.xml.rpc.encoding.literal.GenericLiteralObjectSerializer.setTargetClass(GenericLiteralObjectSerializer.java:117)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.<init>(ValueTypeLiteralSerializer.java:104)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.createLiteralValueTypeSerializer(DynamicInternalTypeMappingRegistry.java:768)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:190)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)

CAUSE:

serialization error: java.lang.NullPointerException
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.doSetTargetClass(ValueTypeLiteralSerializer.java:113)
at com.sun.xml.rpc.encoding.literal.GenericLiteralObjectSerializer.setTargetClass(GenericLiteralObjectSerializer.java:117)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.<init>(ValueTypeLiteralSerializer.java:104)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.createLiteralValueTypeSerializer(DynamicInternalTypeMappingRegistry.java:768)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:190)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)

CAUSE:

java.lang.NullPointerException
at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:101)
at sun.reflect.misc.ReflectUtil.isPackageAccessible(ReflectUtil.java:123)
at java.beans.Introspector.getBeanInfo(Introspector.java:154)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.introspectTargetClass(ValueTypeLiteralSerializer.java:120)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.doSetTargetClass(ValueTypeLiteralSerializer.java:110)
at com.sun.xml.rpc.encoding.literal.GenericLiteralObjectSerializer.setTargetClass(GenericLiteralObjectSerializer.java:117)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.<init>(ValueTypeLiteralSerializer.java:104)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.createLiteralValueTypeSerializer(DynamicInternalTypeMappingRegistry.java:768)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:190)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)

CAUSE:

java.lang.NullPointerException
at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:101)
at sun.reflect.misc.ReflectUtil.isPackageAccessible(ReflectUtil.java:123)
at java.beans.Introspector.getBeanInfo(Introspector.java:154)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.introspectTargetClass(ValueTypeLiteralSerializer.java:120)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.doSetTargetClass(ValueTypeLiteralSerializer.java:110)
at com.sun.xml.rpc.encoding.literal.GenericLiteralObjectSerializer.setTargetClass(GenericLiteralObjectSerializer.java:117)
at com.sun.xml.rpc.encoding.literal.ValueTypeLiteralSerializer.<init>(ValueTypeLiteralSerializer.java:104)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.createLiteralValueTypeSerializer(DynamicInternalTypeMappingRegistry.java:768)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:190)
at com.sun.xml.rpc.encoding.literal.LiteralResponseSerializer.initialize(LiteralResponseSerializer.java:230)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcLiteralResponseSerializer(BasicCall.java:757)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:690)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
at callbyregistry.CallHISServices.executeQuery(CallHISServices.java:220)
at callbyregistry.CallHISServices.main(CallHISServices.java:45)


Please help me out.

regards,
vikas
[ December 16, 2008: Message edited by: vikas kumar bansal ]
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The limitations to Java web services (with Axis) is that the user defined (or complex) objects are not handled - only primitive data types are actually passed . Thus, cannot pass trhough wire without flattening them. If your Java class follows the standard JavBean standard of mutators, you can leverage the services of BeanSerializer (with Axis2).

The simpler method would be to store the references as primitive data types (String values for example) in a HashMap which can be accessed through the client.


[ December 16, 2008: Message edited by: Nitin Pathak ]
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Nitin Pathak:
The simpler method would be to store the references as primitive data types (String values for example) in a HashMap which can be accessed through the client.



The choice of a HashMap would prove problematic.

Web Services Programming Tips and Tricks: Use collection types with SOAP
Hashtables in WSDL
Object that contain ArrayList
 
bikkie bansal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Peer,

Thanks for reply.
As describe in tutorial Web Services Programming Tips and Tricks: Use collection types with SOAP

I have created wrapper for my service in which i am converting my list type to string array type.



but still I am getting exception when I am invoking my operation.

when I set my return type by using


and invoke my operation I got following exception :



when I set retun type as follow :



and then invoke operation then I am getting following exception:


please help me.

regards,
vikas
[ December 29, 2008: Message edited by: vikas kumar bansal ]
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!