File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes ClassCastException in JBOSS 5.0.1.GA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "ClassCastException in JBOSS 5.0.1.GA" Watch "ClassCastException in JBOSS 5.0.1.GA" New topic
Author

ClassCastException in JBOSS 5.0.1.GA

Madhur Shrma
Greenhorn

Joined: May 08, 2009
Posts: 11
Hi, I am moving my war deployment from Jboss 4.0.4.GA to Jboss 5.0.1.GA

While launching the application i am getting the below ClassCastException. Same this worked fine in Jboss 4.
I have hibernate3.jar,ojdbc14.jar in my lib directory.

14:54:46,301 FATAL [DatasourceConnectionProvider] Could not find datasource: java:JDBCDS1
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
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:397)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
at com.adobe.alf.utility.HibernateUtil.initialize(Unknown Source)
at com.adobe.alf.utility.HibernateUtil.initialize(Unknown Source)
at com.adobe.alf.utility.HibernateUtil.getSession(Unknown Source)
at com.adobe.alf.engine.ALFLEState.obtainStateDescriptions(Unknown Source)
at com.adobe.alf.engine.ALFLEState.<clinit>(Unknown Source)
at com.adobe.alf.engine.EngineWSImpl.acquireValidLEStates(Unknown Source)
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.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)

Can anybody please help.

thanks
Madhur
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9963
    
163

See this http://www.coderanch.com/t/443132/JBoss/ClassCastException-Jboss


[My Blog] [JavaRanch Journal]
Madhur Shrma
Greenhorn

Joined: May 08, 2009
Posts: 11
Hi Jaikiran, Link mentioned by peter jhonson doesn't open. "Cannot connect to database"

hibernate is throwing error from this line of code.

ds = (DataSource)NamingHelper.getInitialContext(props).lookup(jndiName);

(couldn't attach DatasourceConnectionProvider.java) file . see its content below.

public void configure(Properties props)
throws HibernateException
{
String jndiName = props.getProperty("hibernate.connection.datasource");
if(jndiName == null)
{
String msg = "datasource JNDI name was not specified by property hibernate.connection.datasource";
log.fatal(msg);
throw new HibernateException(msg);
}
user = props.getProperty("hibernate.connection.username");
pass = props.getProperty("hibernate.connection.password");
try
{
ds = (DataSource)NamingHelper.getInitialContext(props).lookup(jndiName);
}
catch(Exception e)
{
log.fatal("MADHUR - Could not find datasource: " + jndiName, e);
throw new HibernateException(" MADHUR - Could not find datasource", e);
}
if(ds == null)
{
throw new HibernateException("Could not find datasource: " + jndiName);
} else
{
log.info("Using datasource: " + jndiName);
return;
}
}
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9963
    
163

Madhur Shrma wrote:Hi Jaikiran, Link mentioned by peter jhonson doesn't open. "Cannot connect to database"

Yes, the forums are down currently.

Peter, in that thread asked the original poster to remove any jar file(s) which contain javax.sql.* classes or jboss specific jars from the application packaging. Do you have such jars in the application? If yes, remove them.


Madhur Shrma
Greenhorn

Joined: May 08, 2009
Posts: 11
Thanks Jaikiran, it worked. There was a jdbc2_0-stdext.jar in my app lib directory having javax.sql.* classes.
And thanks for you blog on JBoss which really get me started on JBoss.
Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202
Yes, on removing the database related jar files from war file, the exception will be resolved
 
Don't get me started about those stupid light bulbs.
 
subject: ClassCastException in JBOSS 5.0.1.GA
 
Similar Threads
javax.servlet.ServletException: non-HTTP request or response
Passing List from Servlet to jsp ? - value of list becomes NULL
ERROR [[CXFServlet]] Servlet.service() for servlet CXFServlet threw exception
Data Source Not Found
org.hibernate.dialect.MySQLDialect cannot be cast to org.hibernate.dialect.Diale ct