Hi,
I am using c3p0 for my connection pool with hibernate, but run into an initilization problem. Please see the stacktrace below. It seems as if there is a problem when the log is setup. After reading some apache bugs (
bug1,
bug2,
bug3) I found this could be related to the classloader trying to load a directory. Or could it be that it is trying to load a file which is not found? In the later case I's expect a ClassNotFoundException.
If anyone has any clues to where the origine might lie for this exception, please point it out to me as I'm breaking my head over it for a week now ;-)
Thank you and have a great day.
PS: this is a more detailed question to the same problem as described in
my earlier question
Hibernate version: 3.0.3
c3p0 version: 0.9.0.2
DBMS: MySQL 4.1.7-nt
Hibernate config:
<hibernate-configuration>
<hibernate.connection.driver_class>com.mysql.jdbc.Driver</hibernate.connection.driver_class>
<hibernate.connection.url>jdbc:mysql://localhost/jsportal_0000001?autoreconnect=true</hibernate.connection.url>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>****</hibernate.connection.password>
<hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</hibernate.dialect>
<hibernate.c3p0.min_size>1</hibernate.c3p0.min_size>
<hibernate.c3p0.max_size>5</hibernate.c3p0.max_size>
<hibernate.c3p0.timeout>120</hibernate.c3p0.timeout>
<hibernate.c3p0.max_statements>50</hibernate.c3p0.max_statements>
<hibernate.c3p0.idle_test_period>300</hibernate.c3p0.idle_test_period>
</hibernate-configuration>
Stack trace:
java.lang.ClassCastException: org.apache.naming.resources.FileDirContext
at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1585)
at org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:914)
at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1111)
at java.lang.Class.getResourceAsStream(Class.java:1998)
at com.mchange.v2.cfg.BasicMultiPropertiesConfig.<init>(BasicMultiPropertiesConfig.java:48)
at com.mchange.v2.cfg.BasicMultiPropertiesConfig.<init>(BasicMultiPropertiesConfig.java:39)
at com.mchange.v2.cfg.MultiPropertiesConfig.read(MultiPropertiesConfig.java:64)
at com.mchange.v2.cfg.MultiPropertiesConfig.readVmConfig(MultiPropertiesConfig.java:73)
at com.mchange.v2.log.MLog.<clinit>(MLog.java:48)
... 34 more