Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Re: Jetty 7.0.0.pre5 Issue running from script missing method LogFactory.setLogImplClassName

Sorry to be spamming like this, but I think I figured out my issue.

In my maven build dependencies (that I use to copy the proper libraries to my WAR and my JETTY_HOME/lib, I listed the jsp-2.1 as scope provided, when I instead needed to include it as a runtime depency, I also listed servlet-api 3.0.pre1 as default scope runtime when it should be provided:

OLD:
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>servlet-api</artifactId>
            <version>3.0.pre1</version>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <version>7.0.0pre2</version>
            <artifactId>jsp-2.1</artifactId>
            <scope>provided</scope>
        </dependency>


NEW:
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>servlet-api</artifactId>
            <version>3.0.pre1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <version>7.0.0pre2</version>
            <artifactId>jsp-2.1</artifactId>
        </dependency>
~ doug daniels


On Tue, Aug 18, 2009 at 12:15 PM, Doug Daniels <daniels.douglas@xxxxxxxxx> wrote:
I added the -DDebug flag to provide some more information, and I'm thinking some of the issues may have to do with how i configured the Context to deploy my WAR:

I specify a context XML:

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="config.home" default="."/>/webapps/littlethings-webplatform-1.0-SNAPSHOT.war</Set>
  <Set name="defaultsDescriptor"><SystemProperty name="config.home" default="."/>/etc/webdefault.xml</Set>
  <Set name="extractWAR">true</Set>
  <Set name="parentLoaderPriority">true</Set>
  <Set name="configurationClasses">
      <Array id="plusConfig" type="java.lang.String">
        <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
        <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
        <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
    </Array>
  </Set>
 
</Configure>


I had to set parentLoaderPriority=true, I believe because of some JAAS or other classpath issues, but that be causing issues loading the proper LogFactory class, so i tried setting it to false and now I'm getting some really bizarre behavior:

2009-08-18 12:10:28.759::WARN:  failed org.mortbay.jetty.webapp.WebAppContext@14b2f1a{/,jar:file:/C:/webwars/trunk/littlethings-webplatform/target/littlethings-webplatform-1.0-SNAPSHOT-weblings-assembly.dir/weblings-gameplatform/work/8080_live/webapps/littlethings-webplatform-1.0-SNAPSHOT.war!/}
java.lang.NoClassDefFoundError: org/mortbay/jetty/servlet/Context
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:317)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:279)
    at org.mortbay.util.Loader.loadClass(Loader.java:91)
    at org.mortbay.xml.XmlConfiguration.nodeClass(XmlConfiguration.java:224)
    at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:187)
    at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1212)

    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:548)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:348)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:222)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:982)
    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.mortbay.start.Main.invokeMain(Main.java:218)
    at org.mortbay.start.Main.start(Main.java:564)
    at org.mortbay.start.Main.main(Main.java:136)
2009-08-18 12:10:28.761::DEBUG: starting ContextHandlerCollection@1a41cc7
2009-08-18 12:10:28.761::WARN:  failed ContextHandlerCollection@1a41cc7
java.lang.NoClassDefFoundError: org/mortbay/jetty/servlet/Context
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:317)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:279)
    at org.mortbay.util.Loader.loadClass(Loader.java:91)
    at org.mortbay.xml.XmlConfiguration.nodeClass(XmlConfiguration.java:224)
    at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:187)
    at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1212)

    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:548)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:348)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:222)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:982)
    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.mortbay.start.Main.invokeMain(Main.java:218)
    at org.mortbay.start.Main.start(Main.java:564)
    at org.mortbay.start.Main.main(Main.java:136)


~ doug daniels



On Tue, Aug 18, 2009 at 9:56 AM, Doug Daniels <daniels.douglas@xxxxxxxxx> wrote:
We do plan on upgrading to the latest Jetty release eventually (but we're heavily invested in the old Suspend Servlet COMETD implementation using the pre Servlet 3.0 API).

is there a way to configure the order of the JETTY server's classpath, other than what seems like them being included alphabetically from the jars in the JETTY_HOME/lib folder, what's the best approach to include external libraries (we have some custom JAAS classes and logging classes).


~ doug daniels



Doug,

Jetty-7.0.0.pre5 is now a dead branch, so you might like to try some
of the newer pre-releases at Eclipse - the most recent is RC3, but
as we speak we're doing an RC4. Here's the download link:
http://www.eclipse.org/jetty/downloads.php

In your pre5 distro, your jsp-2.1 directory should look like:
|-- ant-1.6.5.jar
|-- core-3.1.1.jar
|-- jsp-2.1-glassfish-9.1.1.B51.p0.jar
|-- jsp-2.1-jetty-7.0.0.pre5.jar
`-- jsp-api-2.1-glassfish-9.1.1.B51.p0.jar

The jsp-2.1-jetty-7.0.0.pre5.jar contains a bridging class from commons
logging as used in the jsp engine to the jetty logger.


Jan


On Mon, Aug 17, 2009 at 9:44 PM, Doug Daniels <daniels.douglas@xxxxxxxxx> wrote:
I'm trying to run Jetty 7.0.0.pre5 from the command line (with some copied JSP and other jars into the JETTY lib directory so that it will be picked up at startup), and I'm receiving an error:
2009-08-17 21:17:10.539::WARN:  EXCEPTION
java.lang.NoSuchMethodException: com.sun.org.apache.commons.logging.LogFactory.setLogImplClassName(java.lang.String)
    at java.lang.Class.getDeclaredMethod(Class.java:1937)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initServlet(WebXmlConfiguration.java:656)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(WebXmlConfiguration.java:458)
    at org.mortbay.jetty.plus.webapp.AbstractConfiguration.initWebXmlElement(AbstractConfiguration.java:187)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:413)
    at org.mortbay.jetty.plus.webapp.AbstractConfiguration.initialize(AbstractConfiguration.java:135)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:207)
    at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureDefaults(AbstractConfiguration.java:92)
    at org.mortbay.jetty.plus.webapp.Configuration.configureDefaults(Configuration.java:142)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1195)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:548)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:348)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:151)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:222)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:982)
    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.mortbay.start.Main.invokeMain(Main.java:218)
    at org.mortbay.start.Main.start(Main.java:564)
    at org.mortbay.start.Main.main(Main.java:136)

Has anyone every configured their classpath incorrectly and received this error. What is the proper Jar that contains the correct LogFactory (I'm searching my maven and eclipse classpath and cannot find it).



~ doug daniels




Back to the top