20060810 Thursday August 10, 2006

Eclipse Losing Web App Libraries

This one has been bugging me for a while. The Eclipse J2EE perspective kept loosing all the web app libraries (the ones in /WebContent/WEB-INF/lib), thus I kept getting a ClassNotFoundException for all the classes that were definitely there.

It took me forever think about simply removing the Web App libraries from the build path, then re-adding them. This fixed the problem (hopefully permamently, but if not at least the solution is fairly painless).

To do this yourself, just right click on the project in the Navigator view and select Properties. Click Java Build Path, then select Web App Libraries from the panel on the right, and click the Remove button. Once that entry is gone, click Add Library, then select Web App Libraries again, and you should be back in business.

Update:

The problem came back, only worse than before. This time, removing and re adding the web app libraries didn't solve the problem. Suspecting something more sinister, I started peaking in the Eclipse settings, and found something interesting under workpace/PROJ_HOME/.settings (replace PROJ_HOME with the name of the project). There is a file in there called .component that contained the following entries:


<property name="java-output-path" value="/build/classes/"/>
<property name="java-output-path" value="/build/classes/net"/>

None of my other projects had the line ending with "net", and since net was also what my packages started with, I guessed that somewhere along the line Eclipse got a little confused and added this errant line. Once I removed it, all my problems went away, and have stayed away for a while now.

Posted by rickg ( Aug 10 2006, 10:22:12 AM PDT ) Permalink Comments [0]
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed