nmc
nmc

Reputation: 8686

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?

Upvotes: 6

Views: 2637

Answers (1)

duffymo
duffymo

Reputation: 308753

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?

Upvotes: 8

Related Questions