logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raoul OPPLIGER" <roppli...@iware.ch>
Subject A error message with JdbcAppender
Date Sat, 04 Jun 2005 14:44:54 GMT
I use log4j with a xml configuration file.
 
I don't have problems when I use FileAppender but when I introduce a jdbcAppender in my config
file
 
<appender name="system_system_3_database" class="org.apache.log4j.jdbc.JDBCAppender">
   <param name="URL" value="jdbc:mysql://localhost/OSP"/>
   <param name="driver" value="com.mysql.jdbc.Driver"/>
   <param name="user" value="root"/>
   <param name="password" value=""/>
   <param name="sql" value="insert into ........."/>
   <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d - %c -%-4r [%t] %-5p %c %x - %m%n "/>
   </layout>
</appender>

I've the following message with DOMConfigurator (mysql-connector-java-3.0.16-ga-bin.jar is
in my project CLASSPATH)
 
log4j:ERROR Failed to load driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
 at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:141)
 at org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:336)
 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:324)
 at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:196)
 at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:155)
 at org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:530)
 at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:182)
 at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
 at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
 at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
 at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
 at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:584)
 at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:687)
 at ch.consultas.osp.webcrawling.Log.initialize(Log.java:72)
 at mypackage1.Hello.main(Hello.java:20)
log4j:ERROR Failed to load driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
 at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:141)
 at org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:336)
 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:324)
 at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:196)
 at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:155)
 at org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:530)
 at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:182)
 at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
 at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
 at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
 at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
 at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:584)
 at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:687)
 at ch.consultas.osp.webcrawling.Log.initialize(Log.java:72)
 at mypackage1.Hello.main(Hello.java:20)
Debugger disconnected from local process.
Process exited.
 
Can you help me?
 
Raoul

Mime
View raw message