Re: Clogging NoClassDefFoundError

2006-12-22 Thread Alexandre Poitras

From :

http://cwiki.apache.org/WICKET/maven-jetty6-plugin.html

*Currently, the best plugin version to use is the 6.0-SNAPSHOT one, so be
aware that it is a little out on the edge. The reason for this is that
earlier versions of Jetty used commons-logging, which lead to various
class-loader issues , e.g.
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor...*
*Thankfully, the lastest version of the plugin/Jetty6 has switched to
SLF4Jso they've disappeared, but that version
of plugin/Jetty6's not yet been
released...*


On 12/18/06, Jim Downing <[EMAIL PROTECTED]> wrote:


Dennis Lundberg wrote:
> Hi Jim
>
> This is a Commons Logging - Log4J classic. It would take a while to
> explain it, but the short version is that Commons Logging and Log4J
> are probably in different classloaders. The best way to trace the
> source of the problem is to upgrade Commons Logging (temporarily) to
> version 1.1. That version has a neat diagnostics feature [1] that
> allows you you to investigate such classloader issues. Turn it on and
> have a look at the results you get.
>
> [1] http://jakarta.apache.org/commons/logging/troubleshooting.html
>

I'd guessed at some class loader problem. I didn't manage to get any of
the diagnostics out for the case where I had the problem, but I did find
a way of fixing it. Basically, the jetty plugin needs to be proactively
configured for logging, as documented at the bottom of
http://jetty.mortbay.org/maven-plugin/howto.html. Either specifying the
c-logging SimpleLog implementation through a system property, or adding
c-logging and log4j to the plugin's dependencies and letting the
automatic selection in c-logging do its stuff both work.


Thanks to Dennis and Wayne for your help.

Best wishes,

jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Clogging NoClassDefFoundError

2006-12-18 Thread Jim Downing

Dennis Lundberg wrote:

Hi Jim

This is a Commons Logging - Log4J classic. It would take a while to 
explain it, but the short version is that Commons Logging and Log4J 
are probably in different classloaders. The best way to trace the 
source of the problem is to upgrade Commons Logging (temporarily) to 
version 1.1. That version has a neat diagnostics feature [1] that 
allows you you to investigate such classloader issues. Turn it on and 
have a look at the results you get.


[1] http://jakarta.apache.org/commons/logging/troubleshooting.html



I'd guessed at some class loader problem. I didn't manage to get any of 
the diagnostics out for the case where I had the problem, but I did find 
a way of fixing it. Basically, the jetty plugin needs to be proactively 
configured for logging, as documented at the bottom of 
http://jetty.mortbay.org/maven-plugin/howto.html. Either specifying the  
c-logging SimpleLog implementation through a system property, or adding 
c-logging and log4j to the plugin's dependencies and letting the 
automatic selection in c-logging do its stuff both work.



Thanks to Dennis and Wayne for your help.

Best wishes,

jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Clogging NoClassDefFoundError

2006-12-15 Thread Dennis Lundberg

Hi Jim

This is a Commons Logging - Log4J classic. It would take a while to 
explain it, but the short version is that Commons Logging and Log4J are 
probably in different classloaders. The best way to trace the source of 
the problem is to upgrade Commons Logging (temporarily) to version 1.1. 
That version has a neat diagnostics feature [1] that allows you you to 
investigate such classloader issues. Turn it on and have a look at the 
results you get.


[1] http://jakarta.apache.org/commons/logging/troubleshooting.html

--
Dennis Lundberg


Jim Downing wrote:

Hi,

I'm having problems with the jetty plugin - on running 'mvn jetty:run' I 
get a mysterious exception from clogging that is caused at some point by 
a NoClassDefFoundError complaining that it can't find log4j. Log4j is 
referenced by the project, ends up in the package war and is also listed 
by jetty as being on the classpath when it starts up, so I'm stumped why 
this is happening.


Excerpt (full stack and my pom attached): -

org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: No suitable Log 
constructor [Ljava.lang.Class;@b3f9b8 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.newInstance(LogFactoryImpl.java:525) 


   ... 43 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
   at java.lang.Class.getDeclaredConstructors0(Native Method)

Thanks for any help you could give.

jim




[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO] 

[INFO] Building Unnamed - uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO]task-segment: [jetty:run]
[INFO] 

