You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "iris ding (JIRA)" <ji...@apache.org> on 2012/10/23 04:12:12 UTC

[jira] [Created] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

iris ding created CXF-4594:
------------------------------

             Summary: Incompatible fault type is generated in the wsdl if no setter method in Exception
                 Key: CXF-4594
                 URL: https://issues.apache.org/jira/browse/CXF-4594
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.7.0, 2.6.3
            Reporter: iris ding
             Fix For: 2.7.0


 with the exception class below , it only has a get*** method for the
info property.

@WebFault
public TestException extends Exception {
     private String message = null;

    public TestException () {
    }

    public TestException (String message) {
        this.message = message;
    }

    public String getInfo() {
        return message;
    }

}

With the RI wsgen command, the generated schema type is :
RI:
<xs:complexType name="TestException">
    <xs:sequence>
      <xs:element name="info" type="xs:string" minOccurs="0"/>
      <xs:element name="message" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

If using CXF tool or on the CXF runtime, the generated schema type for the
exception is :

<xs:element name="TestException" type="tns:TestException"/>
<xs:complexType name="TestException">
<xs:sequence/>
</xs:complexType>

With the JaxWS spec, 3.7 Service Specific Exception, considering that no
getFaultInfo or faultBean in WebFault annotation is provided, the
special algorithm will be used to map the exception to jaxb bean, one of
the steps write below:

For each getter in the exception and its superclasses, a property of the
same type and name is added to
the bean. All the getter methods except
getMessagefromjava.lang.Throwabletype hierarchy
are excluded from the list of getters to be mapped.

Seems that only getter method is required, with the current codes in static
boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
setter exists. I am thinking that this is not required for this scenario,
as we only need to read the information from the user exception.

The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
For each getter in the exception and its superclasses, a property of the
same type and name is added to
the bean. All the getter methods except
getMessagefromjava.lang.Throwabletype hierarchy
are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482097#comment-13482097 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi,

Take a close look at the logic from your patch, it doesn't follow what you wanna here.

Some outstanding issue, from your logic
1. any method without a counterpart setter would be accepted Method, like the java.lang.Object.wait
2. some special get method like java.lang.Object.getClass would be accepted Method
both are incorrect...

Freeman


                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.6.3, 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496981#comment-13496981 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks! I am running test in Eclipse and according to your guidance I can see the error now.

The error is because the case is have a 'detail' field and using our patch it will conflict with the built-in 'detail' element in soap response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Negative numbers can't be added!</faultstring><detail><ns1:AddNumbersException xmlns:ns1="http://server.addr_fromjava.ws.systest.cxf.apache.org/"><detail xmlns:ns2="http://server.addr_fromjava.ws.systest.cxf.apache.org/">Numbers: -1, -1</detail></ns1:AddNumbersException></detail></soap:Fault></soap:Body></soap:Envelope>

so unmarshal fails for this situation. Can we think it is a bug for com.sun.xml.bind.v2.runtime.unmarshaller? Can we just modify our test case? 

Thanks a lot!

Iris Ding

                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496198#comment-13496198 ] 

Freeman Fang edited comment on CXF-4594 at 11/13/12 2:19 PM:
-------------------------------------------------------------

Hi Iris,

I'm a little bit confused, I just copy AddNumbersException as your TestException here which you described in this issue
{code}
@WebFault
public TestException extends Exception {
private String message = null;

public TestException () {
}

public TestException (String message) { this.message = message; }

public String getInfo() { return message; }

}
{code}

It should be exactly what you want, then please tell me what's the exception in your mind with this issue, show me the code please.

I hope this issue can really resolve the code first customer exception issue(some properties only have get but no set) during runtime, not only generate the wsdl you want. Moreover, we really can't apply a patch that can generate the a desired wsdl but the runtime actually doesn't work at all, that means the interface description and behavior isn't consistent.

If you are more care about the wsdl, you can simply add
@XmlAccessorType(XmlAccessType.FIELD)
for your exception class, actually this can also resolve the property marshall problem.

Freeman
                
      was (Author: ffang):
    Hi Iris,

I'm a little bit confused, I just copy AddNumbersException as your TestException here which you described in this issue
{code}
@WebFault
public TestException extends Exception {
private String message = null;

public TestException () {
}

public TestException (String message) { this.message = message; }

public String getInfo() { return message; }

}
{code}

It should be exactly what you want, then please tell me what's the exception you wanna handle with this issue, show me the code please.

