[英]java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
I am using My-eclipse and doing a struts project there is no syntax error but on starting tomcat server the following error appear in console. 我正在使用My-eclipse并执行一个struts项目,没有语法错误,但是在启动tomcat服务器时,控制台中出现以下错误。
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory
and 和
javax.servlet.UnavailableException: Parsing error processing resource path jndi:/localhost/strutspro/WEB-INF/struts-config.xml javax.servlet.UnavailableException:解析错误处理资源路径jndi:/localhost/strutspro/WEB-INF/struts-config.xml
any idea whats the problem. 任何想法是什么问题。
Donwload commons-logging and place the jar(s) in WEB-INF/lib
. 下载commons-logging并将jar放在
WEB-INF/lib
。
And for the future - google the class name that is not found to see which library it belongs to, download it and put it on the classpath ( WEB-INF/lib
in this case) 并在将来-用Google找不到的类名来查看其所属的库,将其下载并放在类路径中(本例中为
WEB-INF/lib
)
It looks like you've already found your solution, but my solution to the same problem was a little different. 看来您已经找到了解决方案,但是我对同一问题的解决方案却有所不同。
Running Tomcat 4.1.29 inside Eclipse 3.6, I started receiving a very similar error ( Servlet /webcustom threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/conf/struts-config-resource.xml,... ). 在Eclipse 3.6中运行Tomcat 4.1.29时,我开始收到一个非常类似的错误( Servlet / webcustom抛出load()异常javax.servlet.UnavailableException:解析错误处理资源路径/WEB-INF/conf/struts-config-resource.xml ,... )。
Neither performing an "Eclipse > Project > Clean", nor an "Eclipse > Servers > (Tomcat Server Instance) > Clean Tomcat Work Directory" would resolve the problem for me. 既不执行“ Eclipse>项目>清理”,也不执行“ Eclipse>服务器> (Tomcat服务器实例) >清理Tomcat工作目录”都无法为我解决问题。
However, after a lot of trial and error, I found the solution to be this... 但是,经过大量的试验和错误,我发现解决方案是这样的...
Eclipse > Servers > (Tomcat Server Instance) ... Eclipse>服务器> (Tomcat服务器实例) ...
Hopefully this helps someone else. 希望这可以帮助其他人。
-jpt -jpt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.