Please remove the log4J dependency from the POM and it will work. The Log4J dependency is brought in via transitive dependencies from the commons logging.
Give that a try and see if the error goes away. Jeff Andreas Gabriel wrote: > Thanks for the fast reply! > > Here is my pom.xml (reduced to the minimum but still with the error): > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>com.xxx.app</groupId> > <artifactId>ngm-webac</artifactId> > <packaging>jar</packaging> > <version>1.0-SNAPSHOT</version> > <name>NGM-WebAC</name> > <description>The WebAC-related stuff of project NGM.</description> > > <build> > <plugins> > <!-- use Java 5 compiler settings --> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <source>1.5</source> > <target>1.5</target> > </configuration> > </plugin> > > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>jspc-maven-plugin</artifactId> > <version>1.2</version> > <executions> > <execution> > <id>jspc</id> > <phase>generate-sources</phase> > <goals> > <goal>compile</goal> > </goals> > </execution> > </executions> > </plugin> > </plugins> > </build> > > <dependencies> > > <!-- Log4J logging library --> > <dependency> > <groupId>log4j</groupId> > <artifactId>log4j</artifactId> > <version>1.2.13</version> > </dependency> > > <dependency> > <groupId>commons-logging</groupId> > <artifactId>commons-logging</artifactId> > <version>1.0.4</version> > </dependency> > > </dependencies> > > </project> > > The log output is the following when calling the generate-sources target: > INFO] Scanning for projects... > [INFO] > ---------------------------------------------------------------------------- > [INFO] Building NGM-WebAC > [INFO] task-segment: [generate-sources] > [INFO] > ---------------------------------------------------------------------------- > [INFO] [jspc:compile {execution: jspc}] > [INFO] jspc args: [-uriroot, > V:\Development\Workspace\ngm-webac/src/main/webapp, -d, > V:\Development\Workspace\ngm-webac/target/jsp-source, -s, -l, -webinc, > V:\Development\Workspace\ngm-webac/target/web-fragment.xml, -p, jsp] > [INFO] V:\Development\Workspace\ngm-webac\target\classes > [INFO] D:\Dokumente und > Einstellungen\Andi\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar > [INFO] D:\Dokumente und > Einstellungen\Andi\.m2\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar > java.lang.ExceptionInInitializerError > at org.codehaus.mojo.jspc.JspcMojo.execute(JspcMojo.java:151) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) > 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:585) > 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.commons.logging.LogConfigurationException: > org.apache.commons.logging.LogConfigurationException: No suitable Log > constructor [Ljava.lang.Class;@148bd3 for > org.apache.commons.logging.impl.Log4JLogger > at > org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532) > at > org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272) > at > org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:246) > at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395) > at org.apache.jasper.JspC.<clinit>(JspC.java:97) > ... 19 more > Caused by: org.apache.commons.logging.LogConfigurationException: No > suitable Log constructor [Ljava.lang.Class;@148bd3 for > org.apache.commons.logging.impl.Log4JLogger > at > org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:432) > at > org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525) > ... 23 more > Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328) > at java.lang.Class.getConstructor0(Class.java:2640) > at java.lang.Class.getConstructor(Class.java:1629) > at > org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:429) > ... 24 more > [INFO] > ---------------------------------------------------------------------------- > [INFO] BUILD SUCCESSFUL > [INFO] > ---------------------------------------------------------------------------- > [INFO] Total time: 1 second > [INFO] Finished at: Sat Jan 28 23:56:49 CET 2006 > [INFO] Final Memory: 2M/5M > [INFO] ------------------------------------------------------------------- > > > <Zitiere wer="Jeff Genender"> >> Did you exclude commons logging or log4j somewhere in your pom? An >> exclusion could have caused this. >> >> Can you please post your pom? >> >> Jeff >> >> >> Andreas Gabriel wrote: >>> Hello! >>> >>> I'm trying to use the jspc-maven-plugin with Maven 2.0.2, but get the >>> following stacktrace: >>> [INFO] Trace >>> java.lang.ExceptionInInitializerError >>> at org.codehaus.mojo.jspc.JspcMojo.execute(JspcMojo.java:153) >>> at >>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:859) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:731) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:502) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139) >>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at >>> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at >>> org.apache.maven.cli.MavenCli.main(MavenCli.java:249) >>> 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:585) >>> 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.commons.logging.LogConfigurationException: >>> org.apache.commons.logging.LogConfigurationException: No suitable Log >>> constructor [Ljava.lang.Class;@ad8659 for >>> org.apache.commons.logging.impl.Log4JLogger >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532) >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272) >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:246) >>> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395) >>> at org.apache.jasper.JspC.<clinit>(JspC.java:97) >>> ... 23 more >>> Caused by: org.apache.commons.logging.LogConfigurationException: No >>> suitable Log constructor [Ljava.lang.Class;@ad8659 for >>> org.apache.commons.logging.impl.Log4JLogger >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:432) >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525) >>> ... 27 more >>> Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger >>> at java.lang.Class.getDeclaredConstructors0(Native Method) >>> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328) at >>> java.lang.Class.getConstructor0(Class.java:2640) >>> at java.lang.Class.getConstructor(Class.java:1629) >>> at >>> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:429) >>> ... 28 more >>> >>> The funny thing is that when I patch the plugin by replacing the call >>> of JspC.main with >>> try { >>> JspC.main((String[]) args.toArray(new String[args.size()])); >>> } >>> catch (Error error) { >>> JspC.main((String[]) args.toArray(new String[args.size()])); >>> } >>> I get the following stacktrace: >>> [INFO] Trace >>> java.lang.NoClassDefFoundError >>> at org.codehaus.mojo.jspc.JspcMojo.execute(JspcMojo.java:155) >>> at >>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:859) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:731) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:502) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) >>> at >>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139) >>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at >>> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at >>> org.apache.maven.cli.MavenCli.main(MavenCli.java:249) >>> 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:585) >>> 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) >>> >>> Any Ideas? >>> >>> Regards, >>> Andi >>> > >