I hope this issue can really resolve the code first customer exception issue during runtime, not only generate the wsdl you want.
If you are more care about the wsdl, you can simply add
@XmlAccessorType(XmlAccessType.FIELD)
for your exception class, actually this can also resolve the property marshall problem.

Freeman
                  
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496226#comment-13496226 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

One typical scenario we want to support through this patch is as below, which has a private field and getter method defined but no setter method. And no related annotation defined(@XmlAccessorType(XmlAccessType.FIELD)).

@WebFault
public TestException extends Exception {
private String info = null;

public TestException () {
}

public TestException (String info) { this.info= info; }

public String getInfo() { return info; }

}

Sorry for the confusion and many thanks for your valuable time and review on this issue!

Iris Ding.
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: JAXBContextInitializer.java.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495924#comment-13495924 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi,

No, your patch isn't against the latest trunk. With latest trunk code you should have
Utils.setMethodValue(m, m2, obj, o);
but not
setMethodValue(m, m2, obj, o);

You may need use "svn update" (or "git fecth|git pull" if you use git) to grasp the latest code.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned CXF-4594:
---------------------------------

    Assignee: Freeman Fang
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>            Assignee: Freeman Fang
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496002#comment-13496002 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

sorry for the inconvenience. patch is ready now. Thanks a lot for your review!

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497781#comment-13497781 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Thanks for the patch.
But I'd like to fix WSAFromJavaTest in another way, that said, change wsdl which generate org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException to add detail property, so that client and server see same service module.
I'll take care of it and will apply the patch soon.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>            Assignee: Freeman Fang
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: CXF-4594.patch
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485846#comment-13485846 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Still another issue,  per the spec,
 The getCause, getLocalizedMessage and getStackTrace getters from java.lang.Throwable should be excluded from map, but your patch didn't match it, could you please revise your patch accordingly?

Thanks
Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497718#comment-13497718 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks a lot! I have modified org.apache.cxf.systest.ws.addr_fromjava.server.AddNumbersException to ignore detail and getDetail() method. 
I have attached the new test patch now. The WSAFromJavaTest.testAddNumbersFault() passed.

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: JAXBEncoderDecoder.java.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485797#comment-13485797 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Sorry I'm busy in other stuff.
I hope I can find some time to review it this week.
Thanks for this patch.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496940#comment-13496940 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

I have run all tests under systests\ws-specs and all 67 cases passed. How can we move on under such situation?  Thanks a lot!


Iris Ding



                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495862#comment-13495862 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Could you please create your patch against the latest trunk code, it's more easy for me to review and apply the patch? Also you can use something like
svn diff > CXF-4594.patch

to generate the patch, it's  useful when your patch include multiple files  and you can only append one patch file here.
Thanks
Freeman

                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBEncoderDecoder.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: JAXBContextInitializer.java.2.7Stream.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: JAXBContextInitializer.java.patch

Patch
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.6.3, 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: CXF-4594.patch

Patch
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-4594:
-----------------------------

    Fix Version/s:     (was: 2.7.0)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: CXF-4594.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: CXF-4594-testnew.patch
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495825#comment-13495825 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks for your review. I just uploaded the patch for JAXBEncoderDecoder. Would you please give your comments for it. Thank you very much~


Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBEncoderDecoder.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497008#comment-13497008 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Good catch!

 But it's not bug in com.sun.xml.bind.v2.runtime.unmarshaller, it's the fact that client and server in WSAFromJavaTest.testAddNumbersFault() are using different Exception.
On client side, it use org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException, which is generated from wsdl
{code}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AddNumbersException")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2012-11-14T05:45:44+08:00", comments = "JAXB RI v2.2.6")
public class AddNumbersException {
}
{code}
but on server side, it use org.apache.cxf.systest.ws.addr_fromjava.server.AddNumbersException, which is
{code}
public class AddNumbersException extends Exception {
    private static final long serialVersionUID = 4629689348515005826L;
    String detail;

    public AddNumbersException(String message, String detail) {
        super(message);
        this.detail = detail;
    }

    public String getDetail() {
        return detail;
    }
}
{code}
So on client side, it won't expect a detail element in AddNumbersException during unmarshalling.
We can't see this issue without your patch because before the "detail" property of org.apache.cxf.systest.ws.addr_fromjava.server.AddNumbersException can't get marshalled at all on server side.
Yeah, it's your patch reveal this issue. And I'd say change WSAFromJavaTest.testAddNumbersFault() to make client and server see same service model.

