Yes, here's the explanation: your root XML schema seems to import (at
least) two other XML schema. By default, the Castor XML code generator
will *not* generate sources for these schemas, hence the reminder.
Personally, I'd advise you to consider using

SourceGenerator.setGenerateImportedSchemas(true)

to instruct the code generator to do so.

About the 'name colission' ... hmm, it looks like you are running in
element mode, and that you should be using a binding file to avoid those
and make class names 'unique'.

Wrt the IllegalStateException, I won't be able to tell without replaying
 your generation scenario. Can you please create a new Jira issue at

http://jira.codehaus.org/browse/CASTOR

and attach all relevent files, incl. XML schemas, binding file (if you
use one), castorbuilder.properties (if you use such a file, e.g. for
namespace to package mappings), the parameters used to call the generator.

Werner

climbingrose wrote:
> Hi,
> 
> I'm trying to generate java source for MODS (Metadata Object Description
> Schema) using the included SourceGenerator. The schema is located here:
> http://www.loc.gov/standards/mods/v3/mods-3-2.xsd. I got the following
> error:
> 
> 12:39:33,187  WARN SourceGenerator:731 - Warning: Do not forget to generate
> source code for the following imported schema:
> http://www.loc.gov/standards/xlink.xsd
> 12:39:33,190  WARN SourceGenerator:731 - Warning: Do not forget to generate
> source code for the following imported schema:
> http://www.w3.org/2001/xml.xsd
> 
> com/test/Mods.java already exists. overwrite(y|n|a|?)a
> 
> java.lang.IllegalArgumentException: Duplicate name found as a class member:
> _type
>       at org.exolab.javasource.JClass.addField(JClass.java:172)
>       at 
> org.exolab.castor.builder.FieldInfo.createJavaField(FieldInfo.java:183)
>       at
> org.exolab.castor.builder.SourceFactory.handleField(SourceFactory.java:1916)
>       at
> org.exolab.castor.builder.SourceFactory.processAttributes(SourceFactory.java:1554)
>       at
> org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:1674)
>       at
> org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.java:633)
>       at
> org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:340)
>       at
> org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGenerator.java:903)
>       at
> org.exolab.castor.builder.SourceGenerator.generateAllClassFiles(SourceGenerator.java:693)
>       at
> org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:654)
>       at
> org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:595)
>       at
> org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:497)
>       at
> org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:245)
> 
> Any ideas?
> 
> Thanks.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to