ws-soap-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malte Kempff" <>
Subject AW: Trouble with serializing HashMaps (ADDITION)
Date Fri, 22 Oct 2004 14:43:06 GMT
Hi Scott,
I found a Entry in the SOAP-Docs saying it supports ...
java.util.HashMap (under Java editions in which this is supported)

since we are using Java Runtime 1.4.X I don't understand that if serialize
HashMaps in a Vector, -this time without having null values-,

following Exception occures:


SOAP-RPC:[Attributes={}] [faultCode=SOAP-ENV:Server] [faultString=Exception
from service object: java.util.HashMap]
[faultActorURI=/soap/servlet/rpcrouter] [DetailEntries=

[(0)=<stackTrace>java.lang.ClassCastException: java.util.HashMap

I think it has something to do with the trial of soap 2.3.1 to use a
HashTable as Map-Serializer instead of a HashMap, could that be?

many thanks in advance


-----Urspr√ľngliche Nachricht-----
Von: Malte Kempff []
Gesendet: Freitag, 22. Oktober 2004 16:17
Betreff: Trouble with serializing HashMaps

Hi Scott,
I've got following trouble I am using Apache SOAP as RPC
now I tried to give my serverroutine Maps in Vectors
I am getting a Nullpointexception, because I am using HashMaps which allow
in the Map serializier a HashTable is used which does not allow null-values.
What is the reason a HashTable is performing for Maps an not a HashMap?
If a Map is used, which does not allow null-values the client will allready
know that while filling it with entries. So I believe it does not need to be
so restrictive.
Since passing a Map is really a standard I don't prefer writing a new
serializer/deserializer on my own.

My Exception is the following:

java.lang.NullPointerException  at
java.util.Hashtable.put(     at
java.util.Hashtable.putAll(  at
org.apache.soap.encoding.soapenc.MapSerializer.marshall(Unknown Source)
org.apache.soap.util.xml.XMLJavaMappingRegistry.marshall(Unknown Source)
org.apache.soap.encoding.soapenc.VectorSerializer.marshall(Unknown Source)
at org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Unknown
Source)         at org.apache.soap.rpc.RPCMessage.serializeParams(Unknown
at org.apache.soap.rpc.RPCMessage.marshall(Unknown Source)      at
org.apache.soap.Body.marshall(Unknown Source)   at
org.apache.soap.Envelope.marshall(Unknown Source)       at
org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)  at
org.apache.soap.rpc.Call.invoke(Unknown Source)         at
org.apache.soap.rpc.Call.invoke(Unknown Source)         at      at
.java:2047)     at
java:324)       at
med(        at$4.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto    at
20)     at
javax.swing.DefaultButtonModel.setPressed(  at
.java:245)      at java.awt.Component.processMouseEvent(
java.awt.Component.processEvent(    at
java.awt.Container.processEvent(    at
java.awt.Component.dispatchEventImpl(       at
java.awt.Container.dispatchEventImpl(       at
java.awt.Component.dispatchEvent(   at
java.awt.LightweightDispatcher.retargetMouseEvent(  at
java.awt.LightweightDispatcher.processMouseEvent(   at
java.awt.LightweightDispatcher.dispatchEvent(       at
java.awt.Container.dispatchEventImpl(       at
java.awt.Window.dispatchEventImpl(     at
java.awt.Component.dispatchEvent(   at
java.awt.EventQueue.dispatchEvent(  at
va:201)         at
:151)   at
java.awt.EventDispatchThread.pumpEvents(   at
java.awt.EventDispatchThread.pumpEvents(   at

Virus checked by G DATA AntiVirusKit
Version: AVK 15.0.448 from 13.10.2004
Virus news:

Virus checked by G DATA AntiVirusKit
Version: AVK 15.0.448 from 13.10.2004
Virus news:

View raw message