Thanks
Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CXF-4594:
------------------------------

    Attachment: CXF-4594-test.patch

Hi Iris,

Attached CXF-4594-test.patch.
You should ensure new added CodeFirstTest.testException() pass with your patch.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496898#comment-13496898 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

It seems latest code has big change as I tested out on 2.6.2, both the marshal and unmarshal works fine and the test patch you provied works fine on 2.6.2 but does not work in 2.7. I have revised accordingly and the test patch and other test passed in latest code. I am now attaching the new patch. Thanks a lot for your review and time!

Iris Ding

                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482204#comment-13482204 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris, 

Most likely your jax-ws spec document isn't the latest one, what I read from this part is
For each getter in the exception and its superclasses, a property of the same type and name is added to the bean. The getCause, getLocalizedMessage and getStackTrace getters from java.lang.Throwable and the getClass getter from java.lang.Object are excluded from the list of getters to be mapped.

Obviously java.lang.Object.getClass() shouldn't get mapped.

FYI,  you can download the latest JAXWS 2.2 spec from here[1], it's Maintenance Release 3 
[1]http://download.oracle.com/otndocs/jcp/jaxws-2.2-mrel3-full-oth-JSpec/

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.6.3, 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482086#comment-13482086 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi,

Thanks for the patch.
A couple of quick issues I found so far, 
1. the patch break several checkstyle and PMD rules, 
2. moreover, it at least break org.apache.cxf.systest.ws.addr_fromjava.WSAFromJavaTest.

A patch shouldn't break any test and also should follow CXF checkstyle and PMD rules.
You generally should ensure have "mvn clean install" run successfully from the root pom

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.6.3, 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496053#comment-13496053 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Thanks for the patch, we can make further progress.
However, this patch still have issues, at least it doesn't marshall the property "message" in exception, so client catch the exception but use getInfo() can only return null.

As this jira is trying to resolve an issue which IMO isn't that straightforward, we'd better have a testcase to demonstrate this scenario and ensure everything works well.

I will attach a patch which include a testcase exactly describe the scenario tracked by this issue. And your patch should make the testcase I appended here pass.

Regards
Freeman


                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495908#comment-13495908 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks a lot for your guidance. I have re-uploaded the patch: CXF-4594.patch. It is against 2.7 stream. Thanks!

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485786#comment-13485786 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Would you please let me know whether there are any problems in the new patch? Thanks a lot for your time and review!

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496198#comment-13496198 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

I'm a little bit confused, I just copy AddNumbersException as your TestException here which you described in this issue
{code}
@WebFault
public TestException extends Exception {
private String message = null;

public TestException () {
}

public TestException (String message) { this.message = message; }

public String getInfo() { return message; }

}
{code}

It should be exactly what you want, then please tell me what's the exception you wanna handle with this issue, show me the code please.

I hope this issue can really resolve the code first customer exception issue during runtime, not only generate the wsdl you want.
If you are more care about the wsdl, you can simply add
@XmlAccessorType(XmlAccessType.FIELD)
for your exception class, actually this can also resolve the property marshall problem.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486640#comment-13486640 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Ah, I missed that part, sorry.

Take a closer look at this patch and more thoughts.
Your patch simply ignore the setter method, it might work for your case, which will generate expected schema in wsdl.
However, if do unmarsell when received message, missing a setter will cause problem.

Per jaxws spec 3.7, the related part is

For exceptions that do not match the pattern described in section 2.5, JAX-WS maps those exceptions to Java beans and then uses those Java beans as input to the JAXB mapping. The following algorithm is used to map non-matching exception classes to the corresponding Java beans for use with JAXB:
1. In the absence of customizations, the name of the bean is the same as the name of the Exception suffixed with “Bean”.
2. In the absence of customizations, the package of the bean is a generated jaxws subpackage of the SEI package. E.g. if the SEI package is com.example.stockquote then the package of the bean would be com.example.stockquote.jaxws.
3. For each getter in the exception and its superclasses, a property of the same type and name is added to the bean. The getCause, getLocalizedMessage and getStackTrace getters from java- .lang.Throwable and the getClass getter from java.lang.Object are excluded from the list of getters to be mapped.
4. The bean is annotated with a JAXB @XmlType annotation. If the exception class has a @XmlType annotation, then it is used for the fault bean’s @XmlType annotation. Otherwise, the fault bean’s @XmlType annotation is computed with name property set to the name of the exception and the namespace property set to the target namespace of the corresponding portType. Additionally, the @XmlType annotation has a propOrder property whose value is an array containing the names of all the properties of the exception class that were mapped in the previous bullet point, sorted lexico- graphically according to the Unicode value of each of their characters (i.e. using the same algorithm that the int java.lang.String.compareTo(String) method uses).
5. The bean is annotated with a JAXB @XmlRootElement annotation whose name property is set, in the absence of customizations, to the name of the exception.

