简体   繁体   English

在Eclipse中调试JSP时的外部jar配置

[英]External jar configuration when debugging JSP in eclipse

Using tomcat 7.0.11 and eclipse 3.6.1. 使用tomcat 7.0.11和eclipse 3.6.1。

I'm trying to debug a jsp file that uses log4j but I get a class not found error at runtime because tomcat isn't seeing log4j-1.2.16.jar. 我正在尝试调试使用log4j的jsp文件,但在运行时遇到未找到类错误,因为tomcat看不到log4j-1.2.16.jar。 When I was running outside of eclipse I had to add a reference to all external jars in catalina.properties. 当我在eclipse之外运行时,我必须在catalina.properties中添加对所有外部jar的引用。 Is there a way for me to specify this runtime reference in eclipse? 我有办法在Eclipse中指定此运行时引用吗?

Update: Here are screenshots of my current settings: 更新:这是我当前设置的屏幕截图: 屏幕截图1

在此处输入图片说明

With the settings like this the tomcat catalina.properties file gets overwritten when I start up tomcat in eclipse (which wipes out the changes I made to shared.loader) 使用这样的设置,当我在eclipse中启动tomcat时,tomcat catalina.properties文件将被覆盖(这消除了我对shared.loader所做的更改)

Just drop the JAR file in webapp's /WEB-INF/lib folder. 只需将JAR文件拖放到webapp的/WEB-INF/lib文件夹中即可。 It's part of webapp's default classpath. 它是webapp默认类路径的一部分。 You don't need to register every JAR file individually then, even not in Eclipse's buildpath (at least, if the project was properly setup as Dynamic Web Project ). 然后,您不需要分别注册每个JAR文件,甚至不需要在Eclipse的buildpath中注册(至少,如果该项目已正确设置为Dynamic Web Project )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM