Eclipse problem: project references itself

Ian Dickinson picture Ian Dickinson · Dec 18, 2009 · Viewed 8.3k times · Source

I have small project consisting of one maven project and two maven modules. One of the modules is a webapp, and I'm using WTP to run all my web applications. Everything has been fine, until today when when the webapp started refusing to compile, citing:

Project 'sdx.client' cannot reference itself

If I remove the following line from the .classpath:

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

my project compiles again. From googling, I believe this is a WTP element, but I'm not really sure what it does and why it believes that it contains a reflexive reference to the project containing it. Suggestions for where to look to track down the source of the problem would be very welcome.

Update

I haven't solved the problem, but I did make the symptoms go away by deleting the project and checking it out again from svn. So it looks like a bug somewhere, but I'm not sure where to report it or how to propose a decision procedure to determine when it's fixed.

Answer

geert3 picture geert3 · Oct 9, 2012

I had the same problem and found a way to fix it via the .classpath file in my project: This entry was causing the problem:

<classpathentry kind="lib" path="C:/....jar">
    <attributes>
        <attribute name="javadoc_location" value="jar:file:/C:/....jar!/"/>
    </attributes>
</classpathentry>

Comparing with a previous version, it turned out the following line went missing, after the <attribute name=...> line. Adding it again made the problem go away:

<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>

Not sure how to explain it, but perhaps it helps somebody.