Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassNotFoundexception: net.sourceforge.jtds.jdbc.Driver

I'm running into java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

I can get around the error by putting jtds.jar file in the CATALINA_HOME/lib directory but this isn't an ideal solution as the application should be modular enough to be deployable on any server.

I have the jtds.jar file in [tomcat_dir]/webapps/myapp/WEB-INF/lib which is where I want it to be found from.

I know there are TONS of similar questions so I apologize if this is a duplicate but I've yet to be able to find a post that helps.

Why can't my app find the correct jtds.jar file which I've included in the app package? What do I need to do in order to get the app to recognize that jar file?

like image 920
nmc Avatar asked Nov 28 '12 18:11

nmc


1 Answers

Tomcat 6 and higher demands that JDBC driver JARs appear in the server /lib, especially if you have JNDI data sources.

It might not be ideal, but you'll have to get over it. How often will you be changing app servers?

like image 158
duffymo Avatar answered Oct 24 '22 22:10

duffymo