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 Ha...@newyorklife.com on 2003/08/15 08:49:19 UTC
Can't find default constructor exception on the client side
Hi,
I have an abstract class, Users, that is extended by several classes
such as Administrator, Tester etc. My service method, LogIn, will return a
User object upon successful login. I verify that a Users object is send
back to the client. However, the client will throw an exception which
indicate that a Java Bean can not be created because there is no default
constructot for Users class.
This design is to hide the detail from the client program so that there
is no testing logic for identifying the type of the user who logs in. Any
suggestion to resolve this issue is highly appreciated.
Harry Wen
Re: Can't find default constructor exception on the client side
Posted by "Jeyakumaran.C" <jk...@vijayaba.cse.mrt.ac.lk>.
Hi,
I had also met this prbs before.
For beans u need to have a default constructor.(may be for axis bean
serialization).
regards,
Jeyakumaran.C
----- Original Message -----
From: <Ha...@newyorklife.com>
To: <ax...@ws.apache.org>
Sent: Friday, August 15, 2003 12:49 PM
Subject: Can't find default constructor exception on the client side
Hi,
I have an abstract class, Users, that is extended by several classes
such as Administrator, Tester etc. My service method, LogIn, will return a
User object upon successful login. I verify that a Users object is send
back to the client. However, the client will throw an exception which
indicate that a Java Bean can not be created because there is no default
constructot for Users class.
This design is to hide the detail from the client program so that there
is no testing logic for identifying the type of the user who logs in. Any
suggestion to resolve this issue is highly appreciated.
Harry Wen
Re: Can't find default constructor exception on the client side
Posted by Steve Maring <ba...@yahoo.com>.
Yes. You should only allow the BeanSerializer to manage your type mapping if you had the wsdl2java process generate your beans or your WSDL was generated by a java2wsdl base on your beans, which would have to be REAL JavaBeans with default constructors. Otherwise, you will need to plug in a custom serializer. Given the nature of the objects you discribed, you may even need to write your own marshaller. I don't know if Castor, JAXB, XMLBeans, JiBX, Glue, or any other marshallers will manage the type of abstraction you discribed. Some allow you to have your data types represented by interfaces, so that alternate implementations can be plugged in. Maybe you could use interfaces instead of abstract classes?
Anyway. I just posted an example of plugging a custom serializer (Castor) into a HelloWorld service. see the recent thread on axis and castor.
Cheers.
Steve Maring
Stuart Barlow <sb...@peopledoc.com> wrote:I think that AXIS requires a default constructor if you are using
bean based serialization.
Maybe possible with custom serialization? someone else know?
Harry_Wen@newyorklife.com wrote:
> Hi,
> I have an abstract class, Users, that is extended by several classes
> such as Administrator, Tester etc. My service method, LogIn, will return a
> User object upon successful login. I verify that a Users object is send
> back to the client. However, the client will throw an exception which
> indicate that a Java Bean can not be created because there is no default
> constructot for Users class.
>
> This design is to hide the detail from the client program so that there
> is no testing logic for identifying the type of the user who logs in. Any
> suggestion to resolve this issue is highly appreciated.
>
>
> Harry Wen
>
>
>
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
Re: Can't find default constructor exception on the client side
Posted by Stuart Barlow <sb...@peopledoc.com>.
I think that AXIS requires a default constructor if you are using
bean based serialization.
Maybe possible with custom serialization? someone else know?
Harry_Wen@newyorklife.com wrote:
> Hi,
> I have an abstract class, Users, that is extended by several classes
> such as Administrator, Tester etc. My service method, LogIn, will return a
> User object upon successful login. I verify that a Users object is send
> back to the client. However, the client will throw an exception which
> indicate that a Java Bean can not be created because there is no default
> constructot for Users class.
>
> This design is to hide the detail from the client program so that there
> is no testing logic for identifying the type of the user who logs in. Any
> suggestion to resolve this issue is highly appreciated.
>
>
> Harry Wen
>
>
>