[logback-user] DBAppender with ConnectionPool
Klaus UNGER
klaus at ungers-online.com
Wed May 30 16:32:59 CEST 2007
Hello,
I do have a "funny" problem - so far my understanding ...
I have successfully configured LogBack and SLF4J with an DBAppender
I have clients which do their logging via SocketAppender to a LogServer,
which is intended to write the messages to the database.
Everything (except Exceptions and MDC - see former posts) works fine,
but when I added C3P0 Connection Pooling to the appender, like shown
in the documentation and the examples, I do get the following StackTrace:
java.lang.ExceptionInInitializerError
at com.mchange.v2.naming.JavaBeanReferenceMaker.<clinit>(JavaBeanReferenceMaker.java:39)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<clinit>(PoolBackedDataSourceBase.java:203)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ch.qos.logback.core.joran.action.NestedComponentIA.begin(NestedComponentIA.java:107)
at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:259)
at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:126)
at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:110)
at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:36)
at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:336)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:74)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:38)
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:24)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:35)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:46)
at org.slf4j.impl.StaticLoggerBinder.initialize(StaticLoggerBinder.java:52)
at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:44)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:39)
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:57)
at com.mobilkom.cusi.logging.LoggingServer.<clinit>(LoggingServer.java:13)
Caused by: java.lang.IllegalStateException: Logging factory implementation cannot be null. See also http://www.slf4j.org/codes.html#null_LF
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:75)
at org.apache.log4j.Category.<init>(Category.java:52)
at org.apache.log4j.Logger.<init>(Logger.java:22)
at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:38)
at org.apache.log4j.Category.getLogger(Category.java:56)
at org.apache.log4j.Category.getLogger(Category.java:60)
at com.mchange.v2.log.log4j.Log4jMLog.getMLogger(Log4jMLog.java:51)
at com.mchange.v2.log.MLog.getLogger(MLog.java:145)
at com.mchange.v2.log.MLog.<clinit>(MLog.java:72)
For me, it looks like, while Configuring the LogServer, the Systems tries to
instantiate the DBAppender, which itself tries to setup the connection-pool
which has some logging statements inside it's C3P0-CodeBase.
The LoggingSystem is yet not properly initialized (Logging factory implementation cannot be null. See also http://www.slf4j.org/codes.html#null_LF)
looks like "the cat is chasing it's tail" ...
any ideas, hints, explanations, etc. - greatly welcome
kind regards
Klaus :)
More information about the Logback-user
mailing list