0

I created a simple web application in eclipse which connect to sql server. I downloaded the sql driver and added it to build path like this:

Build Path->Configure Build Path->Add External JARs.

When I run my application on Tomcat I get exception: ClassNotFoundException. I think that I know what it reason is (the folder WEB-INF->lib of my application is empty). When I put jar file of driver in WEB-INF->lib - everything is good. How I can add jar file(sql driver) to folder WEB-INF->lib of my application using eclipse?

Aravin
  • 4,126
  • 1
  • 23
  • 39
fidel150992
  • 303
  • 5
  • 17
  • 1
    Eclipse just adds it to the build path of the local workspace, which won't work on the application server, as you've noticed. You should use a compile tool such as Maven, SBT, Ant, etc. to build your WAR and handle the dependencies. [See here](http://stackoverflow.com/questions/1001714/how-to-create-war-files) for more information. – t0mppa Jan 26 '14 at 11:45
  • 1
    Are you running the webapplication in tomcat within eclipse? – Keerthivasan Jan 26 '14 at 11:50
  • What about deploying it manually = copying the files to respective directory in Tomcat installation? – ps-aux Jan 26 '14 at 11:58
  • @Octopus yes,I'm running the webapplication in tomcat within eclipse – fidel150992 Jan 26 '14 at 12:21

1 Answers1

1

Putting the JDBC driver JAR in [Tomcat-install-root]/lib will solve your problem, and you can do that outside of Eclipse.

Steve Schneider
  • 392
  • 2
  • 5