Classes not auto compiling in Eclipse
<p>I am using Eclipse, In <code>struts.xml</code>, if I use:</p>

<pre><code>&lt;action name="hello"&gt;
            &lt;result&gt;
               /hello.jsp
            &lt;/result&gt;
&lt;/action&gt;
</code></pre>

<p>This works when I access <code>localhost:8080/app/hello</code></p>

<p>But if I add a self-defined action class like:</p>

<pre><code>&lt;action name="hello" class="com.hah"&gt;
            &lt;result&gt;
               /hello.jsp
            &lt;/result&gt;
&lt;/action&gt;
</code></pre>

<p>The <code>hah.java</code> does not compile automatically, it gives me the exception:</p>

<pre><code>Unable to load configuration. - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2/WEB-INF/classes/struts.xml:17:46
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:48)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4658)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5277)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Action class [com.hah] not found - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2/WEB-INF/classes/struts.xml:17:46
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    ... 16 more
</code></pre>

<p>But I can make it work properly by compiling the <code>hah.java</code> manually(by using javac hah.java) and move the compiled <code>hah.class</code> into /D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2/WEB-INF/classes/ folder</p>

<p>I have checked <code>Build Automatically</code> and there is an entry "/src WEB-INF/classes " in <code>Deployment Assembly</code>.</p>

<p>So the problem is that the action class does not compile automatically. What can I do to make it compiled when Tomcat starts?</p>

<p>ps: Finally, I reinstall eclipse for Java EE and use struts-2.3.29, it works.
But I still do not know why..</p>