Bug 1040703 - [GSS] (6.2.x) JAXBDataBinding can not handle the exception with generic objects like ObjectWithGenerics<Boolean, Integer>
Summary: [GSS] (6.2.x) JAXBDataBinding can not handle the exception with generic objec...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Services
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.3.0
Assignee: Jim Ma
QA Contact: Rostislav Svoboda
Russell Dickenson
URL:
Whiteboard:
Depends On: 1040732
Blocks: eap62-cp04-blockers 1069354 1112172
TreeView+ depends on / blocked
 
Reported: 2013-12-11 23:04 UTC by Kyle Lape
Modified: 2018-12-06 15:34 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
: 1040732 (view as bug list)
Environment:
Last Closed: 2014-06-28 15:43:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
verifier (13.38 KB, application/zip)
2014-03-05 08:36 UTC, Petr Sakař
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA CXF-5437 0 None None None Never

Description Kyle Lape 2013-12-11 23:04:31 UTC
When the Exeception has some generics object like:

@javax.xml.ws.WebFault
public class GenericsException extends Exception {
    private static final long serialVersionUID = 1L;
    private ObjectWithGenerics<Boolean, Integer> obj;

    public ObjectWithGenerics<Boolean, Integer> getObj() {
        return obj;
    }
    public void setObj(ObjectWithGenerics<Boolean, Integer> obj) {
        this.obj = obj;
    }
}

Both the wsdl generated from the exception class is wrong and soap fault message is not expected.

Comment 5 Rostislav Svoboda 2014-02-18 11:14:47 UTC
@Kyle 
If this BZ is not intended for EAP 6.3.0 please remove all flags and change target release.

I granted qa_ack for https://bugzilla.redhat.com/show_bug.cgi?id=1040732

Comment 6 Kyle Lape 2014-02-18 21:40:18 UTC
Changing to 6.2.2 and marking as POST since the PR for CXF 2.7.10 has been sent for 6.2.2.

Comment 8 Kyle Lape 2014-03-05 07:46:27 UTC
In CXF project:

cd systests
mvn test -Dtest=GenericExceptionTest -DfailIfNoTests=false

If you need something to test in JBoss (e.g. a deployment), I can provide one.

Comment 9 Petr Sakař 2014-03-05 08:31:19 UTC
Verification failed as wrong WSDL is generated.
see https://issues.jboss.org/browse/JBPAPP-10927?focusedCommentId=12931262&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12931262 for explanation


Currently generated wrong WSDL (check type of pair) for 


@WebFault
@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
public class PairException extends Exception {

  private static final long serialVersionUID = -1581844125108670118L;

  public PairException(String message) {
    super(message);
    init();
  }

  private long age = 20L;
  private Pair<Integer, Boolean> info = new Pair<Integer, Boolean>(1, false);
  private List<Boolean> flags = null;
....
}

generated

<xs:complexType name="PairException">
  <xs:sequence>
    <xs:element name="age" nillable="true" type="xs:long"/>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="flags" type="xs:boolean"/>
    <xs:element name="info" nillable="true" type="xs:int"/>
    <xs:element minOccurs="0" name="message" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

expected 

<xs:complexType name="PairException">
  <xs:sequence>
    <xs:element name="age" nillable="true" type="xs:long" />
    <xs:element maxOccurs="unbounded" minOccurs="0" name="flags" type="xs:boolean" />
    <xs:element minOccurs="0" name="info" type="tns:pair" />
  </xs:sequence>
</xs:complexType>

Comment 10 Petr Sakař 2014-03-05 08:36:04 UTC
Created attachment 870867 [details]
verifier

unzip eap

unzip verifier.zip
cd test
mvn clean verify -Deap-managed-6x -Djboss.home=PATH_TO_EAP

Comment 11 Jim Ma 2014-03-06 11:25:51 UTC
Checked EAP 6.2.2 , and it can generate the element for the generic object : 
<xs:complexType name="PairException">
  <xs:sequence>
    <xs:element name="age" nillable="true" type="xs:long"/>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="flags" type="xs:boolean"/>
    <xs:element name="info" nillable="true" type="tns:pair"/>
    <xs:element minOccurs="0" name="message" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

The only issue here is the nillable="true" should not be there. I've fixed this issue in cxf: https://issues.apache.org/jira/browse/CXF-5596.

I think this BZ can be set to resolved at the moment give the element is generated for the generic object. We can create another BZ to log this nillable="true" issue.
Petr, what do you think ?

Comment 12 Rostislav Svoboda 2014-03-06 13:21:14 UTC
Petr has PTO, will be back on Monday. I agree with proposed solution by Jim if it's sufficient from GSS perspective. Kyle, can you please confirm ?

Kyle, could you please create BZ for 6.2.3 and link it with EAP 6.2.3 (CP03) Blockers Tracker ?

When this is done, we can proceed with verification for the generic object.

Comment 13 Kyle Lape 2014-03-10 02:59:30 UTC
I've opened https://bugzilla.redhat.com/show_bug.cgi?id=1074368 against EAP 6.3.0.  