So IMO Per the spec, need generate this java bean on the fly which is input to the JAXB mapping, this java bean will gather getters from customer exception and add setters accordingly, and this java bean is used for JAXB to do marshal/unmarsel.

Currently CXF in code first way, just use the custom exception as input to the JAXB maping, not generate the java bean on the fly, that's why setters can't be ignored. So if you wanna follow the JAXWS spec 3.7 exactly, you must create that java bean on the fly yourself.


Thanks
Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496950#comment-13496950 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

I'd ask you run tests in eclipse or using mvn in command line?
I also encounter that in eclipse the test pass but actually not, because when run into "assert false;" , eclipse just ignore this error. But if you set break point in WSAFromJavaTest.testAddNumbersFault(), you can see what I mean.

If use mvn in command line, then what's your jdk version?
my env is
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: /Users/ffang/apache-maven-3.0.4
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"

I can get error like
Failed tests:   testAddNumbersFault(org.apache.cxf.systest.ws.addr_fromjava.WSAFromJavaTest)
  testAddNumbers3Fault(org.apache.cxf.systest.ws.addr_fromjava.WSAFromJavaTest)
And I also get same test failure with jdk6

Freeman

                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: CXF-4594-testnew.patch
                CXF-4594.patch
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482193#comment-13482193 ] 

iris ding commented on CXF-4594:
--------------------------------

HI,Freeman,

Thanks a lot for your comments!
1. Need to fix this and I will provide a new patch later.
2. some special get method like java.lang.Object.getClass would be accepted Method --This should be there because per jax-ws 2.2 spec:
For each getter in the exception and its superclasses, a property of the same type and name is added to the bean. All the getter methods except getMessage from java.lang.Throwabletype hierarchy are excluded from the list of getters to be mapped.

we should have all getMethod mapped to bean, no matter it is defined in super class or not.



                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.6.3, 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Affects Version/s:     (was: 2.6.3)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496646#comment-13496646 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

No, it still doesn't work, the property "info" can't get marshalled.
You can change my test patch and revise the Exception class whatever you want then run CodeFirstTest.testException(), you can see this problem.

We really need the test pass as it basically ensure the runtime works well.

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496188#comment-13496188 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks for your test patch and review.

The AddNumbersException does not follow javabean specification. Basically I just want to deal with the sitution that the getter method in Exception class has related private/protected/public field defined in the class.--follow javabean standard. For other cases, we just ignore it. If we want to extend the scope, it has so many situations:
1. the Exception does not have default non-arg construtor or String-arg constructor.
2. The getter method just return some systemp roperty such as system time which has no related field defined.
..

Our patch will have below benefits:
1. The generated WSDL is correct and will make all wsdl2java client works fine.
2. It has not decreased any current CXF fault processing function.

Thanks & Best Regards,

Iris Ding



 
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: JAXBEncoderDecoder.java.patch
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBEncoderDecoder.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495081#comment-13495081 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Thanks for the patch.

However, first of all, what we're talking about here is code-first way, jaxws spec 3.x is all about code first way, what this issue try to resolve here is the code first fault bean problem.
And what I suggested is using the auto-generated java-bean both on client and server side, both for marshal and unmarshal.

What your suggest here might work, though not exactly follow the spec 3.7.
But, from your new patch I can't see any change related to JAXBEncoderDecoder you suggested here, did you miss it?

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495062#comment-13495062 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Thanks a lot for your review and comments. 

I have a look for the problem again and found if we used wsdl2java to generate client club classes, it works well. 
There will be issue if we use dynamic client which means we do not create any client stub classes before hand. In such case, in JAXBEncoderDecoder.unmarshallException() method it will fail because it will call the setter method to set the related valued for the Exception.
In such case, as client is only aware of the original Exception class so generating faultbean on the fly by ourself does not work. I propose below solution for this problem, would you please help to give your valuable comments for this?

