-->
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.  [ 2 posts ] 
Author Message
 Post subject: java.sql.SQLException: No suitable driver found for jdbc:xxx
PostPosted: Sun May 11, 2008 12:03 pm 
Newbie

Joined: Sun May 11, 2008 11:28 am
Posts: 1
Hello all,

I'm having troubles when attempting to configure my Configuration object.
The error message is...

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/hibernatetutorial at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at roseindia.tutorial.hibernate.FirstExample.firstExample(FirstExample.java:16)
at org.apache.jsp.submition_jsp._jspService(submition_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
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:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Unknown Source)


The driver is the one that I downloaded directly from the mysql home site, and I've used it successfully in standalone java applications. but this error appears when I try to run the hbernate on a web-app. My proyect is in eclipse, and I'm sure that the mysql driver jar file is in the classpath, both the app classpath and the server (jboss 4.2) classpath.

The same hibernate.cfg.xml that I'm using works fine for a standalone java app.


could anybody who knows the answear please help? I'll be forever thankfull.


Top
 Profile  
 
 Post subject: questions
PostPosted: Tue May 13, 2008 7:13 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
1. are you using a container-managed data source when you run in the context of the web app?
2. what is the driver class name that you specify? In fact, it would be helpful if you posted the hibernate.cfg.xml file.
3. what OS are you running on and what other files did you extract for the JConnector?

Generally speaking, this error occurs when non of loaded jdbc drivers have validated the syntax of the specific jdbc url. In your case, since the url syntax seems correct, there are 2 options:
1. you specify the wrong mysql jdbc driver class
2. another mysql driver is picked up on the classpath before yours - probably of an older mysql version, where the jdbc url was different.
3. some dependencies (native libs, etc) are missing for the driver.


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

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.