|Re: Classpath validator issue: Projects must be referenced by an EAR or WAR [message #550210 is a reply to message #550080]
||Thu, 29 July 2010 14:14
| Larry Isaacs
Registered: July 2009
On 7/29/2010 1:40 AM, Gerry Kaplan wrote:|
> Updated to Helios and started getting this annoying warning. After 3
> hours of tinkering with this, I give up and assume it is a bug.
> I created an empty dynamic web project. Then I added one user library
> that contains a single Jar in it. After fixing up the deployment
> assembly, I am left with this one message that won't go away. The
> project runs fine, but I want a clean project.
> Projects must be referenced by an EAR or a WAR to use classpath
> publish/export dependencies whose runtime path (../) maps into the
> parent component.
> Anyone know what to do about this?
I believe this is one of the confusing aspects of the Deployment
Assembly page. I believe "fixing up the deployment assembly" means you
used the "Referenced Projects Classpath Entries" to indicate that the
user library's jars should be included in project's WEB-INF/lib. This
use is incorrect. The "Referenced Projects Classpath Entries" works
correctly only for referenced projected. This means you've marked the
library as a dependency of the web project, which has meaning only to an
EAR project which references this web project.
The official way to correct this error is to go to the Libraries tab of
the Java Build Path page and expand the user library item. Select the
"Publish/export dependency: Added to parent module" subitem and click
Remove and Apply. Switch to the Deployment Assembly page, select the
"Pull in classpath elements from referenced projects" item, and click
Remove and OK. This undoes the incorrect "fixing up the deployment
assembly". Now switch to the Problems view and look for the slightly
different warning about the user library not being exported. It should
say "Runtime ClassNotFoundExceptions may result." Right click on this
warning and select Quick Fix and then Finish. This will mark the user
library appropriately to include it in WEB-INF/lib.
I quicker way to accomplish the above, excluding the removal of the
"Pull in classpath elements..." item (which is optional), is to modify
the ".classpath" file in the project to change:
<attribute name="org.eclipse.jst.component.dependency" value="../"/>
Powered by FUDForum
. Page generated in 0.03103 seconds