Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Exception: com.mysql.jdbc.Driver
Exception: com.mysql.jdbc.Driver [message #160796] Wed, 15 February 2006 15:40 Go to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
I am running a JSP client against a Web Service that connects to a MySQL
database. I am receiving the following error and I'm not sure why
"Exception: com.mysql.jdbc.Driver"

I get the error on the line:

Class.forName("com.mysql.jdbc.Driver").newInstance();

I am running Eclipse 3.1.1, JDK 1.5, WTP 1.0, Tomcat 1_2_1.

I have extracted the MySQl mysql-connector-java-3.1.8 to its own
directory. I have also copied the mysql-connector-java-3.1.8-bin.jar file
to the C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext directory.

When I check the Java Build Path for my project, under the Libraries tab,
I see the reference to the mysql-connector-java-3.1.8-bin.jar that was
copied to the C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext library.

Any thoughts or suggestions would be greatly appreciated.

Thanks,
Ben
Re: Exception: com.mysql.jdbc.Driver [message #160845 is a reply to message #160796] Wed, 15 February 2006 17:43 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
In cases like this, exceptions can get layered and the real source of
the problem can get hidden. Assuming some trial and error hasn't
already resolved this problem, I would recommend trying to catch the
exception somewhere in your code. Then walk the "cause" chain and try
to log the exception at the bottom to see if it provides a better clue
about what is going wrong.

Tomcat only displays two levels of exception in its default error page.
If an error like yours occurs in a JSP page, you will see a
JspException displayed along with the ServletException it wraps. You
often get little or nothing about the original error.

If the exception you catch is a JspException or ServletException, you
will need to use getRootCause() to get the wrapped exception. Thanks to
what could be considered a deficiency in the specs for Servlet 2.4 and
earlier (I think fixed in 2.5, but not certain), calling getCause() on
either of these exceptions will most likely return null. Once you have
an exception that isn't JspException or ServletException, you would use
getCause() to get the wrapped exception.

Cheers,
Larry

Ben Sisson wrote:
> I am running a JSP client against a Web Service that connects to a MySQL
> database. I am receiving the following error and I'm not sure why
> "Exception: com.mysql.jdbc.Driver"
>
> I get the error on the line:
>
> Class.forName("com.mysql.jdbc.Driver").newInstance();
>
> I am running Eclipse 3.1.1, JDK 1.5, WTP 1.0, Tomcat 1_2_1.
>
> I have extracted the MySQl mysql-connector-java-3.1.8 to its own
> directory. I have also copied the mysql-connector-java-3.1.8-bin.jar
> file to the C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext directory.
>
> When I check the Java Build Path for my project, under the Libraries
> tab, I see the reference to the mysql-connector-java-3.1.8-bin.jar that
> was copied to the C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext library.
>
> Any thoughts or suggestions would be greatly appreciated.
>
> Thanks,
> Ben
>
Previous Topic:best hibernate plugin?
Next Topic:Incomplete Deployment on WTP 1.5
Goto Forum:
  


Current Time: Thu Apr 25 07:03:56 GMT 2024

Powered by FUDForum. Page generated in 0.03066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top