Is CXF-5596 a regression introduced by the fix for CXF-5437?  If so, I'll log a 6.2.x BZ.  Otherwise I may not open a BZ for 6.2.x since this is neither critical nor directly reported by a customer.

Comment 14 Jim Ma 2014-03-10 03:19:06 UTC
Kyle, from the cxf test case and jaxb databinding code. CXF-5596 isn't the regression for CXF-5437.  We can just fix it against EAP 6.3.0.

Comment 15 Vaclav Tunka 2014-03-20 23:01:45 UTC
Not sure of current status with the fix, setting on ON_QA because of the CXF upgrade. If this is not fixed by EAP 6.2.2.CR3, please feel free to modify this BZ accordingly.

Comment 16 Petr Sakař 2014-03-21 07:49:44 UTC
I've retested with EAP 6.2.2.CP.CR3 (AS 7.3.2.Final-redhat-2)
The issue is not fixed. Results are the same as in comment#9.

Comment 18 Russell Dickenson 2014-05-13 05:26:35 UTC
Attention: Kyle

I have drafted a Release Notes entry for this BZ ticket but I need confirmation as to whether or not it is accurate.

Comment 19 Jim Ma 2014-05-16 06:18:30 UTC
Petr, did you verify against it after we included cxf 2.7.11 ? There is cxf test verify this fix, please see https://issues.apache.org/jira/browse/CXF-5596. I can confirm this new issue has been resolved.

Comment 20 Kyle Lape 2014-06-05 23:35:07 UTC
This is actually fixed in EAP 6.2.2 since it consumes CXF 2.7.10.

Comment 21 Jan Blizňák 2014-06-19 13:16:18 UTC
Using attached verifier for verification gives me for:


@WebFault
@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
public class PairException extends Exception {

  private static final long serialVersionUID = -1581844125108670118L;


  private long age = 20L;
  private Pair<Integer, Boolean> info = new Pair<Integer, Boolean>(1, false);
  private List<Boolean> flags = null;
....
}


generated WSDL containing:

<xs:complexType name="PairException">
  <xs:sequence>
    <xs:element minOccurs="0" name="age" type="xs:long"/>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="flags" type="xs:boolean"/>
    <xs:element minOccurs="0" name="info" type="tns:pair"/>
    <xs:element minOccurs="0" name="message" type="xs:string"/>
  </xs:sequence>
</xs:complexType>


So the issue is fixed, but this output differs from what Petr posted in comment#9 as expected output in having extra element "message".

Jim didn't complain about it in comment#11, but I don't know if it is correct or not.

If this is not a problem, BZ can be set as verified with 6.2.4.CP.CR1

Comment 22 Jan Blizňák 2014-06-23 08:54:35 UTC
from IRC:

(10:34:38) rsvoboda: jimma, ping .. Hi Jim, we need your feedback on https://bugzilla.redhat.com/show_bug.cgi?id=1040703
(10:34:38) unifiedbot: [1040703] [GSS] (6.2.x) JAXBDataBinding can not handle the exception with generic objects like ObjectWithGenerics<Boolean, Integer> [JBoss Enterprise Application Platform 6] [ema:ON_QA]
(10:35:00) rsvoboda: jimma, we do not expect     <xs:element minOccurs="0" name="message" type="xs:string"/> element  ....
(10:35:53) rsvoboda: jimma, we expect output like https://issues.jboss.org/browse/JBPAPP-10927?focusedCommentId=12931262&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12931262
(10:36:56) jimma: rsvoboda, It should be generated. I fixed it in cxf. Let me find the CXF jira number for you . 
(10:37:31) rsvoboda: jimma,  fix should be for   <xs:element minOccurs="0" name="info" type="tns:pair" /> ... and it's fine now
(10:37:44) rsvoboda: jimma, but there is one additional element now :(
(10:40:04) jimma: rsvoboda, message element doesn't hurt customer's  use case.  And it should be generated. 
(10:40:36) rsvoboda: jbliznak, -^
(10:40:53) rsvoboda: jimma, I'm checking EAP 5.3.0 ER3 to see how it's working there
(10:41:14) rsvoboda: jimma, I received:
(10:41:16) rsvoboda:    <xs:complexType name='PairException'>
(10:41:16) rsvoboda:     <xs:sequence>
(10:41:16) rsvoboda:      <xs:element name='age' type='xs:long'/>
(10:41:17) rsvoboda:      <xs:element maxOccurs='unbounded' minOccurs='0' name='flags' type='xs:anyType'/>
(10:41:19) rsvoboda:      <xs:element minOccurs='0' name='info' type='tns:pair'/>
(10:41:21) rsvoboda:      <xs:element minOccurs='0' name='message' type='xs:string'/>
(10:41:23) rsvoboda:     </xs:sequence>
(10:41:25) rsvoboda:    </xs:complexType>
(10:41:36) rsvoboda: jimma, so element with name 'message' is present on EAP 530 ER3
(10:42:31) jimma: rsvoboda, yes if EAP 530 has updated cxf and has included my fix. 
(10:44:01) jimma: rsvoboda, I fixed this for jira : https://issues.apache.org/jira/browse/CXF-5230


Verified with 6.2.4.CP.CR1


Note You need to log in before you can comment on or make changes to this bug.