"Fhomasp" wrote:
Isn't Java 6 fully backward compatible with Java 5 btw?
Yes it is. The problem is that Java 5 is not forward compatible with Java 6. If a class gets compiled with Java 6 and then you try to run it with Java 5 then you will get a NoClassDefFoundError. The difficult part is that when you get such an error, the message might not report the class that actually had the problem. So if a subclass was compiled with Java 5 and its superclass was compiled with Java 6, and you try to run it on Java 5, you will get the NoClassDefFoundError on the subclass. But really the problem is that the superclass was comiled with Java 6.
So if I understand correctly, this works when you deploy your application manually, but not when you let Maven deploy with Jetty?
I would try to find out what the difference is.
Is the JDK different when running manually vs. running with Maven?
Have you tried running manually with Jetty?
Have you tried running Maven against your real target container? Cargo can deploy and test against many different containers. The latest Cargo snapshot can even run against JBoss 5.
"Fhomasp" wrote:
here it is:
If you can make something out of this it'd be greatly appreciated.
Thanks for the support so far ;-)
[INFO] Building war: C:\projects\trunk\vlafo\olympus\JSFUnitTest\target\JSFUnitTestWar-1.4.2.war
[INFO] [cargo:start {execution: start-container}]
[INFO] No container defined, using a default [jetty6x, embedded] container
[INFO] [beddedLocalContainer] Jetty 6.x Embedded starting...
2008-08-26 15:49:14.375::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2008-08-26 15:49:14.421::INFO: jetty-6.1.1rc1
2008-08-26 15:49:14.609::INFO: Extract jar:file:/C:/projects/trunk/vlafo/olympus/JSFUnitTest/target/JSFUnitTestWar-1.4.2.war!/ to C:\DOCUME~1\DEVELO~
1\LOCALS~1\Temp\Jetty_0_0_0_0_8080_JSFUnitTestWar-1.4.2.war__JSFUnitTestWar-1_4_2__aar4a7\webapp
2008-08-26 15:49:19.046::WARN: failed org.mortbay.jetty.webapp.WebAppContext@58dfa6{/JSFUnitTestWar-1.4.2,jar:file:/C:/projects/trunk/vlafo/olympus/J
SFUnitTest/target/JSFUnitTestWar-1.4.2.war!/}
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.mortbay.jetty.webapp.TagLibConfiguration.configureWebApp(TagLibConfiguration.java:239)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1188)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:120)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
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.cargo.container.jetty.internal.JettyExecutorThread.run(JettyExecutorThread.java:68)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Lj
ava.lang.Class;@12305e8 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused
by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@12305e8 for org.apache.commons.logging.impl.Lo
g4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.myfaces.webapp.StartupServletContextListener.<clinit>(StartupServletContextListener.java:44)
... 24 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@12305e8 for org.apache.commons.logging
.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getConstructor(Class.java:1629)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
The obvious place to start is to bundle Log4j with your application and see what happens. I'm not sure if Jetty uses Log4j by default or not.
Stan