users@jaxb.java.net

Re: 1.0.1 generated code does not compile (extends generated.Foo)

From: Gary Gregory <ggregory_at_seagullsw.com>
Date: Wed, 09 Jul 2003 20:12:18 -0400

> Perhaps your javac invocation doesn't specify this as the source
directory?

Nope, XJC generated "generated" ;-) all by itself as far as I can tell. We
do not use "generated" anywhere in our code or build.xml files

I've since significantly redone my XSDs for other reasons and this problem
no longer happens but... perhaps XJC should blow up with an error message
rather than generate code that cannot be compiled, wouldn't you say? OTOH,
maybe going as far as you can, from XJC's POV is better for debugging the
output. Just a thought.

Thanks,
Gary

-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Wednesday, July 09, 2003 16:44
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: Re: 1.0.1 generated code does not compile (extends generated.Foo)

Gary Gregory <ggregory_at_seagullsw.com> wrote:
> Hello,
>
> JAXB 101 generates code that does not compile of the form:
>
> public interface DomainCredentials
> extends generated.Credentials
> ..
>
> where "generated" is not a package/namespace I have specified. Saving the
> XSDs in XMLSpy 5.4 does not report any errors and neither does XJC.

I compiled your schema and noticed that the "generated" directory is
indeed generated by XJC. Perhaps your javac invocation doesn't specify
this as the source directory?

The reason why this rather awkward package is generated is because your
security.xsd has no target namespace. You could use a schema-level
customization for this schema to specify a better Java package name.


regards,
--
Kohsuke Kawaguchi                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com