You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Herbert Christy <hc...@ncs.com.sg> on 2004/12/21 07:37:45 UTC

object is not an instance of declaring class

Hi,

I am developing a client with dynamic loading.
So far, when I do the invocation, it works properly.
However, if I invoke the same service several time within short period (let
say , 10 seconds),
I might get exception of "object is not an instance of declaring class".

If I trace the message being sent in/out, both are correct. Seems like
the client could not serialize/deserialize it in a short period.
Has anyone encountered this kind of problem?
Appreciate if someone can explain what caused this exception.

Thanks...
Herbert


==============================================================
<12:34:18:811> [DEBUG] [test.ws.consumer.rt.axis.invoker.RPCServiceInvoker]:
inputMsg: <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:get
Addresses soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://DefaultNamespace"/></soapenv:Body></soapenv:Envelope>
<12:34:18:839> [DEBUG] [test.ws.consumer.rt.axis.invoker.RPCServiceInvoker]:
outputMsg: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:get
AddressesResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://DefaultNamespace"><getAddressesReturn
soapenc:arrayType="ns2:Address[2]" xsi:type="ns3:ArrayOf_tns1_Address"
xmlns:ns2="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns3="http://test2003:8080/prototype/TestService.jws"><item
href="#id0"/><item
href="#id1"/></getAddressesReturn></ns1:getAddressesResponse><multiRef
id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns4:Address"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://object.prototype"><phones soapenc:arrayType="ns4:Phone[2]"
xsi:type="soapenc:Array"><item href="#id2"/><item
href="#id3"/></phones><streetName xsi:type="soapenc:string">Street
A</streetName><streetNo xsi:type="soapenc:string">10</streetNo><zip
href="#id4"/></multiRef><multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns5:Address" xmlns:ns5="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><phones
soapenc:arrayType="ns5:Phone[2]" xsi:type="soapenc:Array"><item
href="#id5"/><item href="#id6"/></phones><streetName
xsi:type="soapenc:string">Street A</streetName><streetNo
xsi:type="soapenc:string">10</streetNo><zip
href="#id7"/></multiRef><multiRef id="id5" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns6:Phone" xmlns:ns6="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><areaCode
href="#id8"/><phoneNo
xsi:type="soapenc:string">12993456</phoneNo></multiRef><multiRef id="id4"
soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">90</multiRef><mult
iRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns7:Phone" xmlns:ns7="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><areaCode
href="#id9"/><phoneNo
xsi:type="soapenc:string">654321</phoneNo></multiRef><multiRef id="id2"
soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns8:Phone" xmlns:ns8="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><areaCode
href="#id10"/><phoneNo
xsi:type="soapenc:string">123456</phoneNo></multiRef><multiRef id="id6"
soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns9:Phone" xmlns:ns9="http://object.prototype"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><areaCode
href="#id11"/><phoneNo
xsi:type="soapenc:string">65438821</phoneNo></multiRef><multiRef id="id7"
soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">90</multiRef><mult
iRef id="id11" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5</multiRef><multi
Ref id="id8" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">4</multiRef><multi
Ref id="id10" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2</multiRef><multi
Ref id="id9" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">3</multiRef></soap
env:Body></soapenv:Envelope>
<12:34:18:917> [DEBUG] [test.ws.consumer.rt.axis.invoker.RPCServiceInvoker]:
response size: 4022
<12:34:18:919> [ERROR] [test.ws.consumer.rt.axis.invoker.RPCServiceInvoker]:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
test.ws.consumer.rt.axis.invoker.AXISServiceInvoker.invoke(Unknown Source)
	at test.ws.consumer.proxy.WSProxyImpl.invoke(Unknown Source)
	at test.ws.consumer.proxy.RemoteConsumer.invoke(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
	at sun.rmi.transport.Transport$1.run(Transport.java:148)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
	at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
	at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.IllegalArgumentException: object is not an instance of
declaring class
	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
	at org.apache.axis.client.Call.invoke(Call.java:2423)
	at org.apache.axis.client.Call.invoke(Call.java:2319)
	at org.apache.axis.client.Call.invoke(Call.java:1776)
	at
ws_testService2.TestServiceSoapBindingStub.getAddresses(TestServiceSoapBindi
ngStub.java:453)
	... 18 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of
declaring class
	at
org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:
142)
	at
org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.jav
a:255)
	at
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:5
15)
	at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1077)
	at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
	at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1138)
	at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java
:375)
	at
org.apache.axis.encoding.DeserializationContext.startElement(Deserialization
Context.java:1038)
	at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:159)
	at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1138)
	at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java
:375)
	at
org.apache.axis.encoding.DeserializationContext.startElement(Deserialization
Context.java:1038)
	at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:159)
	at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1138)
	at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java
:375)
	at
org.apache.axis.encoding.DeserializationContext.startElement(Deserialization
Context.java:1038)
	at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:159)
	at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1138)
	at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:308)
	at org.apache.axis.message.RPCElement.getParams(RPCElement.java:342)
	at org.apache.axis.client.Call.invoke(Call.java:2420)
	... 21 more
<12:34:18:980> [ERROR] [test.ws.consumer.rt.axis.invoker.RPCServiceInvoker]:

java.lang.NullPointerException
	at
test.ws.consumer.rt.axis.invoker.AXISServiceInvoker.invoke(Unknown Source)
	at test.ws.consumer.proxy.WSProxyImpl.invoke(Unknown Source)
	at test.ws.consumer.proxy.RemoteConsumer.invoke(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
	at sun.rmi.transport.Transport$1.run(Transport.java:148)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
	at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
	at java.lang.Thread.run(Thread.java:534)