[logback-user] breaking on startup

Brian Moschel brian.moschel at gmail.com
Wed May 13 19:28:20 CEST 2009


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090513/13ca5ca2/attachment.htm>


More information about the Logback-user mailing list