Class NotFoundexception: net.sourceforge.jtds.jdbc.Driver

I run in java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

I can get around the error by placing the jtds.jar file in the CATALINA_HOME/lib directory, but this is not an ideal solution, since the application should be modular enough to be deployed on any server.

I have a jtds.jar file in [tomcat_dir]/webapps/myapp/WEB-INF/lib where I want to find it.

I know that there are TONS of similar questions, so I apologize if this is a duplicate, but I have not yet been able to find a message that helps.

Why can't my application find the correct jtds.jar file that I included in the application package? What do I need to do for the application to recognize this jar file?

+6
source share
1 answer

Tomcat 6 and above require JDBC driver JAR files to be displayed on the / lib server, especially if you have JNDI data sources.

It may not be perfect, but you will have to overcome it. How often will you change application servers?

+7
source

All Articles