tomcat 6 在启动时不寻找 webapps 文件夹中的类
我遇到问题,当我启动 tomcat 时,它会在 localhost.log 文件中记录 ClassNotFoundException 异常。我在 Windows 7 下运行它。一切正常。
我能够停止获得 CNFE 异常的唯一方法是将我的所有 $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
内容移至 $CATALINA_HOME/lib
< br> 我只是不知道在哪里寻找类路径配置。
我应该如何配置 Tomcat 在 $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
和 $CATALINA_HOME/webapps/ROOT/WEB-INF/classes
文件夹中查找类?
有没有办法在不部署战争文件的情况下做到这一点?
I have problem where when I start tomcat it logs ClassNotFoundException exceptions in the localhost.log file. I run it under Windows 7. Everything works.
The only way I was able to stop getting the CNFE exceptions was moving all my $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
content over to $CATALINA_HOME/lib
I just don't know where to look for classpath config.
How should I configure Tomcat to look for classes in $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
and $CATALINA_HOME/webapps/ROOT/WEB-INF/classes
folders?
And is there any way of doing this without war file deployement?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您将项目部署为 .war,那么您不应该收到 ClassNotFoundException,但我建议您重新设置项目。
如果您使用的是 Eclipse IDE,那么只需在 IDE 中设置一个新服务器,然后运行为>在服务器中运行...这可能有助于重新定义您的服务器并重新部署。
If you are deploying the project as .war then you should not get the ClassNotFoundException but i suggest you to rework on your project set up.
If you are using the Eclipse IDE then just setup a new server in the IDE and then Run As>Run In Server....this may help i.e. redefining your server and redeploying too .
这听起来似乎很明显,但您是否尝试将其部署为 war 文件? (如果这是一个java项目)
This may sound obvious, but did you try deploying it as a war file instead? (If this a java project)