[logback-user] breaking on startup

Brian Moschel brian.moschel at gmail.com
Wed May 13 19:44:39 CEST 2009


java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory
        at jupiter.messaging.EventSubscriber.<init>(EventSubscriber.java:40)
        at developerworks.jetty6.CrudMessage.<clinit>(CrudMessage.java:91)
        at
developerworks.jetty6.UserCountServlet.<clinit>(UserCountServlet.java:33)
        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.servlet.Holder.newInstance(Holder.java:153)
        at
org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:253)
        at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:606)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
        at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1221)
        at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
        at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:449)
        at
org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
        at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
        at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
        at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
39)
        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:
39)
        at
org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.
java:132)
        at
com.webtide.hightide.plugin.AbstractHightideMojo.startJetty(AbstractH
ightideMojo.java:341)
        at
com.webtide.hightide.plugin.AbstractHightideMojo.execute(AbstractHigh
tideMojo.java:271)
        at
com.webtide.hightide.plugin.AbstractHightideRunMojo.execute(AbstractH
ightideRunMojo.java:194)
        at
com.webtide.hightide.plugin.HightideRunMojo.execute(HightideRunMojo.j
ava:201)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:558)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:512)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:482)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:330)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:291)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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)

[INFO] [dependency:tree]
[INFO] com.webtide.hightide:jabbify:war:6.1H.10
[INFO] +-
com.webtide.hightide:hightide-server-dependencies:pom:6.1H.10:provided

[INFO] |  +- org.mortbay.jetty:jetty:jar:6.1H.10:provided
[INFO] |  |  \- org.mortbay.jetty:servlet-api-2.5:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:jetty-util:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:cometd-bayeux:jar:6.1H.10:provided
[INFO] |  |  \- org.mortbay.jetty:cometd-api:jar:0.9.20080221:provided
[INFO] |  +- org.mortbay.jetty:jetty-annotations:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:jetty-plus:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:jsp-2.1:jar:6.1H.10:provided
[INFO] |  |  +- org.eclipse.jdt:core:jar:3.1.1:provided
[INFO] |  |  \- ant:ant:jar:1.6.5:provided
[INFO] |  +- org.mortbay.jetty:jetty-naming:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:jetty-management:jar:6.1H.10:provided
[INFO] |  +- org.mortbay.jetty:jetty-xbean:jar:6.1H.10:provided
[INFO] |  |  +- org.apache.xbean:xbean-spring:jar:2.2:provided
[INFO] |  |  |  +- mx4j:mx4j:jar:3.0.1:provided
[INFO] |  |  |  +- commons-logging:commons-logging:jar:1.0.3:provided
[INFO] |  |  |  +-
backport-util-concurrent:backport-util-concurrent:jar:2.0_01_
pd:provided
[INFO] |  |  |  +- stax:stax-api:jar:1.0:provided
[INFO] |  |  |  \- qdox:qdox:jar:1.5:provided
[INFO] |  |  \- org.springframework:spring:jar:1.2.8:provided
[INFO] |  +- org.directwebremoting:dwr:jar:2.0.3:provided
[INFO] |  +- org.apache.activemq:activemq-web:jar:5.1.0:provided
[INFO] |  |  +- org.apache.activemq:activemq-core:jar:5.1.0:provided
[INFO] |  |  |  +- commons-logging:commons-logging-api:jar:1.1:provided
[INFO] |  |  |  \- org.apache.camel:camel-core:jar:1.3.0:provided
[INFO] |  |  |     +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] |  |  |     |  \- javax.xml.stream:stax-api:jar:1.0-2:provided
[INFO] |  |  |     \- com.sun.xml.bind:jaxb-impl:jar:2.1.3:provided
[INFO] |  |  +- rome:rome:jar:0.8:provided
[INFO] |  |  +- jdom:jdom:jar:1.0:provided
[INFO] |  |  +- xmlpull:xmlpull:jar:1.1.3.4d_b4_min:provided
[INFO] |  |  \- com.thoughtworks.xstream:xstream:jar:1.1.2:provided
[INFO] |  |     \- xpp3:xpp3_min:jar:1.1.3.4.O:provided
[INFO] |  +- com.atomikos:transactions:jar:3.2.3:provided
[INFO] |  +- com.atomikos:transactions-api:jar:3.2.3:provided
[INFO] |  +- com.atomikos:transactions-jta:jar:3.2.3:provided
[INFO] |  +- com.atomikos:atomikos-util:jar:3.2.3:provided
[INFO] |  +- org.apache.derby:derby:jar:10.4.1.3:provided
[INFO] |  +- org.apache.derby:derbytools:jar:10.4.1.3:provided
[INFO] |  \- org.slf4j:jcl104-over-slf4j:jar:1.3.1:provided
[INFO] +- com.webtide.hightide:hightide-provided-apis:pom:6.1H.10:provided
[INFO] |  +-
org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1
:provided
[INFO] |  +-
org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1:provided
[INFO] |  +- geronimo-spec:geronimo-spec-jta:jar:1.0.1B-rc4:provided
[INFO] |  +-
org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1:prov
ided
[INFO] |  +- org.mortbay.jetty:jsp-api-2.1:jar:6.1H.10:provided
[INFO] |  +- javax.mail:mail:jar:1.4:provided
[INFO] |  \- javax.activation:activation:jar:1.1:provided
[INFO] +- ch.qos.logback:logback-core:jar:0.9.15:compile
[INFO] +- ch.qos.logback:logback-classic:jar:0.9.15:compile
[INFO] +- ch.qos.logback:logback-access:jar:0.9.15:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.5.6:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.5.6:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.6:compile
[INFO] |  \- log4j:log4j:jar:1.2.14:compile
[INFO] \- org.slf4j:slf4j-jdk14:jar:1.5.6:compile