[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: Unnamed - 
uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO] Webapp source directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] web.xml file = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp/WEB-INF/web.xml
[INFO] Classes = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes
2006-12-14 15:23:48.966::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /spectrasub
[INFO] Tmp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/work
[INFO] Web defaults =  jetty default
[INFO] Webapp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] Starting jetty 6.1-SNAPSHOT ...
2006-12-14 15:23:49.071::INFO:  jetty-6.1-SNAPSHOT
[INFO] Classpath = 
[file:/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes/,
 file:/home/ojd20/.m2/repository/net/sourceforge/jcamp-dx/0.1/jcamp-dx-0.1.jar, 
file:/home/ojd20/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
 
file:/home/ojd20/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar,
 file:/home/ojd20/.m2/repository/net/sourceforge/jena/jena/2.4/jena-2.4.jar, 
file:/home/ojd20/.m2/repository/regexp/regexp/1.2/regexp-1.2.jar, 
file:/home/ojd20/.m2/repository/org/apache/tapestry/tapestry-framework/4.1/tapestry-framework-4.1.jar,
 file:/home/ojd20/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar, 
file:/home/ojd20/.m2/repository/org/ostermiller/ostermillerutils/1.06/ostermillerutils-1.06.jar,
 file:/home/ojd20/.m2/repository/commons-io/commons-io/1.1/commons-io-1.1.jar, 
file:/home/ojd20/.m2/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar,
 file:/home/ojd20/.m2/repository/commons-codec/comm

ons-codec/1.3/commons-codec-1.3.jar, 
file:/home/ojd20/.m2/repository/commons-fileupload/commons-fileupload/1.1/commons-fileupload-1.1.jar,
 
file:/home/ojd20/.m2/repository/hivemind/hivemind-lib/1.1.1/hivemind-lib-1.1.1.jar,
 file:/home/ojd20/.m2/repository/xom/xom/1.1/xom-1.1.jar, 
file:/home/ojd20/.m2/repository/cml/jumbo/5.3-beta1/jumbo-5.3-beta1.jar, 
file:/home/ojd20/.m2/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar, 
file:/home/ojd20/.m2/repository/java3d/vecmath/1.3.1/vecmath-1.3.1.jar, 
file:/home/ojd20/.m2/repository/hivemind/hivemind/1.1.1/hivemind-1.1.1.jar, 
file:/home/ojd20/.m2/repository/stax/stax-api/1.0/stax-api-1.0.jar, 
file:/home/ojd20/.m2/repository/net/sourceforge/jena/iri/1.0/iri-1.0.jar, 
file:/home/ojd20/.m2/repository/org/springframework/spring-context/2.0/spring-context-2.0.jar,
 file:/home/ojd20/.m2/repository/woodstox/wstx-asl/2.8/wstx-asl-2.8.jar, 
file

Re: Clogging NoClassDefFoundError

2006-12-15 Thread Wayne Fay

Hmm in that case, I really have no idea why its failing. I don't use
Jetty much less jetty:run.

To be honest, it sounds like a Jetty question, since clogging and
log4j are clearly on the Jetty classpath.

Wayne

On 12/15/06, Jim Downing <[EMAIL PROTECTED]> wrote:

Wayne Fay wrote:
> Check the log4j-xyz.jar version referenced in your MANIFEST.MF and WEB
> config files against the log4j jar versions you've got in your WAR.
>
> This can happen when you for example reference log4j-1.2.2.jar in your
> MANIFEST but then load log4j-1.2.3.jar in your WAR.
>  in a parent pom can help solve this problem.

I'm a bit confused which MANIFEST you mean. I've referenced log4j 1.2.12
in my pom.xml (new pom attached), and that's the one that's ended up in
my WAR. There's no mention of any dependencies in my WAR's MANIFEST.MF.

Any ideas what the root cause of this is? How come jetty can list the
log4j jar and then not load classes from it?

Thanks for the help!
jim





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Clogging NoClassDefFoundError

2006-12-15 Thread Jim Downing

Wayne Fay wrote:

Check the log4j-xyz.jar version referenced in your MANIFEST.MF and WEB
config files against the log4j jar versions you've got in your WAR.

This can happen when you for example reference log4j-1.2.2.jar in your
MANIFEST but then load log4j-1.2.3.jar in your WAR.
 in a parent pom can help solve this problem.


I'm a bit confused which MANIFEST you mean. I've referenced log4j 1.2.12 
in my pom.xml (new pom attached), and that's the one that's ended up in 
my WAR. There's no mention of any dependencies in my WAR's MANIFEST.MF.


Any ideas what the root cause of this is? How come jetty can list the 
log4j jar and then not load classes from it?


Thanks for the help!
jim





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Clogging NoClassDefFoundError

2006-12-14 Thread Wayne Fay

Check the log4j-xyz.jar version referenced in your MANIFEST.MF and WEB
config files against the log4j jar versions you've got in your WAR.

This can happen when you for example reference log4j-1.2.2.jar in your
MANIFEST but then load log4j-1.2.3.jar in your WAR.
 in a parent pom can help solve this problem.

Wayne

On 12/14/06, Jim Downing <[EMAIL PROTECTED]> wrote:

Hi,

I'm having problems with the jetty plugin - on running 'mvn jetty:run' I
get a mysterious exception from clogging that is caused at some point by
a NoClassDefFoundError complaining that it can't find log4j. Log4j is
referenced by the project, ends up in the package war and is also listed
by jetty as being on the classpath when it starts up, so I'm stumped why
this is happening.

Excerpt (full stack and my pom attached): -

org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@b3f9b8 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.newInstance(LogFactoryImpl.java:525)
   ... 43 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
   at java.lang.Class.getDeclaredConstructors0(Native Method)

Thanks for any help you could give.

jim


[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO] 

[INFO] Building Unnamed - uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO]task-segment: [jetty:run]
[INFO] 

[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: Unnamed - 
uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO] Webapp source directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] web.xml file = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp/WEB-INF/web.xml
[INFO] Classes = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes
2006-12-14 15:23:48.966::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /spectrasub
[INFO] Tmp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/work
[INFO] Web defaults =  jetty default
[INFO] Webapp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] Starting jetty 6.1-SNAPSHOT ...
2006-12-14 15:23:49.071::INFO:  jetty-6.1-SNAPSHOT
[INFO] Classpath = 
[file:/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes/,
 file:/home/ojd20/.m2/repository/net/sourceforge/jcamp-dx/0.1/jcamp-dx-0.1.jar, 
file:/home/ojd20/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
 
file:/home/ojd20/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar,
 file:/home/ojd20/.m2/repository/net/sourceforge/jena/jena/2.4/jena-2.4.jar, 
file:/home/ojd20/.m2/repository/regexp/regexp/1.2/regexp-1.2.jar, 
file:/home/ojd20/.m2/repository/org/apache/tapestry/tapestry-framework/4.1/tapestry-framework-4.1.jar,
 file:/home/ojd20/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar, 
file:/home/ojd20/.m2/repository/org/ostermiller/ostermillerutils/1.06/ostermillerutils-1.06.jar,
 file:/home/ojd20/.m2/repository/commons-io/commons-io/1.1/commons-io-1.1.jar, 
file:/home/ojd20/.m2/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar,
 
file:/home/ojd20/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar,
 
file:/home/ojd20/.m2/repository/commons-fileupload/commons-fileupload/1.1/commons-fileupload-1.1.jar,
 
file:/home/ojd20/.m2/repository/hivemind/hivemind-lib/1.1.1/hivemind-lib-1.1.1.jar,
 file:/home/ojd20/.m2/repository/xom/xom/1.1/xom-1.1.jar, 
file:/home/ojd20/.m2/repository/cml/jumbo/5.3-beta1/jumbo-5.3-beta1.jar, 
file:/home/ojd20/.m2/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar, 
file:/home/ojd20/.m2/repository/java3d/vecmath/1.3.1/vecmath-1.3.1.jar, 
file:/home/ojd20/.m2/repository/hivemind/hivemind/1.1.1/hivemind-1.1.1.jar, 
file:/home/ojd20/.m2/repository/stax/stax-api/1.0/stax-api-1.0.jar, 
file:/home/ojd20/.m2/repository/net/sourceforge/jena/iri/1.0/iri-1.0.jar, 
file:/home/ojd20/.m2/repository/org/springframework/spring-context/2.0/spring-context-2.0.jar,
 file:/home/ojd20/.m2/repository/woodstox/wstx-asl/2.8/wstx-asl-2.8.jar, 
file:/home/ojd20/.m2/repository/antlr/antlr/2.7.2/antlr-2.7.2.jar, 
file:/home/ojd20/.m2/repository/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar,
 
file:/home/ojd20/.m2/repository/org/springframework/spring-core/2.0/spring-core-2.0.jar,
 file:/home/ojd20/.m2/repository/jboss/javassist/3.0

Clogging NoClassDefFoundError

2006-12-14 Thread Jim Downing

Hi,

I'm having problems with the jetty plugin - on running 'mvn jetty:run' I 
get a mysterious exception from clogging that is caused at some point by 
a NoClassDefFoundError complaining that it can't find log4j. Log4j is 
referenced by the project, ends up in the package war and is also listed 
by jetty as being on the classpath when it starts up, so I'm stumped why 
this is happening.


Excerpt (full stack and my pom attached): -

org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: No suitable Log 
constructor [Ljava.lang.Class;@b3f9b8 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.newInstance(LogFactoryImpl.java:525)

   ... 43 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
   at java.lang.Class.getDeclaredConstructors0(Native Method)

Thanks for any help you could give.

jim
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO] 

[INFO] Building Unnamed - uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO]task-segment: [jetty:run]
[INFO] 

