问题描述
我看到有其他类似的问题,但没有一个涵盖我的确切情况。
I see there are other similar questions, but none of them cover my exact situation.
我正在迁移基于Eclipse的网络从FreeBSD 9.2和Tomcat7到FreeBSD 10.0和Tomcat8的服务。我已将.war部署到新的服务器上,并运行,直到它必须执行SQL访问,其中无法加载net.sourceforge.jtds.jdbc.Driver失败。我不知道什么是失踪。我们没有在lib中加载驱动程序,它全部捆绑在一个.war文件中(在旧机器上工作正常)。我搜索了tomcat配置文件,看看是否有任何需要设置的指针,但是我将会是空的。
I'm migrating an Eclipse based web service from FreeBSD 9.2 and Tomcat7 over to FreeBSD 10.0 and Tomcat8. I've deployed my .war on the new server and it runs, right up until it has to do a SQL access, where it fails with "cannot load net.sourceforge.jtds.jdbc.Driver". I'm not sure what's missing. We don't load a driver in lib, it's all bundled into the one .war file (which works fine on the old machine). I've searched the tomcat config files to see if there's any pointers that need to be set, but I'm coming up empty.
推荐答案
从下载jTDS驱动程序。将其复制到Tomcats lib文件夹中。你确定你没有使用JNDI来检索数据源吗?如果不是这样,它更好地将应用程序特定的jar包含在项目中,而不是在服务器上,以避免与其他项目的版本冲突。
Download the jTDS driver from here. Copy it into the Tomcats lib folder. Are you sure you are not using JNDI to retreive the datasource? If thats not the case, its better to include app specific jars in your project and not on the server, to avoid version conflicts with other projects.
这篇关于无法在Tomcat中加载net.sourceforge.jtds.jdbc.Driver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!