On Wed, May 13, 2009 at 12:40 PM, Ceki Gulcu <ceki at qos.ch> wrote:

>
> Could you post the whole stack trace please (including nested exceptions)?
> I thought that a few lines would be sufficient but that is not the case.
>
> What does "mvn dependency:tree" give you?
>
> Brian Moschel wrote:
>
>> Here's more of the error:
>>
>> java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory
>>        at
>> jupiter.messaging.EventSubscriber.<init>(EventSubscriber.java:40)
>>        at developerworks.jetty6.CrudMessage.<clinit>(CrudMessage.java:91)
>>        at
>> developerworks.jetty6.UserCountServlet.<clinit>(UserCountServlet.java
>> :33)
>>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>
>>        at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
>> orAccessorImpl.java:39)
>>        at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
>> onstructorAccessorImpl.java:27)
>>
>> This is code that run at startup and breaks on (LoggerContext)
>> LoggerFactory.getILoggerFactory();
>>
>> I am using Maven to keep track of dependencies, I have the following
>> included for logback:
>>        <dependency>
>>        <groupId>ch.qos.logback</groupId>
>>        <artifactId>logback-core</artifactId>
>>        <version>0.9.15</version>
>>      </dependency>
>>          <dependency>
>>        <groupId>ch.qos.logback</groupId>
>>        <artifactId>logback-classic</artifactId>
>>        <version>0.9.15</version>
>>      </dependency>
>>          <dependency>
>>        <groupId>ch.qos.logback</groupId>
>>        <artifactId>logback-access</artifactId>
>>        <version>0.9.15</version>
>>      </dependency>
>>          <dependency>
>>        <groupId>org.slf4j</groupId>
>>        <artifactId>slf4j-api</artifactId>
>>        <version>1.5.6</version>
>>      </dependency>
>>
>> On Wed, May 13, 2009 at 6:43 AM, Ceki Gulcu <ceki at qos.ch> wrote:
>>
>>    Hello Brian,
>>
>>    Could you please post the two or three lines of the stack trace?
>>    Which artifacts (jar files) have you placed on the class path?
>>
>>
>>    Brian Moschel wrote:
>>
>>        Hey guys,
>>
>>        I am noticing an error on startup:
>>
>>        java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory
>>
>>        I am trying to run the following lines to load my config, which
>>        I got from the startup guide:
>>
>>        LoggerContext lc = (LoggerContext)
>>        LoggerFactory.getILoggerFactory();
>>        JoranConfigurator configurator = new JoranConfigurator();
>>        lc.reset();
>>        configurator.setContext(lc);
>>        configurator.doConfigure(my_path);
>>        StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
>>
>>        The error occurs at the first line in the above code.  I got
>>        this working at some point, but somehow am back in a non-working
>>        state.  This is a Jetty app.  Any tips?
>>
>>        Thanks,
>>        Brian
>>
>>    --    Ceki Gülcü
>>    Logback: The reliable, generic, fast and flexible logging framework
>>    for Java.
>>    http://logback.qos.ch
>>    _______________________________________________
>>    Logback-user mailing list
>>    Logback-user at qos.ch
>>    http://qos.ch/mailman/listinfo/logback-user
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user
>>
>
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090513/308713cf/attachment-0001.htm>


More information about the Logback-user mailing list