CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 java.lang.ClassNotFoundException:com.mysql.jdbc.Driver

Print topic Send  topic

Author Message
Anurupa

Posts: 1
Posted: 02/15/2006, 11:32 PM

Hai all,

When i try to connect mysql through a class file i am getting the above exception, can any one please give solution for this :

Stack :


java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at TMDatabase.getDatabaseConnection(TMDatabase.java:19)
at TMDatabase.loadTMLoginRecord(TMDatabase.java:246)
at TMServlet.processRequest(TMServlet.java:28)
at TMServlet.doPost(TMServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
java.lang.NullPointerException
at TMDatabase.loadTMLoginRecord(TMDatabase.java:248)
at TMServlet.processRequest(TMServlet.java:28)
at TMServlet.doPost(TMServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
_________________
Regards
Anurupa
View profile  Send private message
matheus

Posts: 386
Posted: 02/16/2006, 3:18 AM

Driver do mysql-connector (jar) in classpath and in WEB-INF/lib/

By the way, this is a Java's WITH Codecharge, your code didn't use CCS.

Have million of pure Java's forum in web. Search one.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
pankaj
Posted: 03/07/2006, 4:25 AM

just put the my sql conectoe jar file in the tomcat/comman/lib directory
and add the path of this jar file in classpath;
ur problem will be solved
no body
Posted: 03/08/2006, 8:42 AM

I have no idea
Kumaraswamy Visakan
Posted: 03/23/2006, 3:52 AM

Hai,

I also hav a problem with JDBC and MYSQL. So i want to MySql connecter. If anybodies hav tht connector, pls can u send 2 mail here.

Regards
Visakan
Hitesh
Posted: 04/06/2006, 3:00 AM

I have problem with connecting JDBC-MYSQL.
For this i have copy mysql-connector-java-3.1.12 in to jdk1.5/lib/ folrder and also set the class path but still java.lang.ClassNotFound:com.mysql.jdbc.Driver

please any one solve this problem

Reply me urgentlyy
agustin
Posted: 04/11/2006, 10:53 AM

I have this problem too...
somebody gave u any idea...?
Quote Hitesh:
I have problem with connecting JDBC-MYSQL.
For this i have copy mysql-connector-java-3.1.12 in to jdk1.5/lib/ folrder and also set the class path but still java.lang.ClassNotFound:com.mysql.jdbc.Driver

please any one solve this problem

Reply me urgentlyy
Igor
Posted: 04/11/2006, 4:53 PM

Quote pankaj:
just put the my sql conectoe jar file in the tomcat/comman/lib directory
and add the path of this jar file in classpath;
ur problem will be solved

What if writing to ${catalina.home}/common/lib is not
an option? But this works.

I have a context.xml where I define my connection, it loads,
but the driver is not found, though the jar is in WEB-INF/lib.

Any ideas?

Igor
MWarloc
Posted: 07/03/2006, 1:59 AM

There is 2 class pathes.
1. classpath for compilation (in CCS). You can put needed jar archives to System Environmental Variable named classpath (if specified). Or you can use ProjectSettings->
2. Classpath for working. It's tomcat classpath. (jar accessible for tomcat.) To make some jar accessible for tomcat you can put it into <TOMCAT_HOME>\common\lib (For all applications) or to your porject to WEB-INF\lib (for your project only).

There is no any more secrets.

BTW. It's pure java problem. Please discuss it in other (not CCS) forum. Or read one of million answer to this question in Internet. Trust me thia is a very often problem.
ayilmaz
Posted: 07/12/2006, 8:28 PM

hi.i am having the same error.it says "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver"

would you please tell me the steps how to fix the problem.I have the mysql connector.I know i have to put it in the lib folder but i dont know how to set the classpath.and is there anything else
MWarloc
Posted: 07/18/2006, 3:49 AM

First of all you need mySQL driver jar file (not zip with doc and other).
i.e. mysql-connector-java-X.X.X-bin.jar
X.X.X - version.
1.
If fou use CCS you can set path to this jar in ProjectSettings->Server/Script->ClassPath.
Press "..." button and specify the path.
(It needs for compile)
2.
Copy the same jar to <tomcat_home>\common\lib\
Restart tomcat.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.