[ 
http://jira.codehaus.org/browse/MCASTOR-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205983#action_205983
 ] 

Marco Beelen commented on MCASTOR-20:
-------------------------------------

Test the project from the zip with: 

<groupId>org.codehaus.mojo</groupId>
<artifactId>castor-maven-plugin</artifactId>
<version>2.0</version>

The NoClassDefFoundError is solved.


(I can't generate the sources, due to:

Embedded error: An Exception occurred processing 
C:\data\projects\sandbox\generateFaillureCastor\src\main\castor\xNL.xsd
Duplicate name found as a class member: _type
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Castor execution failed
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Castor execution 
failed
        at org.codehaus.mojo.castor.GenerateMojo.execute(GenerateMojo.java:280)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.apache.maven.plugin.MojoExecutionException: An Exception 
occurred processing C:\data\projects\sandbox\generateFaillureCastor\src\main\c
astor\xNL.xsd
        at 
org.codehaus.mojo.castor.GenerateMojo.processFile(GenerateMojo.java:534)
        at org.codehaus.mojo.castor.GenerateMojo.execute(GenerateMojo.java:270)
        ... 19 more
Caused by: java.lang.IllegalArgumentException: Duplicate name found as a class 
member: _type
        at 
org.exolab.javasource.AbstractJClass.addField(AbstractJClass.java:136)
        at 
org.exolab.castor.builder.factory.FieldMemberAndAccessorFactory.createJavaField(FieldMemberAndAccessorFactory.java:135)
        at 
org.exolab.castor.builder.factory.SourceFactory.handleField(SourceFactory.java:2364)
        at 
org.exolab.castor.builder.factory.SourceFactory.processAttributes(SourceFactory.java:1960)
        at 
org.exolab.castor.builder.factory.SourceFactory.processComplexType(SourceFactory.java:2088)
        at 
org.exolab.castor.builder.factory.SourceFactory.processComplexType(SourceFactory.java:851)
        at 
org.exolab.castor.builder.factory.SourceFactory.createSourceCode(SourceFactory.java:388)
        at 
org.exolab.castor.builder.factory.SourceFactory.processComplexType(SourceFactory.java:815)
        at 
org.exolab.castor.builder.factory.SourceFactory.createSourceCode(SourceFactory.java:388)
        at 
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java:943)
        at 
org.exolab.castor.builder.SourceGenerator.generateAllClassFiles(SourceGenerator.java:797)
        at 
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:752)
        at 
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:696)
        at 
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:593)
        at 
org.codehaus.mojo.castor.GenerateMojo.processFile(GenerateMojo.java:520)
)

But that's not something castor can solve in my opinion.


> Fatal error when generating sources with dependency on 
> org.codehaus.castor:castor:1.2
> -------------------------------------------------------------------------------------
>
>                 Key: MCASTOR-20
>                 URL: http://jira.codehaus.org/browse/MCASTOR-20
>             Project: Maven 2.x Castor Plugin
>          Issue Type: Bug
>          Components: Core MOJOs
>    Affects Versions: 1.0
>         Environment: Windows XP Maven 2.0.8
>            Reporter: Marco Beelen
>            Assignee: Werner Guttmann
>             Fix For: 2.1
>
>         Attachments: generateFaillureCastor.zip
>
>
> Generating java source fails when castor 1.2 has been specified as the 
> dependency of the castor-maven-plugin.
> I configured the plugin like this.
> {noformat} 
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>castor-maven-plugin</artifactId>
>         <version>2.0-alpha1</version>
>        <dependencies>
>          <dependency> 
>            <groupId>org.codehaus.castor</groupId>
>            <artifactId>castor</artifactId>
>              <version>1.2</version>
>          </dependency>
>        </dependencies>        
>         <executions>
>           <execution>
>             <goals>
>               <goal>generate</goal>
>             </goals>
>               <configuration>
>                 <verbose>true</verbose>
>               </configuration>            
>           </execution>
>         </executions>          
>       </plugin>
>     </plugins>
>   </build>
> {noformat} 
> This causes the execution to fail due to: {{java.lang.NoClassDefFoundError: 
> org/exolab/castor/util/Configuration}}
> The attached zip-file contains the minimal set of project to reproduce the 
> problem including a log name castor-maven-plugin.logging, which contain the 
> output of mvn -X
> I switched to version 1.2 of Castor since the default version (1.1.2.1) 
> failes due to: Duplicate name found as a class member.
> There was an issue with that, which should have been fix in Castor 1.2.
> [http://jira.codehaus.org/browse/CASTOR-2206]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to