users@jaxb.java.net

Re: How to resolve class/interface conflict

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Fri, 21 Jan 2005 10:15:17 -0500

Hristo Stoyanov wrote:
> Hi all-,
> I am getting the below conflicts, trying to compile these schemas
> (http://www.irs.gov/efile/article/0,,id=128360,00.html). Since there are
> way to many conflicts, it is not feasible to write customization file
> and enumerate all of them. Is there any xjc compile option, so it can
> ignore all duplicate classes? I tried that with XmlBeans and it workds
> just fine.

No, there is no option to ignore duplicate classes, but there are
customizations that will help you resolve most of them automatically.
Please take a look at the "fix-collides"[1] sample app in your JAXB
distribution. I'm guessing that you have conflicts between global
elements and complexTypes in your schema. In that case, you'll want
to use the jxb:nameXmlTransform customization. If there are other
naming conflicts between the schema and Java reserved words, then
you'll have to use the jxb:class customization (which is also shown
in the sample app).

Thanks,

--Ryan

[1] $JAXB_HOME/samples/fix-collides/binding.xjb

> ------------------------------
> [ERROR] A class/interface with the same name
> "gov.irs.efile.GeneralDependencyTyp
> e" is already in use. Use a class customization to resolve this conflict.
> line 43 of GeneralDependency.xsd
> [ERROR] (Relevant to above error) another "GeneralDependencyType" is
> generated f
> rom here.
> line 25 of GeneralDependency.xsd
> [ERROR] A class/interface with the same name
> "gov.irs.efile.IRS1120EliminationsO
> rAdjType" is already in use. Use a class customization to resolve this
> conflict.
> line 91 of IRS1120EliminationsOrAdjustments.xsd
> [ERROR] (Relevant to above error) another "IRS1120EliminationsOrAdjType"
> is gene
> rated from here.
> line 29 of IRS1120EliminationsOrAdjustments.xsd
> [ERROR] A class/interface with the same name
> "gov.irs.efile.IRS1120SchM3Eliminat
> ionsOrAdjType" is already in use. Use a class customization to resolve
> this conf
> lict.
> line 51 of IRS1120ScheduleM3EliminationsOrAdjustments.xsd
> [ERROR] (Relevant to above error) another
> "IRS1120SchM3EliminationsOrAdjType" is
> generated from here.
> line 27 of IRS1120ScheduleM3EliminationsOrAdjustments.xsd
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Search presents - Jib Jab's 'Second Term'
> <http://us.rd.yahoo.com/evt=30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net