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.
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
and
javax.servlet.UnavailableException: Parsing error processing resource path jndi:/localhost/strutspro/W开发者_如何学GoEB-INF/struts-config.xml
any idea whats the problem.
Donwload commons-logging and place the jar(s) in 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)
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,...).
Neither performing an "Eclipse > Project > Clean", nor an "Eclipse > Servers > (Tomcat Server Instance) > Clean Tomcat Work Directory" would resolve the problem for me.
However, after a lot of trial and error, I found the solution to be this...
Eclipse > Servers > (Tomcat Server Instance)...
- Add and Remove > (Remove resource from the Tomcat Server Instance)
- Clean
- Add and Remove > (Add resource back to the Tomcat Server Instance)
- Publish
- Start
Hopefully this helps someone else.
-jpt
精彩评论