log4j/jetty5 issues

From: Erik Hatcher (eri..hatchersolutions.com)
Date: Tue Apr 19 2005 - 12:29:14 EDT

  • Next message: Erik Hatcher: "Re: log4j/jetty5 issues"

    I'm asking here as Cayenne's JAR is what got me into this, though I'm
    aware that the solution is not directly Cayenne related.

    I've just added Cayenne to a new Tapestry application (just the JAR at
    this point, soon the Visit and so on). I'm using Tapestry 3.1 (err...
    now 4.0). I'm using Jetty 5.1.2, launching from Ant in development.
    All worked fine until I added cayenne.jar (version 1.1.1).

    Once I added cayenne.jar to my app's WEB-INF/lib, I get the stack trace
    pasted below from Jetty's startup.

    My WEB-INF/lib has these JAR's:

    $ ls context/WEB-INF/lib
    bsf-2.3.0.jar
    hivemind-lib-1.1-alpha-4-snapshot.jar portlet-api-1.0.jar
    cayenne.jar jai_codec.jar
                             tapestry-3.1-alpha-2-snapshot.jar
    cglib-full-2.0.2.jar jai_core.jar
                             tapestry-contrib-3.1-alpha-2-snapshot.jar
    commons-codec-1.3.jar javassist-3.0-rc-1.jar
                             tapestry-portlet-3.1-alpha-2-snapshot.jar
    commons-fileupload-1.0.jar log4j-1.2.6.jar
    hivemind-1.1-alpha-4-snapshot.jar ognl-2.6.7.jar

    A little Googling showed me that there are some issues with Jetty and
    Log4j, but I'm not quite sure what the remedy is. Any advice?

    Thanks!

            Erik

    start-jetty:
          [java] Apr 19, 2005 12:23:00 PM org.mortbay.http.HttpServer doStart
          [java] INFO: Version Jetty/5.1.2
          [java] Apr 19, 2005 12:23:00 PM org.mortbay.util.Container start
          [java] INFO: Started HttpContext[/,/]
          [java] Exception in thread "main"
    java.lang.ExceptionInInitializerError
          [java] at
    org.mortbay.jetty.servlet.ServletHandler.newServletHolder(ServletHandler
    .java:270)
          [java] at
    org.mortbay.jetty.servlet.XMLConfiguration.initServlet(XMLConfiguration.
    java:364)
          [java] at
    org.mortbay.jetty.servlet.XMLConfiguration.initWebXmlElement(XMLConfigur
    ation.java:237)
          [java] at
    org.mortbay.jetty.servlet.XMLConfiguration.initialize(XMLConfiguration.j
    ava:205)
          [java] at
    org.mortbay.jetty.servlet.XMLConfiguration.configureDefaults(XMLConfigur
    ation.java:155)
          [java] at
    org.mortbay.jetty.servlet.WebApplicationContext.configureDefaults(WebApp
    licationContext.java:415)
          [java] at
    org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationCo
    ntext.java:464)
          [java] at org.mortbay.util.Container.start(Container.java:72)
          [java] at
    org.mortbay.http.HttpServer.doStart(HttpServer.java:695)
          [java] at org.mortbay.util.Container.start(Container.java:72)
          [java] at org.mortbay.jetty.Server.main(Server.java:433)
          [java] Caused by:
    org.apache.commons.logging.LogConfigurationException:
    org.apache.commons.logging.LogConfigurationException: No suitable Log
    constructor [Ljava.lang.Class..dc4d5 for
    org.apache.commons.logging.impl.Log4JLogger
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
    l.java:532)
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
    l.java:272)
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
    l.java:246)
          [java] at
    org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
          [java] at
    org.mortbay.jetty.servlet.Holder.<clinit>(Holder.java:43)
          [java] ... 11 more
          [java] Caused by:
    org.apache.commons.logging.LogConfigurationException: No suitable Log
    constructor [Ljava.lang.Class..dc4d5 for
    org.apache.commons.logging.impl.Log4JLogger
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFact
    oryImpl.java:432)
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
    l.java:525)
          [java] ... 15 more
          [java] Caused by: java.lang.NoClassDefFoundError:
    org/apache/log4j/Logger
          [java] at java.lang.Class.getDeclaredConstructors0(Native
    Method)
          [java] at
    java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
          [java] at java.lang.Class.getConstructor0(Class.java:1930)
          [java] at java.lang.Class.getConstructor(Class.java:1027)
          [java] at
    org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFact
    oryImpl.java:429)
          [java] ... 16 more
          [java] Java Result: 1



    This archive was generated by hypermail 2.0.0 : Tue Apr 19 2005 - 12:31:16 EDT