I've got this exception on my server after a SOAP call :
[2004-03-23 22:58:31] AXIS FAULT: java.lang.reflect.InvocationTargetException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at gothmog.Client.sendArray(Client.java:793)
at gothmog.Client.sendMessages(Client.java:687)
at gothmog.Client.<init>(Client.java:71)
at gothmog.Client.main(Client.java:46)
java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at gothmog.Client.sendArray(Client.java:793)
at gothmog.Client.sendMessages(Client.java:687)
at gothmog.Client.<init>(Client.java:71)
at gothmog.Client.main(Client.java:46)
[2004-03-23 22:58:31] END AXIS FAULT
///////////////////////////////////////////////////////////////////////////////////////////////
Here's the code which causes the error (the data is transfered, it crashes during deserialization on server):
// SOAP call URL
URL url =
new URL(
"http://" + sName + ":" + sPort + "/axis/services/Gothmog");
Server.debugString(
"SendArray to site " + dstSite + ", URL: " + url);
// Fill array of IntMsg
int nbm = imV.size();
Object[] ot = imV.toArray();
IntMsg[] imt = new IntMsg[nbm];
for (int k = 0; k < nbm; k++) {
imt[k] = (IntMsg) ot[k];
}
Server.debugString(
"SendArray: " + dstSite + ", " + nbm + " messages");
try {
// Configure SOAP call
Service service = new Service();
Call call = (Call) service.createCall();
call.setTimeout(Integer.valueOf("600000")); // 10 min timeout
// Map IntMsg
QName qn1 = new QName("urn:BeanService", "IntMsg");
call.registerTypeMapping(
IntMsg.class,
qn1,
new org.apache.axis.encoding.ser.BeanSerializerFactory(
IntMsg.class,
qn1),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(
IntMsg.class,
qn1));
// Map IntMsg array
QName qn2 = new QName("urn:BeanService", "IntMsgArray");
call.registerTypeMapping(
IntMsg[].class,
qn2,
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org
.apache
.axis
.encoding
.ser
.ArrayDeserializerFactory());
// SOAP call to send the IntMsg array
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("IntMsgArray", "receiveArray"));
call.addParameter("imt", qn2, ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
String result = (String) call.invoke(new Object[] { imt });
///////////////////////////////////////////////////////////////////////////////////////////////
And my deployment descriptor:
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="Gothmog" provider="java:RPC"> <parameter name="className" value="gothmog.Server"/> <parameter name="allowedMethods" value="*"/>
<typeMapping qname="myNS:IntMsg" type="java:gothmog.IntMsg" xmlns:myNS="urn:BeanService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" /> <typeMapping qname="myNS:IntMsgArray" type="java:gothmog.IntMsg[]" xmlns:myNS="urn:BeanService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" /> </service> </deployment>
The IntMsg class is a bean. Well handled by Bean(De)Serializer...
What did I miss ?
Thanks in advance,
-- Jean-Christophe Praud - http://shub-niggurath.com Conseil & Développement Informatique http://www.praud.com Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn!