-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate - c3p0 initilization problem: ClassCastException
PostPosted: Fri Jan 06, 2006 1:40 pm 
Newbie

Joined: Fri Nov 18, 2005 1:01 pm
Posts: 18
Location: Delft, the Netherlands
Hi,

When I initialize my application with Hibernate and c3p0, a ClassCastException is thrown. See the stacktrace below. This seems like an exception not related to my code. Is is something in my settings, or am I missing something.

Yhank you and have a great day.

Hibernate version: 3.0.3

c3p0 version: 0.9.0.2

Name and version of the database you are using: 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>

Debug level Hibernate log excerpt:

DEBUG 06 Jan 2006 18:16:09,843 [main] org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1048) - Preparing to build session factory with filters : {}
INFO 06 Jan 2006 18:16:09,859 [main] org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:852) - processing extends queue
INFO 06 Jan 2006 18:16:09,859 [main] org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:856) - processing collection mappings
INFO 06 Jan 2006 18:16:09,859 [main] org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:865) - processing association property references
INFO 06 Jan 2006 18:16:09,859 [main] org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:894) - processing foreign key constraints
INFO 06 Jan 2006 18:16:09,890 [main] org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:50) - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/infodb?autoreconnect=true
INFO 06 Jan 2006 18:16:09,906 [main] org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:51) - Connection properties: {user=root, password=****}
INFO 06 Jan 2006 18:16:09,906 [main] org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:54) - autocommit mode: false
ERROR 06 Jan 2006 18:16:09,968 [main] com.jsportal.projectportal.web.ApplicationStartupServlet.setUpApplication(ApplicationStartupServlet.java:209) - While setting up the application in the startup servlet the folowing exception was thrown:
Exception below...

Full stack trace of any exception that occurs:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at com.jsportal.projectportal._config.<init>(_config.java:158)
at com.jsportal.projectportal.applicationConfig.<init>(applicationConfig.java:119)
at com.jsportal.projectportal.web.webApplicationConfig.<init>(webApplicationConfig.java:85)
at com.jsportal.projectportal.web.ApplicationStartupServlet.setUpApplication(ApplicationStartupServlet.java:123)
at com.jsportal.projectportal.web.ApplicationStartupServlet.init(ApplicationStartupServlet.java:53)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
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:585)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
Caused by: java.lang.ExceptionInInitializerError
at com.mchange.v2.c3p0.PoolConfig.<clinit>(PoolConfig.java:93)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:84)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:349)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:58)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1509)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at com.jsportal.projectportal.transactionManagement.HibernateResource.<init>(HibernateResource.java:52)
... 26 more
Caused by: 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

_________________
Joost Schouten
JS Portal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.