mulesoft/mule-devkit — Issue #24: Crash with project that contains two @Modules
Author: ddossot
Created: 2011-10-12 23:43:49+00:00
State: open

When generating sources for https://github.com/mulesoft/mongo-connector/tree/object-store-support, the following error occurs:

[INFO] --- mule-devkit-maven-plugin:3.0-SNAPSHOT:generate-sources (default-generate-sources) @ mule-module-mongo ---
[INFO] Source directory: /home/ddossot/java/dev/mulesoft/mongo-connector/target/generated-sources/mule added
[INFO] Resource directory: /home/ddossot/java/dev/mulesoft/mongo-connector/target/generated-sources/mule added
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [java.net.URLClassLoader@bc9673] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [ClassRealm[plugin>org.mule.tools.devkit:mule-devkit-maven-plugin:3.0-SNAPSHOT, parent: sun.misc.Launcher$AppClassLoader@18d107f]].
log4j:ERROR Could not instantiate appender named "A1".

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.IllegalArgumentException: trying to create the same field twice: muleContext
at org.mule.devkit.model.code.DefinedClass.field(DefinedClass.java:425)
at org.mule.devkit.model.code.DefinedClass.field(DefinedClass.java:396)
at org.mule.devkit.generation.AbstractModuleGenerator.generateFieldForMuleContext(AbstractModuleGenerator.java:84)
at org.mule.devkit.generation.mule.transfomer.EnumTransformerGenerator.registerEnumTransformer(EnumTransformerGenerator.java:102)
at org.mule.devkit.generation.mule.transfomer.EnumTransformerGenerator.doGenerate(EnumTransformerGenerator.java:60)
at org.mule.devkit.generation.AbstractGenerator.generate(AbstractGenerator.java:35)
at org.mule.devkit.apt.ModuleAnnotationProcessor.process(ModuleAnnotationProcessor.java:127)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
at org.mule.devkit.maven.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:255)
at org.mule.devkit.maven.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:139)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR] error on execute: error during compilation