users@jaxb.java.net

Re: Duplicate QName in ObjectFactory when using episode

From: John MacAuley <john_at_blackacorn.ca>
Date: Sat, 16 May 2015 13:10:54 -0400

Alexander,

Why not create a separate jar containing the xjc generated objects from the schema of both projects A and B then use this common jar in both projects? This would probably be the easiest fix.

John

On 2015-05-16, at 12:42 PM, Alexander SCHULZ <alexander.schulz_at_soprasteria.com> wrote:

> Hello,
>
> I have a problem with JAXB generated ObjectFactory. The situation is as follows:
>
> I have a “project A” with some object mappings generated by xjc from a schema. I declared it as episode, so an episode description file is generated.
>
> There is a second “project B” which uses project A and also generates Mapping from its own schema. The schema of project B references the schema of project A. xjc uses the episodes mechanism and uses the classes from project A. So far so good.
>
> At runtime, when jaxb initializes, an exception is raised because of duplicate QName entries. Some of the classes from project A, which have QName entries in the ObjectFactory of project A, also have a QName entry in the ObjectFactory of project B, but the classes are not generated a second time.
>
> Please can you give me a hint whats wrong.
>
> Thank you very much!
>
> Mit freundlichen Grüßen
>
> Alexander SCHULZ
> Manager, Utilities
> <image002.png>
> Sopra Steria GmbH
> Friedrichstraße 148
> 10117 Berlin - Deutschland
> Phone: +49 30 206188-7274 - Mobile: 0160 7418482
> alexander.schulz_at_soprasteria.com - www.soprasteria.de
> Before printing, think about the environment.
> The content of this message may be confidential, legally privileged and protected by law. Unauthorized use, copying or disclosure of any of it may be unlawful. If you are not the intended recipient please notify the sender and remove it from your system. While attachments to this e-mail are checked for viruses, we do not accept any liability for any damage sustained by viruses.
>
> Sopra Steria Consulting is the trading name of the following companies:
> (i) Sopra Steria GmbH - Vorsitzender des Aufsichtsrates: François Enaud - Geschäftsführer: Urs Michael Krämer - Sitz der Gesellschaft: Hamburg - HR B 130165 Amtsgericht Hamburg - USt-ID-Nr.: DE118671351
> (ii) Sopra Group GmbH - Geschäftsführer: Xavier Pecquet - Sitz der Gesellschaft: Frankfurt am Main - HR B 79327 Amtsgericht Frankfurt am Main - USt-ID-Nr.: DE148265247