Eclipse: The selection did not contain any resource that can run on a server
Solution 1
PROBLEM
When you try to run the project on the server using "Run on Server" (SA+X+R) option, eclipse returns the following message: The selection did not contain any resources that can run on a server.
SOLUTION
On the navigation panel, click over the project for pop-up menu, properties, Project Facets, check: - Dynamic Web Module - Java It worked for me try this may be this is your problem
Solution 2
Maybe you sholud update two file in .settings folder in your web project: .settings/.jsdtscope
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/WebContent"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
.settings/org.eclipse.wst.common.component
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Web">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test"/>
<property name="java-output-path" value="/Web/build/classes"/>
<property name="context-root" value="shequwang-web"/>
</wb-module>
change the path="src/main/WebContent" value's as yours in the two files,then restart the IDE.After I done this,it was work well again.
skip
Updated on July 22, 2022Comments
-
skip almost 2 years
I am not able to run maven java web application project to the configured tomcat within eclipse ide.
Initially I could right click on the project and run it on tomcat server but ever since I shared the project to a repository I am not able to do that.
I disconnected the project form the repository and now I I dont even see the Run as -> Run on Server option inside eclipse ide.
I am using m2e plugin version .0.12.1 and eclipse helios and tomcat 6.
Could someone help me understand what am I missing here?
Thanks.