phax/peppol-commons

JAXB mapping conflict

patrickvanamstel opened this issue · 5 comments

While combining the peppol-commons libray i encounterd the problem of a duplicate
jaxb mapping.

The org.w3c._2001.Adapter1 class is created in more than one place. (This is offcource
not in the peppol-commons project alone.).

This problem arises when there are more than 1 global mappings. Jaxb mappings are global.

So i ran into a duplicate class definition problem.

To solve this problem you only have to add an xml file into the wsdl folder. After that the Adapter1.class is put into the helger package as described in the xml below.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.w3.org/2001/XMLSchema"
  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
  jaxb:version="2.0">
  <annotation><appinfo>
    <jaxb:schemaBindings>
      <jaxb:package name="com.helger.peppol.wsdl"/>
    </jaxb:schemaBindings>
  </appinfo></annotation>
</schema>

Would it be an idea to add the xsd file into the wsdl folder?

phax commented

Hi Patrick!

Thanks for identifying this. I took the liberty of adding the source https://jaxb.java.net/guide/Customizing_Java_packages.html#Tip__get_rid_of_the_org_w3__2001_xmlschema_package instead of your post :)

Do you urgently need a release 4.0.1 or can it wait until more things happen?

Thanks,
Philip

Philip,

Thank you for implementing a solution.

I just released a local branch.

Our next release will take your new release.

Regards,
Patrick van Amstel

On 08/27/2015 02:47 PM, Philip Helger wrote:

Hi Patrick!

Thanks for identifying this. I took the liberty of adding the source
https://jaxb.java.net/guide/Customizing_Java_packages.html#Tip__get_rid_of_the_org_w3__2001_xmlschema_package
instead of your post :)

Do you urgently need a release 4.0.1 or can it wait until more things
happen?

Thanks,
Philip


Reply to this email directly or view it on GitHub
#2 (comment).

phax commented

Hi Patrick!
Just tell me, and you get a release - it's no big deal.
Anyway 4.0.1 is just on its way to Maven Central and will be available there within the next half hour.
// Philip

Thx,

That is soon enough

regards
Patrick van Amstel

On 08/28/2015 10:10 AM, Philip Helger wrote:

t on

FYI, I have run into this problem before and I solved it by in my own code specifying the package name on the compile line, e.g. xic -p com.me.b2b.etc so that Adapter1 for my code was in a package of my naming rather than a global package name.