# Probleme mit struts - ActionServlet



## slider7777 (30. Mai 2007)

Hallo,

Ich habe eine kleine Web Anwendung mit struts geschrieben (in Eclipse). Jedoch findet Tomcat anscheinend die Klasse ActionServlet nicht, diese ist jedoch in den Libraries vorhanden...

der Fehler:
java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet

das packet org.apache.struts.action sowie die Klasse sind vorhanden....

hier mal die web.xml:


```
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<display-name>
	SimpleForum</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>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</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>
</web-app>
```

struts-config.xml:


```
<struts-config>


	<form-beans>
	
		<form-bean name="forum" type="beans.BeanForum" />
		<form-bean name="thema" type="beans.BeanThema" />
	
	</form-beans>
	
	
	<action
	  name="forum"
      path="/start"
      scope="request"
      type="actionhandler.ForumAction"
      validate="false">
      <forward name="success" path="/abc.jsp" />
      <forward name="failure" path="/error.jsp" />
    </action>
	
	
	<action
	  name="thema"
      path="/thema"
      scope="request"
      type="actionhandler.ThemaAction"
      validate="false">
      <forward name="success" path="/thread.jsp" />
      <forward name="failure" path="/index.jsp" />
    </action>
	
	
	
	
</struts-config>
```


danke für Hilfe!




[/code]


----------



## slider7777 (30. Mai 2007)

der ganze fehler:

```
SCHWERWIEGEND: Error loading WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1fe88d
 org.apache.struts.action.ActionServlet
java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
30.05.2007 13:13:25 org.apache.catalina.core.StandardContext loadOnStartup
SCHWERWIEGEND: Servlet /SimpleForum threw load() exception
java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
```


----------



## HLX (30. Mai 2007)

In welchen Libraries liegt denn deine struts.jar?


----------



## slider7777 (31. Mai 2007)

hallo,

ich habe eben alle vorhandenen *.jar files von struts in das Projekt eingebunden. das oben genannte Packet liegt glaub in struts-core.jar


----------



## HLX (31. Mai 2007)

Komisch. Liegen die jars in WEB-INF/lib?


----------



## slider7777 (31. Mai 2007)

ich benütze eclipse, habe also ein sogenanntes dynamic web project angelegt, die eingebundenen packete liegen alle unter library


----------



## HLX (1. Jun 2007)

Aha, ich nehme an im Java Build Path. Liegen sie dort einfach nur so, oder als Web App Libraries.

Falls es keine Web App Libraries sind, enferne die Jars aus den Libraries und kopiere sie ins Verzeichnis WEB-INF/lib. Nur so erfährt auch der Tomcat von den Bibliotheken. Sonst werden sie nur für´s Kompilieren verwendet.


----------