[INFO] Preparing jetty:run
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: Unnamed - 
uk.ac.cam.spectra:spectrasub:war:0.0.1
[INFO] Webapp source directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] web.xml file = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp/WEB-INF/web.xml
[INFO] Classes = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes
2006-12-14 15:23:48.966::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /spectrasub
[INFO] Tmp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/work
[INFO] Web defaults =  jetty default
[INFO] Webapp directory = 
/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/src/main/webapp
[INFO] Starting jetty 6.1-SNAPSHOT ...
2006-12-14 15:23:49.071::INFO:  jetty-6.1-SNAPSHOT
[INFO] Classpath = 
[file:/home/ojd20/projects/spectra/eclipse-workspace/spectrasub/target/classes/,
 file:/home/ojd20/.m2/repository/net/sourceforge/jcamp-dx/0.1/jcamp-dx-0.1.jar, 
file:/home/ojd20/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
 
file:/home/ojd20/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar,
 file:/home/ojd20/.m2/repository/net/sourceforge/jena/jena/2.4/jena-2.4.jar, 
file:/home/ojd20/.m2/repository/regexp/regexp/1.2/regexp-1.2.jar, 
file:/home/ojd20/.m2/repository/org/apache/tapestry/tapestry-framework/4.1/tapestry-framework-4.1.jar,
 file:/home/ojd20/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar, 
file:/home/ojd20/.m2/repository/org/ostermiller/ostermillerutils/1.06/ostermillerutils-1.06.jar,
 file:/home/ojd20/.m2/repository/commons-io/commons-io/1.1/commons-io-1.1.jar, 
file:/home/ojd20/.m2/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar,
 
file:/home/ojd20/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar,
 
file:/home/ojd20/.m2/repository/commons-fileupload/commons-fileupload/1.1/commons-fileupload-1.1.jar,
 
file:/home/ojd20/.m2/repository/hivemind/hivemind-lib/1.1.1/hivemind-lib-1.1.1.jar,
 file:/home/ojd20/.m2/repository/xom/xom/1.1/xom-1.1.jar, 
file:/home/ojd20/.m2/repository/cml/jumbo/5.3-beta1/jumbo-5.3-beta1.jar, 
file:/home/ojd20/.m2/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar, 
file:/home/ojd20/.m2/repository/java3d/vecmath/1.3.1/vecmath-1.3.1.jar, 
file:/home/ojd20/.m2/repository/hivemind/hivemind/1.1.1/hivemind-1.1.1.jar, 
file:/home/ojd20/.m2/repository/stax/stax-api/1.0/stax-api-1.0.jar, 
file:/home/ojd20/.m2/repository/net/sourceforge/jena/iri/1.0/iri-1.0.jar, 
file:/home/ojd20/.m2/repository/org/springframework/spring-context/2.0/spring-context-2.0.jar,
 file:/home/ojd20/.m2/repository/woodstox/wstx-asl/2.8/wstx-asl-2.8.jar, 
file:/home/ojd20/.m2/repository/antlr/antlr/2.7.2/antlr-2.7.2.jar, 
file:/home/ojd20/.m2/repository/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar,
 
file:/home/ojd20/.m2/repository/org/springframework/spring-core/2.0/spring-core-2.0.jar,
 file:/home/ojd20/.m2/repository/jboss/javassist/3.0/javassist-3.0.jar, 
file:/home/ojd20/.m2/repository/commons-collections/commons-collections/2.1/commons-collections-2.1.jar,
 
file:/home/ojd20/.m2/repository/org/springframework/spring-aop/2.0/spring-aop-2.0.jar,
 file:/home/ojd20/.m2/repository/junit/junit/3.8/junit-3.8.jar, 
file:/home/ojd20/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.