Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-deterministic definition of default namespace @XmlSchema(namespace=...) in package-info.java #1682

Closed
dmak opened this issue Jan 18, 2023 · 2 comments · Fixed by #1693
Closed

Comments

@dmak
Copy link

dmak commented Jan 18, 2023

Dear community,

I observe the following behavior on XJC v4.0.1:

The value of namespace member of @XmlSchema is not defined in deterministic way, i.e. it changes from run to run. In particular when model for this XSD is generated, it results either this package-info.java:

@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://example.com/entry", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED)
package different_namespaces;

or this:

@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://example.com/namespaces", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED)
package different_namespaces;

In case if sources are regenerated from time to time and committed to source repository, it results excessive differences (because default namespace is skipped in annotations for generated classes).

lukasj added a commit to lukasj/jaxb-ri that referenced this issue Jan 26, 2023
…@XmlSchema(namespace=...) in package-info.java

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
lukasj added a commit that referenced this issue Jan 26, 2023
…amespace=...) in package-info.java

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
lukasj added a commit to lukasj/jaxb-ri that referenced this issue Feb 1, 2023
… @XmlSchema(namespace=...) in package-info.java

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
(cherry picked from commit adeec65)
lukasj added a commit that referenced this issue Feb 1, 2023
…namespace=...) in package-info.java

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
(cherry picked from commit adeec65)
@danshome
Copy link

danshome commented Sep 7, 2023

@lukasj After we upgraded from JAXB-RI 4.0.2 to 4.03 we started getting form=qualified added to all our xsd elements that are generated using the com.sun.xml.ws:jaxws-maven-plugin. We don't find anything in the JAXB-RI release notes that seem related, but we stumbled on this change and It seems like it could be related. Do you know of a way to stop that from happening?

I've tried adding the following to the package-info.java

@jakarta.xml.bind.annotation.XmlSchema (
elementFormDefault= XmlNsForm.UNQUALIFIED
)

For example using JAXB-RI 4.0.3 "element1" has form="qualified"...

<xs:element name="element1" type="xs:string" form="qualified" nillable="true" minOccurs="0" maxOccurs="unbounded"/>

If I move back to JAXB-RI 4.0.2 then form="qualified" is gone.

<xs:element name="element1" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>

I am aware that it is recommended to qualify all elements, but I am hesitant to inform all of our clients as it would require them to modify their SOAP requests, and I fear the potential backlash that could result from it.

@lukasj
Copy link
Member

lukasj commented Oct 6, 2023

that regression is now fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants