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 KK...@bca-group.com on 2004/05/18 12:13:33 UTC

Re: Abstract Bean problem in Axis 1.2beta ['Watchdog': Virus checked] ['Watchdog': checked]





Patrick,

I dont think this is a bug.
Axis 1.1, need such configurations (as you have specified).
Axis 1.2 does not expects such configurations for array types. This is done
basically to conform WS-I BP 1.0 standard or profile.
Do one thing, Wrap array of MyBean1 into another class and define that
class in your type mapping. Iam sure it should work !.

cheers,
-kannan



                                                                                                                                       
                      "BLIS Webmaster                                                                                                  
                      (Patrick                 To:       axis-user@ws.apache.org                                                       
                      Houbaux)"                cc:                                                                                     
                      <webmaster@blis-p        Subject:  Re: Abstract Bean problem in Axis 1.2beta ['Watchdog': Virus checked]         
                      roject.org>               ['Watchdog': checked]                                                                  
                                                                                                                                       
                      18/05/04 10:59                                                                                                   
                      Please respond to                                                                                                
                      axis-user                                                                                                        
                                                                                                                                       
                                                                                                                                       



If somebody is interested:

Somehow the problem was coming from the deployment configuration file
(deploy.wsdd) because I had (for some reasons) specified the type mapping
for the array of MyBean1 according to the following:

<typeMapping
        xmlns:myNS="urn:myTest"
        qname="myNS:ArrayOf_MyBean1"
        type="java:MyBean1[]"
        serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"

deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  />

Seems that Axis1.2beta doesn't work when these arrays mapping are
specified. Axis1.1 was working fine.

Anyway commenting out this type mapping did the trick.

If needed I can log that in the bug database (I have the complete server
source example with client ready).

Cheers,
Patrick.

BLIS Webmaster (Patrick Houbaux) wrote:

> Dear all,
>
> I have a complex datatype schema in a webservice that has been generated
> from a javabean-object model.
>
> Some of these beans are declared as abstract and are empty.
>
> When I deploy the webservice everything is fine but when I try to
> consume the webservice I get a "Missing Default Constructor" error for
> these abstract-empty beans.
>
> This was working fine with Axis 1.1 and I'm currently stuck trying to
> found out the reason of this error.
> My questions are:
> - Is this a bug in Axis 1.2beta? If yes, should I try to submit an issue?
> - What has changed between Axis 1.1 and Axis 1.2beta that leads to this
> error?
> - Am I doing something completly wrong here?
>
> To clarify my explanation here is some piece of codes of my webservice:
>
> ===== MySuperBean.java
>
> abstract Class MySuperBean{
>    String ID;
>    public String getID(){
>       return ID;
>    }
>
>    public void setID(String id_){
>       ID=id_;
>    }
> }
> ===== MySuperBean2.java
>
> abstract Class MySuperBean2 extends MySuperBean{
> }
>
> ==== MyBean1.java
>
> Class MyBean1 extends MySuperBean2{
>     String name;
>     String description;
>
>     // get and set methods for name and description ...
> }
>
> ==== MyBean2.java
> Class MyBean2 {
>     MyBean1[] collectionOfBean1;
>         // get and set methods for collectionOfBean1
> }
>
> ==== MyService.java
>
> Class MyService {
>
>      public MyBean2 createMyBean2(){
>           return new MyBean2();
>      }
> }
>
> The error says something like "Enable to create javabean type
> MySuperBean2 Missing default constructor? error was
> java.lang.InstanciationException"
> and then some stack trace ...
>
> Thanks in advance for any help on shedding me the light on that.
> Cheers,
> Patrick.




This email and any attachments to it may contain confidential information
intended for the addressee only. If you are not the intended addressee, you
are strictly prohibited from disclosing, copying, distributing or using
this email in any way. Unauthorised use of the information contained in
this email is unlawful. If you have received this email in error please
notify us on enquiries@bca-group.com and delete the email from your system.

Information contained in this email can not be disclosed, copied,
distributed or used in any way without the prior consent of the sender. Any
opinions, advice or facts given in this email are given without warranty or
the intention to enter into an agreement unless specifically stated and
confirmed by agreement, letter or such other documentation signed by an
authorised signatory of BCA Holdings Limited or any of its subsidiary
companies.

Any personal information contained in this email is strictly the view of
the sender and is in no way authorised or attributable to BCA Holdings
Limited or any of its subsidiary companies in any way. All emails through
the company gateway are subject to monitoring. The company cannot be held
liable for any errors or viruses contained in this message.


Re: Abstract Bean problem in Axis 1.2beta ['Watchdog': Virus checked] ['Watchdog': checked]

Posted by "BLIS Webmaster (Patrick Houbaux)" <we...@blis-project.org>.
Hi Kannan,

Thanks for the explanation ... it makes sense :)

I don't need to wrap the array of MyBean1 into another class because just removing the type mapping from the wsdd made it work.
Everything seems to be fine now.

