Bug 1040703
Summary: | [GSS] (6.2.x) JAXBDataBinding can not handle the exception with generic objects like ObjectWithGenerics<Boolean, Integer> | ||||||
---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Kyle Lape <klape> | ||||
Component: | Web Services | Assignee: | Jim Ma <ema> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Rostislav Svoboda <rsvoboda> | ||||
Severity: | unspecified | Docs Contact: | Russell Dickenson <rdickens> | ||||
Priority: | unspecified | ||||||
Version: | 6.2.0 | CC: | bmaxwell, cdewolf, ema, jbliznak, klape, myarboro, nobody, smumford, vtunka | ||||
Target Milestone: | CR1 | ||||||
Target Release: | EAP 6.3.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: |
Previous releases of JBoss EAP 6 carried an issue wherein, when an Exception class has some members with type parameters defined as in the following example, the WSDL generated from the exception class is incorrect and the SOAP fault message is not expected.
----
@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;
}
}
----
This issue has been resolved in this release.
|
Story Points: | --- | ||||
Clone Of: | |||||||
: | 1040732 (view as bug list) | Environment: | |||||
Last Closed: | 2014-06-28 15:43:32 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | 1040732 | ||||||
Bug Blocks: | 1067534, 1069354, 1112172 | ||||||
Attachments: |
|
Description
Kyle Lape
2013-12-11 23:04:31 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 Changing to 6.2.2 and marking as POST since the PR for CXF 2.7.10 has been sent for 6.2.2. 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. 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> Created attachment 870867 [details]
verifier
unzip eap
unzip verifier.zip
cd test
mvn clean verify -Deap-managed-6x -Djboss.home=PATH_TO_EAP
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 ? 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. 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. 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. 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. 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. 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. 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. This is actually fixed in EAP 6.2.2 since it consumes CXF 2.7.10. 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 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 |