Bug 1125159 - JAXB - cannot resolve class name conflicts, annotations are ignored
Summary: JAXB - cannot resolve class name conflicts, annotations are ignored
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: DR3
: 6.1.0
Assignee: Shelly McGowan
QA Contact: Lukáš Petrovický
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-31 08:28 UTC by Zuzana Krejčová
Modified: 2020-03-27 19:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2020-03-27 19:33:54 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1103650 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 1125077 0 high CLOSED A project which contains interface java classes fails to build with "JAXB can't handle interfaces." 2021-02-22 00:41:40 UTC

Internal Links: 1103650 1125077

Description Zuzana Krejčová 2014-07-31 08:28:23 UTC
Description of problem:
If a project contains two classes with the same name (different packages), these classes must be properly annotated to avoid name conflict. In 6.0.2, these annotations are being ignored, it seems.

Version-Release number of selected component (if applicable):
BPMS 6.0.2 CR2/GA

Steps to Reproduce:
1. Create a project with org.MyClass and org.kie.MyClass.
2. In editor of your choice add @XmlType(namespace="org") annotation to org.MyClass and @XmlType(namespace="org.kie") annotation to org.kie.MyClass. (Commit and push changes back to business-central.)
3. In the business-central, go to Project Editor and try to 'Build & Deploy'.

Actual results:
"Deployment of unit <unit> failed: Unable to instantiate JAXBContext for deployment '<unit>'." in Problems panel,
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "myClass". Use @XmlType.name and @XmlType.namespace to assign different names to them.
	this problem is related to the following location:
		at org.MyClass
	this problem is related to the following location:
		at org.kie.MyClass
in server log. (More details in bug 1103650.)

Expected results:
Deployment is successful, no conflicts.

Additional info:
The issue seems fixed in 6.1 branch. With 6.1 DR1, following the Steps to Reproduce, the project is built and deployed just fine.
In 6.0.2, even changing the name via @XmlType or adding @XmlRootElement with unique name didn't help.

Comment 3 Kris Verlaenen 2014-08-26 12:07:10 UTC
As described in the BZ, should already be working for 6.1 so setting to MODIFIED for verification.

Comment 4 Zuzana Krejčová 2014-09-23 11:16:09 UTC
Works with 6.1.0 DR3 BPMS.

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