8
votes

I got the project from repository and as per the set-up instructions I tried to create a project in eclipse and pointed the location to where I downloaded the code from repository. Then when I click on finish I got the error stating

"One or more constraints have not been satisfied. Cannot install project facet Java 1.6. Some version of this project facet is already installed. Cannot install project facet Dynamic Web Module 3.0. Some version of this project facet is already installed."

How to solve this one?

4
It seems you are trying to create project with same name. Go to workspace location and delete already created project (if it is not deleted) - kosa
What project? What instructions? - nitind
@thinksteep - I changes the name but it is still giving same error. - Sandeep
@nitind - Assume it as any simple project because my question not depends on what the project is. Also the instruction is "Create a new project by pointing to the location where I checkout the code". - Sandeep

4 Answers

14
votes

I resolved this one. The solution is I have to goto to the ".settings" folder which is at the project location and deleted "org.eclipse.wst.common.project.facet.core.xml" file and restarted the process again. This time it worked. Thanks for your help.

1
votes

There is no need to delete the file and recreating again. Instead navigate org.eclipse.wst.common.project.facet.core.xml file in ur project on eclipse and change its installed facet tag with whatever version desired.

1
votes

I have the same challenges but using GlassFish5 that I downloaded from Oracle and I manually configure my org.eclipse.wst.common.project.facet.core.xml from .settings folder to:

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="GlassFish 5"/>
  <fixed facet="jst.web"/>
  <fixed facet="java"/>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="jst.web" version="4.0"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="java" version="1.8"/>
  <installed facet="glassfish.web" version="5"/>
</faceted-project>

and include the following files generated from Dynamic Web Project using TomEE, now my .settings folder has the following files:

.jsdtscope
org.eclipse.jdt.core.prefs
org.eclipse.wst.common.component
org.eclipse.wst.common.project.facet.core.xml
org.eclipse.wst.jsdt.ui.superType.container
org.eclipse.wst.jsdt.ui.superType.name

then, I edit my project's .classpath to point to the location of JAR file I'm using, since I'm using GlassFish5, this is my configuration:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_261">
        <attributes>
            <attribute name="owner.project.facets" value="java"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
    <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
    <classpathentry kind="lib" path="C:/glassfish5/glassfish/lib/javaee.jar"/>
    <classpathentry kind="output" path="build/classes"/>
</classpath>

Finally, when I go back to Eclipse IDE, I refresh my Project Explorer and walah!

I hope it helps for others with the same challenges.

0
votes

I too faced the same problem, tried creating multiple times dynamic web projects and it got resolved.

Below is what I observed in the working org.eclipse.wst.common.project.facet.core.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="Apache Tomcat v8.5"/>
  <fixed facet="java"/>
  <fixed facet="wst.jsdt.web"/>
  <fixed facet="jst.web"/>
  <installed facet="java" version="1.8"/>
  <installed facet="jst.web" version="3.1"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

Tech Stack I used:
Java 8 Tomcat 8.5 Eclipse Neon
Task: To create a Dynamic Web Project