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 <[email protected]> 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
    [email protected]
    http://qos.ch/mailman/listinfo/logback-user



------------------------------------------------------------------------

_______________________________________________
Logback-user mailing list
[email protected]
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
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to