Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get Eclipse to get all of my resources on Tomcat's classpath?
    text
    copied!<p>I am having a devil of a time getting Eclipse to run my webapp on tomcat with the classpath correct. I have some spring configuration that references property files at classpath:/whatever.properties - these properties files live in my web project at src\main\resources, and I can see that they get deployed to the WEB-INF\classes folder, but they are not picked up. Also, a breakpoint in my custom spring property provider is not hit, even though the code is run (verified through logging).</p> <p>.project snippet:</p> <pre><code> &lt;buildSpec&gt; &lt;buildCommand&gt; &lt;name&gt;org.maven.ide.eclipse.maven2Builder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.wst.common.project.facet.core.builder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.wst.validation.validationbuilder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;/buildSpec&gt; &lt;natures&gt; &lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt; &lt;nature&gt;org.maven.ide.eclipse.maven2Nature&lt;/nature&gt; &lt;nature&gt;org.eclipse.jem.workbench.JavaEMFNature&lt;/nature&gt; &lt;nature&gt;org.eclipse.wst.common.modulecore.ModuleCoreNature&lt;/nature&gt; &lt;nature&gt;org.eclipse.wst.common.project.facet.core.nature&lt;/nature&gt; &lt;/natures&gt; </code></pre> <p>.classpath snippet:</p> <pre><code>&lt;classpath&gt; &lt;classpathentry kind="src" path="src/main/java"/&gt; &lt;classpathentry kind="src" path="src/main/resources"/&gt; &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/&gt; &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/&gt; &lt;classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry combineaccessrules="false" kind="src" path="/OtherProject"/&gt; &lt;classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Tomcat v5.5 Server"/&gt; &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_16"/&gt; &lt;classpathentry kind="output" path="target/classes"/&gt; &lt;/classpath&gt; </code></pre> <p>org.eclipse.wst.common.component:</p> <pre><code>&lt;project-modules id="moduleCoreId" project-version="1.5.0"&gt; &lt;wb-module deploy-name="Web Module"&gt; &lt;wb-resource deploy-path="/" source-path="/src/main/webapp"/&gt; &lt;wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/&gt; &lt;wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/&gt; &lt;dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/OtherProject/OtherProject"&gt; &lt;dependency-type&gt;uses&lt;/dependency-type&gt; &lt;/dependent-module&gt; &lt;property name="context-root" value="WebModule"/&gt; &lt;property name="java-output-path"/&gt; &lt;/wb-module&gt; &lt;/project-modules&gt; </code></pre> <p>I have tried with Tomcat's Location (right click the server, select Properties) being in workspace metadata, and also with it living in the Servers project. I have tried using the workspace metadata deployment, letting eclipse take over my tomcat installation, and a custom deployment location. It has worked once - breakpoint hit, properties read - but when I started the server again the next time, it went back to its old ways.</p> <p>If you need more information, let me know and I'll edit the post ASAP.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload