日期:2014-05-18  浏览次数:20699 次

帮小弟解决个问题
用struts做个bbs,在主页按钮产生相应的动作时,出现下面的异常
exception  

javax.servlet.ServletException:   Servlet.init()   for   servlet   actionServlet   threw   exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown   Source)


root   cause  

java.lang.NoClassDefFoundError:   org/apache/commons/pool/impl/GenericObjectPool
java.lang.Class.getDeclaredConstructors0(Native   Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown   Source)
java.lang.Class.getConstructor0(Unknown   Source)
java.lang.Class.newInstance0(Unknown   Source)
java.lang.Class.newInstance(Unknown   Source)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:145)
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:775)
org.apache.struts.action.ActionServlet.init(ActionServlet.java:331)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown   Source)




------解决方案--------------------
org/apache/commons/pool/impl/GenericObjectPool
没有找到这个类,应该是你少jar包或者没有引入.这个类是在commons-pool.jar里面
------解决方案--------------------
问这样的问题,还是建议你先不要投太多精力在struts.先学学jsp基础.