Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cannot install project facet" error while creating a project?

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?

like image 859
Sandeep Avatar asked May 02 '12 21:05

Sandeep


3 Answers

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.

like image 98
Sandeep Avatar answered Nov 13 '22 11:11

Sandeep


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.

like image 1
revathi Avatar answered Nov 13 '22 11:11

revathi


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.

like image 1
David C. Untalan Jr. Avatar answered Nov 13 '22 13:11

David C. Untalan Jr.