So the conclusion might be that one has to let Axis do the type mapping for arrays of beans itself when deploying a webservice.
Maybe that was also true for Axis 1.1.

Cheers,
Patrick.

KKanagaraj@bca-group.com wrote:

> 
> 
> 
> 
> Patrick,
> 
> I dont think this is a bug.
> Axis 1.1, need such configurations (as you have specified).
> Axis 1.2 does not expects such configurations for array types. This is done
> basically to conform WS-I BP 1.0 standard or profile.
> Do one thing, Wrap array of MyBean1 into another class and define that
> class in your type mapping. Iam sure it should work !.
> 
> cheers,
> -kannan
> 
> 
> 
>                                                                                                                                        
>                       "BLIS Webmaster                                                                                                  
>                       (Patrick                 To:       axis-user@ws.apache.org                                                       
>                       Houbaux)"                cc:                                                                                     
>                       <webmaster@blis-p        Subject:  Re: Abstract Bean problem in Axis 1.2beta ['Watchdog': Virus checked]         
>                       roject.org>               ['Watchdog': checked]                                                                  
>                                                                                                                                        
>                       18/05/04 10:59                                                                                                   
>                       Please respond to                                                                                                
>                       axis-user                                                                                                        
>                                                                                                                                        
>                                                                                                                                        
> 
> 
> 
> If somebody is interested:
> 
> Somehow the problem was coming from the deployment configuration file
> (deploy.wsdd) because I had (for some reasons) specified the type mapping
> for the array of MyBean1 according to the following:
> 
> <typeMapping
>         xmlns:myNS="urn:myTest"
>         qname="myNS:ArrayOf_MyBean1"
>         type="java:MyBean1[]"
>         serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> 
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
>         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>   />
> 
> Seems that Axis1.2beta doesn't work when these arrays mapping are
> specified. Axis1.1 was working fine.
> 
> Anyway commenting out this type mapping did the trick.
> 
> If needed I can log that in the bug database (I have the complete server
> source example with client ready).
> 
> Cheers,
> Patrick.
> 
> BLIS Webmaster (Patrick Houbaux) wrote:
> 
> 
>>Dear all,
>>
>>I have a complex datatype schema in a webservice that has been generated
>>from a javabean-object model.
>>
>>Some of these beans are declared as abstract and are empty.
>>
>>When I deploy the webservice everything is fine but when I try to
>>consume the webservice I get a "Missing Default Constructor" error for
>>these abstract-empty beans.
>>
>>This was working fine with Axis 1.1 and I'm currently stuck trying to
>>found out the reason of this error.
>>My questions are:
>>- Is this a bug in Axis 1.2beta? If yes, should I try to submit an issue?
>>- What has changed between Axis 1.1 and Axis 1.2beta that leads to this
>>error?
>>- Am I doing something completly wrong here?
>>
>>To clarify my explanation here is some piece of codes of my webservice:
>>
>>===== MySuperBean.java
>>
>>abstract Class MySuperBean{
>>   String ID;
>>   public String getID(){
>>      return ID;
>>   }
>>
>>   public void setID(String id_){
>>      ID=id_;
>>   }
>>}
>>===== MySuperBean2.java
>>
>>abstract Class MySuperBean2 extends MySuperBean{
>>}
>>
>>==== MyBean1.java
>>
>>Class MyBean1 extends MySuperBean2{
>>    String name;
>>    String description;
>>
>>    // get and set methods for name and description ...
>>}
>>
>>==== MyBean2.java
>>Class MyBean2 {
>>    MyBean1[] collectionOfBean1;
>>        // get and set methods for collectionOfBean1
>>}
>>
>>==== MyService.java
>>
>>Class MyService {
>>
>>     public MyBean2 createMyBean2(){
>>          return new MyBean2();
>>     }
>>}
>>
>>The error says something like "Enable to create javabean type
>>MySuperBean2 Missing default constructor? error was
>>java.lang.InstanciationException"
>>and then some stack trace ...
>>
>>Thanks in advance for any help on shedding me the light on that.
>>Cheers,
>>Patrick.
> 
> 
> 
> 
> 
> This email and any attachments to it may contain confidential information
> intended for the addressee only. If you are not the intended addressee, you
> are strictly prohibited from disclosing, copying, distributing or using
> this email in any way. Unauthorised use of the information contained in
> this email is unlawful. If you have received this email in error please
> notify us on enquiries@bca-group.com and delete the email from your system.
> 
> Information contained in this email can not be disclosed, copied,
> distributed or used in any way without the prior consent of the sender. Any
> opinions, advice or facts given in this email are given without warranty or
> the intention to enter into an agreement unless specifically stated and
> confirmed by agreement, letter or such other documentation signed by an
> authorised signatory of BCA Holdings Limited or any of its subsidiary
> companies.
> 
> Any personal information contained in this email is strictly the view of
> the sender and is in no way authorised or attributable to BCA Holdings
> Limited or any of its subsidiary companies in any way. All emails through
> the company gateway are subject to monitoring. The company cannot be held
> liable for any errors or viruses contained in this message.