java. lang.ClassNotFoundException:org. apache. struts. action. ActionServlet
•
Java
I got a Tomcat error:
Sep 09,2012 3:27:48 PM org.apache.catalina.core.AprLifecycleListener init Information: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Products\jdk1.7.0_03\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Products/jdk1.7.0_03/jre/bin/client;C:/Products/jdk1.7.0_03/jre/bin;C:/Products/jdk1.7.0_03/jre/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Products\jdk1.7.0_03\jre\bin;c:\Program Files (x86)\Microsoft sql Server\100\Tools\Binn\;c:\Program Files\Microsoft sql Server\100\Tools\Binn\;c:\Program Files\Microsoft sql Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft sql Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft sql Server\100\DTS\Binn\;C:\Products\eclipse32;;. Sep 09,2012 3:27:48 PM org.apache.tomcat.util.digester.SetPropertiesRule begin Warnung: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:NAR_JDBC_DBO' did not find a matching property. Sep 09,2012 3:27:49 PM org.apache.coyote.AbstractProtocol init Information: Initializing ProtocolHandler ["http-bio-80"] Sep 09,2012 3:27:49 PM org.apache.coyote.AbstractProtocol init Information: Initializing ProtocolHandler ["ajp-bio-8009"] Sep 09,2012 3:27:49 PM org.apache.catalina.startup.Catalina load Information: Initialization processed in 1359 ms Sep 09,2012 3:27:49 PM org.apache.catalina.core.StandardService startInternal Information: Starting service Catalina Sep 09,2012 3:27:49 PM org.apache.catalina.core.StandardEngine startInternal Information: Starting Servlet Engine: Apache Tomcat/7.0.27 Sep 09,2012 3:27:49 PM org.apache.catalina.startup.TaglibUriRule body Information: TLD skipped. URI: http://struts.apache.org/tags-html is already defined Sep 09,2012 3:27:49 PM org.apache.catalina.startup.TaglibUriRule body Information: TLD skipped. URI: http://struts.apache.org/tags-bean is already defined Sep 09,2012 3:27:49 PM org.apache.catalina.startup.TaglibUriRule body Information: TLD skipped. URI: http://struts.apache.org/tags-nested is already defined Sep 09,2012 3:27:49 PM org.apache.catalina.startup.TaglibUriRule body Information: TLD skipped. URI: http://struts.apache.org/tags-logic is already defined Sep 09,2012 3:27:49 PM org.apache.catalina.core.ApplicationContext log Information: Marking servlet action as unavailable Sep 09,2012 3:27:49 PM org.apache.catalina.core.StandardContext loadOnStartup Schwerwiegend: Servlet /NAR_JDBC_DBO threw load() exception java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1136) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$startChild.call(ContainerBase.java:1566) at org.apache.catalina.core.ContainerBase$startChild.call(ContainerBase.java:1556) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Sep 09,2012 3:27:49 PM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler ["http-bio-80"] Sep 09,2012 3:27:49 PM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler ["ajp-bio-8009"] Sep 09,2012 3:27:49 PM org.apache.catalina.startup.Catalina start Information: Server startup in 725 ms
This is my web xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>NAR_JDBC_DBO</display-name> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>validate</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <jsp-config> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location> </taglib> </jsp-config> </web-app>
Obviously, org apache. struts. action. There is a problem with the servlet name "action" in actionservlet Unfurtunatley, I don't know what I did wrong Do you have an idea? Many advance Ollie
Solution
This error occurs because your servlet core jar is not on the runtime classpath
>Open your ear / Web Project Properties > Click deploy Assembly > click Add... > select Java build path entries > click Next > select Maven dependencies > click Finish
If it is not maven, make sure that the Lib folder where the jar is placed is located in "deployment assembly"
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码