ws-soap-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malte Kempff" <Kemp...@medicalcolumbus.de>
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-Fehler:

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



Malte


-----Urspr√ľngliche Nachricht-----
Von: Malte Kempff [mailto:KempffM@medicalcolumbus.de]
Gesendet: Freitag, 22. Oktober 2004 16:17
An: soap-user@ws.apache.org
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
null-values
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(Hashtable.java:393)     at
java.util.Hashtable.putAll(Hashtable.java:467)  at
org.apache.soap.encoding.soapenc.MapSerializer.marshall(Unknown Source)
at
org.apache.soap.util.xml.XMLJavaMappingRegistry.marshall(Unknown Source)
at
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
Source)
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
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
r.java:93)      at
de.mc.etnbestterm.data.OrderDataHolder.orderArtikelsInBasket(OrderDataHolder
.java:2047)     at
de.mc.etnbestterm.gui.WKBestellungsPanel.sendAnforderung(WKBestellungsPanel.
java:324)       at
de.mc.etnbestterm.gui.WKBestellungsPanel.m_artikelSpecialButton_actionPerfor
med(WKBestellungsPanel.java:225)        at
de.mc.etnbestterm.gui.BasketPanel$4.actionPerformed(BasketPanel.java:104)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto
n.java:1839)    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4
20)     at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)  at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener
.java:245)      at java.awt.Component.processMouseEvent(Component.java:5100)
at
java.awt.Component.processEvent(Component.java:4897)    at
java.awt.Container.processEvent(Container.java:1569)    at
java.awt.Component.dispatchEventImpl(Component.java:3615)       at
java.awt.Container.dispatchEventImpl(Container.java:1627)       at
java.awt.Component.dispatchEvent(Component.java:3477)   at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)  at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)   at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)       at
java.awt.Container.dispatchEventImpl(Container.java:1613)       at
java.awt.Window.dispatchEventImpl(Window.java:1606)     at
java.awt.Component.dispatchEvent(Component.java:3477)   at
java.awt.EventQueue.dispatchEvent(EventQueue.java:456)  at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:201)         at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:151)   at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)   at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)   at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

____________
Virus checked by G DATA AntiVirusKit
Version: AVK 15.0.448 from 13.10.2004
Virus news: www.antiviruslab.com




____________
Virus checked by G DATA AntiVirusKit
Version: AVK 15.0.448 from 13.10.2004
Virus news: www.antiviruslab.com

Mime
View raw message