3

I have seen & read over 10 similar questions but am still unable to figure it out.

I am using windows7 / Eclipse Helios Service Release 1 / mysql-connector-java-5.1.13-bin.jar.

Everything worked until yesterday, and noW I get this error. I am not aware of anything I did that could have caused this (but maybe still...).

There are no duplicates of this file on my system (nor any other mysql-connector-*).

I am not sure where eclipse is looking for this file, it is sitting under my projects \WebContent\WEB-INF\lib folder with several other .jarS.

looking at the "project" menu -> properties and then "Java Build Path" on the left I see it as one of the libraries under "Web App Libraries" inside the "Libraries" tab. Do I need to add it to the CLASSPATH system environment variable ? (and if so - what would be . in that context ?)

is there a way for me to see (by way of debug) what is the actual path being searched by the class loader?

-=-=-
More info following comments by @javagirl

Q: where did you get the exception? compilation, building, running as java app, under tomcat/etc running?
A: its a runtime exception I get on the eclipse console running tomcat6.

Q: which build tool are you using, ant?
A: AFAIK none. just press play or debug on eclipse. and connect to tomcat from a browser.

Q: is this jar located in the final built package?
A: I don't know how to answer this, but if you can tell me where to look I will. that said I guess the answer is no because search only finds the single instance of the JAR I mentioned.

Q: if you running it under the servlet container like tomcat you probably need to put it in the tomcat/lib folder
A: I am running under tomcat - but not sure where I should actually find this lib folder.

-=-=-

can someone please guide me step by step with resolving this ?

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
epeleg
  • 10,347
  • 17
  • 101
  • 151
  • possible duplicate of [ClassNotFoundException com.mysql.jdbc.Driver](http://stackoverflow.com/questions/1585811/classnotfoundexception-com-mysql-jdbc-driver) – Mr_and_Mrs_D Nov 05 '13 at 16:49

1 Answers1

2

so if you are running it under built-in tomcat: you can go to your workspace folder (eclipse workspace folder), there will be folder .metadata.plugins\org.eclipse.wst.server.core\tmp0 (or tmp1,2 - depends on your environment)/wtpwebapps//WEB-INF/lib - here should be located all the jars of your app. If no - try to put it manually (but it's a worst way)

to add it to tomcat lib folder - try to find it? when you create Server in the eclipse it should ask you about installation folder of your tomcat? or it can suggest download it.. so just download/find it, and put there this jar

ps: I afraid you need to read a lot of stuff, you need to be able run your tomcat from command line for example, to better understand all the process and how all is working there.

javagirl
  • 1,635
  • 6
  • 27
  • 43
  • thank you very much javagirl. I found that I had 3 relevant locations: first for my source code, second was the workspace and third was that of the built-in tomcat. The file was indeed missing on the server itself - I really don't know why. anyway after copying it over there everything is back in working order. You said that its the worst way - what would be the better way? why did eclipse not copy it on its own? as for your PS: - there is no doubt about it - I have lots to learn, java is not my strong suit. But I am a fast learner. Are there any good references you can recommend ? – epeleg Nov 01 '11 at 15:14
  • eclipse sometimes do not do its work properly, also it can clean this folder so that you will have to put it there again in future (probably). it's better to not use eclipse for this purpose but maven tool for example. so just try to learn the Maven – javagirl Nov 01 '11 at 15:20
  • thanks for the suggestion. Any good reading you can recommend about maven other the google? – epeleg Nov 05 '11 at 15:36
  • I wish I could up vote your answer again @javagirl, I just went through this issue yet another time.... – epeleg Jan 17 '12 at 09:09