tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fredrik Rubensson" <fredrik.rubens...@mogul.com>
Subject RE: java.lang.Class.getResourceAsStream() throws ClassCastException
Date Wed, 11 Jan 2006 13:39:58 GMT
 

> During initilization of my c3p0 connection pool by hibernate the below
printed 
> exception occurs. The exception causes a failure in the c3p0
initilization and 
> thus hibernate and my application.
>
> Does anyone know what might cause this behavour?

Seems like it is the catalina class loader that fails to cast an object
into a 
org.apache.naming.resources.FileDirContext. I checked the latest source
of this class and there is no FileDirContext in WebappClassLoader. From
the stack I am guessing that there are class namse in property files
that are loaded dynamically. Maybe something is wrong in those property
files? 

What version of tomcat are you using? (Assuming that you are using
tomcat that is. Catalina code seem to be involved somehow.) I am not
sure if I can help you any further but the folks that can will surely be
happy for some details about tomcat versions, platform and so on.

Regards,
Fredrik



The stack trace --------------

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.setUpApplicatio
n(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:124)
	at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider
(ConnectionProviderFactory.java:56)
	at org.hibernate.cfg.SettingsFactory.createConnectionProvider
(SettingsFactory.java:366)
	at org.hibernate.cfg.SettingsFactory.buildSettings
(SettingsFactory.java:60)
	at org.hibernate.cfg.Configuration.buildSettings
(Configuration.java:1859)
	at org.hibernate.cfg.Configuration.buildSessionFactory
(Configuration.java:1152)
	at
com.jsportal.projectportal.transactionManagement.HibernateResource.<init
>(HibernateResource.java:45)
	... 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)
	... 35 more

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

	

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message