users@jaxb.java.net

xjc on windows emits bogus Type is already defined errors

From: Christoph Sturm <christoph.sturm_at_gmail.com>
Date: Tue, 20 Dec 2005 17:30:11 +0100

Hey Steve, Hey Ed,

Thanks to both of you for trying to help!

I found out that the difference in my set up and yours was that in my
setup I had spaces in the path to the directory where the schemas were
located.

after moving my project directory from the desktop to e:\ the build
now works for me too.

I should have thought about that earlier, but now it works.

regards
 chris

On 12/20/05, Perry, Steve <Steve.Perry_at_fnf.com> wrote:
> Chris: I unzipped the files onto a directory on my machine (running
> Windows XP Pro), and ran the build without any modifications to the
> schemas. I did change the build script s little bit to reference the
> necessary JARs directly from the JWSDP 1.6 (which uses JAXB
> 1.0.5-b16-fcs, I'm a little confused about the version you indicate)
> distro. I also used Ant 1.6.2 to run the build. Here's the output I got:
>
> C:\develop\jaxb-issues\sturm-12-20-05>c:\apache-ant-1.6.2\bin\ant
> Buildfile: build.xml
>
> init:
> [delete] Deleting directory
> C:\develop\jaxb-issues\sturm-12-20-05\target\xjc
> [delete] Deleting directory
> C:\develop\jaxb-issues\sturm-12-20-05\target\jaxb_classes
> [mkdir] Created dir:
> C:\develop\jaxb-issues\sturm-12-20-05\target\xjc
> [mkdir] Created dir:
> C:\develop\jaxb-issues\sturm-12-20-05\target\jaxb_classes
>
> xjc:
> [xjc] Consider using <depends>/<produces> so that XJC won't do
> unnecessary compilation
> [xjc] Compiling
> file:/C:/develop/jaxb-issues/sturm-12-20-05/xsd1/schema1.xsd and others
> [xjc] [WARNING] Schema contains no global element declaration.
> [xjc] unknown location
>
> [xjc] Writing output to
> C:\develop\jaxb-issues\sturm-12-20-05\target\xjc
>
> BUILD SUCCESSFUL
> Total time: 6 seconds
> C:\develop\jaxb-issues\sturm-12-20-05>
>
> A couple of warnings, but the code generated fine. Are you sure the
> schemas you sent cause an error?
>
> --steve
>
> > -----Original Message-----
> > From: Christoph Sturm [mailto:christoph.sturm_at_gmail.com]
> > Sent: Monday, December 19, 2005 7:31 PM
> > To: users_at_jaxb.dev.java.net
> > Cc: Perry, Steve
> > Subject: Re: xjc on windows emits bogus Type is already defined errors
> >
> > hey steve!
> >
> > Here's a small zip file that illustrates the error.
> >
> > Looking at the files I think an easy fix would be to just
> > remove the import statements for the other schema files.
> > Nevertheless it looks like an error in xjc to me
> >
> > btw, i am using jaxb 1.0.6.
> >
> > to run the example you need to put the jaxb jars in a
> > subdirectory named lib.
> >
> > regards
> > chris
> >
> > On 12/19/05, Perry, Steve <Steve.Perry_at_fnf.com> wrote:
> > > Chris: can you provide a simple (perhaps even contrived)
> > example that
> > > fails on Windows but not Unix (or even your real schema
> > files)? Seems
> > > I've run into this before. I'd be happy to look at it.
> > >
> > > --steve
> > >
> > > > -----Original Message-----
> > > > From: Christoph Sturm [mailto:christoph.sturm_at_gmail.com]
> > > > Sent: Monday, December 19, 2005 2:35 PM
> > > > To: users_at_jaxb.dev.java.net
> > > > Subject: xjc on windows emits bogus Type is already defined errors
> > > >
> > > > Hey people!
> > > >
> > > > I have a strange problem with xjc. It works perfectly on unix and
> > > > mac osx, but when i try to build on windows i get a lot of
> > > > errormessages saying "xxxType" is already defined.
> > > >
> > > > this is how my xjc task looks like:
> > > >
> > > > <xjc target="target/xjc" package="blabla"
> > extension="true">
> > > > <schema dir="xsd">
> > > > <include name="*.xsd"/>
> > > > </schema>
> > > > </xjc>
> > > >
> > > > It seems that the problems happens like this:
> > > > one schema file imports the namespace of another schemafile, and
> > > > that makes xjc load the imported schema file. Later when it
> > > > processes the file that was imported by the other file it
> > parses it
> > > > again, and finds all types already defined, and thats why
> > it outputs
> > > > the error.
> > > >
> > > > These schema files compile fine with the xmlbeans 2 compiler.
> > > > and they compile fine with xjc on unix. Just on windows i
> > get this
> > > > nasty error.
> > > > Any idea what i can do to avoid this?
> > > >
> > > > thanks
> > > > chris
> > > >
> > > >
> > --------------------------------------------------------------------
> > > > - To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> > > > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> > > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> > >
> > >
> >
> >
> > --
> > christoph.sturm_at_gmail.com
> >
> >
>


--
christoph.sturm_at_gmail.com
--
christoph.sturm_at_gmail.com