In JAXBEncoderDecoder.unmarshallException() when there is no corresponding setter method: try to see whether the Exception class has related filed defined and if so, set the value of the field directly. If not, then just catch NoSuchMethodException and do nothing with the it--just ignore it.

Thanks & Best Regards,

Iris Ding

                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: CXF-4594.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497803#comment-13497803 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Iris,

No problem. Welcome to open source world!

Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>            Assignee: Freeman Fang
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment:     (was: CXF-4594-testnew.patch)
    
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496928#comment-13496928 ] 

Freeman Fang commented on CXF-4594:
-----------------------------------

Hi Iris,

Thanks for the new patch.
Unfortunately your new change in org.apache.cxf.jaxb.Utils breaks the org.apache.cxf.systest.ws.addr_fromjava.WSAFromJavaTest in systests/ws-specs module,
Do you mind take another look?

Thanks
Freeman
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497794#comment-13497794 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

Many Thanks! Very nice experience working with you and in my open source journey. 

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>            Assignee: Freeman Fang
>              Labels: patch
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

iris ding updated CXF-4594:
---------------------------

    Attachment: JAXBContextInitializer.java.2.7Stream.patch

Hi Freeman,

Thanks a lot for your review and comments!

The new patch is read now. Pls help to review , Thanks a lot!

Iris Ding
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved CXF-4594.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.1
                   2.6.4
                   2.5.7

patch applied on behalf of Iris Ding with thanks
                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>            Assignee: Freeman Fang
>              Labels: patch
>             Fix For: 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4594.patch, CXF-4594-testnew.patch, CXF-4594-test.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4594) Incompatible fault type is generated in the wsdl if no setter method in Exception

Posted by "iris ding (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486608#comment-13486608 ] 

iris ding commented on CXF-4594:
--------------------------------

Hi Freeman,

The getCause, getLocalizedMessage and getStackTrace getters from java.lang.Throwable has already been excluded in the original logic of the method:

if (Modifier.isStatic(method.getModifiers()) 
             || method.isAnnotationPresent(XmlTransient.class)
-            || !Modifier.isPublic(method.getModifiers())) {
+            || !Modifier.isPublic(method.getModifiers())
+            || "getClass".equals(method.getName())) {
             return false;
         }
 
@@ -455,7 +456,14 @@
             || method.getDeclaringClass().equals(Throwable.class)) {
             return false;
         }

So we do not need to exclude them any more in the patch. 

Thanks a lot for your review!

Iris Ding


                
> Incompatible fault type is generated in the wsdl if no setter method in Exception
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-4594
>                 URL: https://issues.apache.org/jira/browse/CXF-4594
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.0
>            Reporter: iris ding
>              Labels: patch
>             Fix For: 2.7.0
>
>         Attachments: JAXBContextInitializer.java.2.7Stream.patch, JAXBContextInitializer.java.patch
>
>
>  with the exception class below , it only has a get*** method for the
> info property.
> @WebFault
> public TestException extends Exception {
>      private String message = null;
>     public TestException () {
>     }
>     public TestException (String message) {
>         this.message = message;
>     }
>     public String getInfo() {
>         return message;
>     }
> }
> With the RI wsgen command, the generated schema type is :
> RI:
> <xs:complexType name="TestException">
>     <xs:sequence>
>       <xs:element name="info" type="xs:string" minOccurs="0"/>
>       <xs:element name="message" type="xs:string" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> If using CXF tool or on the CXF runtime, the generated schema type for the
> exception is :
> <xs:element name="TestException" type="tns:TestException"/>
> <xs:complexType name="TestException">
> <xs:sequence/>
> </xs:complexType>
> With the JaxWS spec, 3.7 Service Specific Exception, considering that no
> getFaultInfo or faultBean in WebFault annotation is provided, the
> special algorithm will be used to map the exception to jaxb bean, one of
> the steps write below:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.
> Seems that only getter method is required, with the current codes in static
> boolean JAXBContextInitializer.isMethodAccepted, it will check whether the
> setter exists. I am thinking that this is not required for this scenario,
> as we only need to read the information from the user exception.
> The patch will return true is the  getter method has no corresponding setter method to let CXF comply with the jax-ws 2.2 spec:
> For each getter in the exception and its superclasses, a property of the
> same type and name is added to
> the bean. All the getter methods except
> getMessagefromjava.lang.Throwabletype hierarchy
> are excluded from the list of getters to be mapped.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira