[英]Deploy web application on Tomcat
I created a simple web application in eclipse which connect to sql server. 我在eclipse中创建了一个简单的Web应用程序,该应用程序连接到SQL Server。 I downloaded the sql driver and added it to build path like this:
我下载了sql驱动程序并将其添加到构建路径中,如下所示:
Build Path->Configure Build Path->Add External JARs.
构建路径->配置构建路径->添加外部JAR。
When I run my application on Tomcat I get exception: ClassNotFoundException.
当我在Tomcat上运行应用程序时,出现异常:
ClassNotFoundException.
I think that I know what it reason is (the folder WEB-INF->lib of my application is empty)
. 我认为我知道原因是什么
(the folder WEB-INF->lib of my application is empty)
。 When I put jar file of driver in WEB-INF->lib
- everything is good. 当我将驱动程序的jar文件放在
WEB-INF->lib
-一切都很好。 How I can add jar file(sql driver) to folder WEB-INF->lib
of my application using eclipse? 如何使用eclipse将jar文件(sql驱动程序)添加到应用程序的文件夹
WEB-INF->lib
中?
将JDBC驱动程序JAR放在[Tomcat-install-root] / lib中可以解决您的问题,您可以在Eclipse之外进行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.