axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Maring <bambool...@yahoo.com>
Subject Re: Unable to create JavaBean of type <AbstractClass>. Missing default constructor? Error was: java.lang.InstantiationException
Date Wed, 20 Aug 2003 13:45:01 GMT
You are outside of the scope and capabilities of the
default type mapping as defined in Chapter 4 & 5 of
the JAX-RPC spec.

You will need to plug in your own (de)serializer.

Someone recently asked the same question.  Check the
archives.

Cheers.
Steve Maring



--- karol.sibielak@bawag.com wrote:
> 
> 
> I have a class "DataObjectConcrete" that extends
> from a base abstract class
> "DataObjectAbstract". My Axis-client calls a method
> which returns class
> "DataObjectConcrete". The method is called and
> processed correctly, but during
> the response deserialization Axis tries to
> instantiate the abstract class
> "DataObjectAbstract" instead of the concrete class
> "DataObjectConcrete".
> 
> My client receives the following error message :
> 
> 0 [main] ERROR client.Call  - Exception:
> org.xml.sax.SAXException: Unable to create JavaBean
> of type
> com.xxx.xxx.xxx.DataObjectAbstract.  Missing default
> constructor?  Error was:
> java.lang.InstantiationException:
> com.xxx.xxx.xxx.DataObjectAbstract.
>      at
>
org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:159)
>      at
>
org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:481)...
> 
> 
> In the WSDL (generated by java2wsdl) this class is
> defined as
> 
>    <complexType abstract="true"
> name="DataObjectAbstract">
>     <sequence>
>      <element name="action" type="xsd:int"/>
>     </sequence>
>    </complexType>
> 
> the concrete class is defined as
> 
>    <complexType name="DataObjectConcrete">
>     <complexContent>
>      <extension base="tns3:DataObjectAbstract">
>       <sequence>
>        <...>
>       </sequence>
>      </extension>
>     </complexContent>
>    </complexType>
> 
> wsdl2java generates a stub where the abstract class
> is defined as
> 
>     qName =
>       new javax.xml.namespace.QName(
>         "http://xxx.xxx.xxx.com",
>         "DataObjectAbstract");
>     cachedSerQNames.add(qName);
>     cls = com.xxx.xxx.xxx.DataObjectAbstract.class;
>     cachedSerClasses.add(cls);
>     cachedSerFactories.add(beansf);
>     cachedDeserFactories.add(beandf);
> 
> the concrete class is defined in the same way. We
> are using the default
> serializers and deserializers.
> 
> What has to be done in order for Axis to instantiate
> the concrete class during
> deserialization?
> 
> Thanks in advance
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Mime
View raw message