Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319187

Summary: Change in Java Server Faces include libraries does not update .classpath <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> for selected library and selected libraries are not published to Tomcat WEB-INF/lib directory
Product: [WebTools] WTP Java EE Tools Reporter: Kurt Lenfesty <Kurt.Rain>
Component: wst.webAssignee: wst.web <wst.web-inbox>
Status: NEW --- QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kurt Lenfesty CLA 2010-07-07 15:56:58 EDT
Build Identifier: 20100617-1415

This may be related to Bug 291811, Bug 240661, and possibly others.

It appears that after the initial Project Facets entries are made, subsequent additions to the list of libraries in the project preferences->Project Facets->Java Server Faces do not get propagated to an entry in the .classpath file and the jars associated with those libraries do not get published.

I had this problem with Galileo as well, although in that case it was the Java EE Module dependencies (or something like that).

Once you know how to manually fix the issue (by editing the .classpath file directly) it's quite easy to repair. However, it is an annoyance, and if someone doesn't know why jars are not showing up in the WEB-INF/lib of the deployed tomcat, they are going to be really frustrated. In trying to figure out this problem I've done things like deleted and recreated the server, closed the project, stopped and started eclipse, which don't fix the problem.



Reproducible: Always

Steps to Reproduce:
1. Create a dynamic web project with JSF 2.0, Tomcat 6.
2. Create some user libraries with jars (let's say UserLibraryA, UserLibraryB, UserLibraryC).
3. Add the UserLibraryA, UserLibraryB to the project Java Build Path.
4. In Project preferences, Project Faces->Java Server Faces check off UserLibraryA, UserLibraryB.
5. Create a Tomcat 6 Server installation. Add your project to the server.
6. Publish.

Notice that the jars for UserLibraryA and UserLibraryB appear in the WEB-INF/lib directory of the deployed web application.

7. Add UserLibraryC to the project Java Build Path.
8. 4. In Project preferences, Project Faces->Java Server Faces check off UserLibraryC.
9. In Servers, Publish the server.

Notice that the jars for UserLibraryC DO NOT appear in the WEB-INF/lib directory of the deployed web application.

If you look at the .classpath for the project, you will notice that the entries for UserLibraryA and UserLibraryB have the entry:
    <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>

Such as:
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/MyFaces_2.0">
		<attributes>
			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
			<attribute name="owner.project.facets" value="jst.jsf"/>
		</attributes>
	</classpathentry>

However, the entry for UserLibraryC does not have this entry. Such as:
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/LoginServiceClient">
		<attributes>
			<attribute name="owner.project.facets" value="#system#;jst.jsf"/>
		</attributes>
	</classpathentry>

If I close the project, edit the .classpath file manually and put the org.eclipse.jst.component.dependency manually for UserLibraryC, and then open the project, and publish it, the UserLibraryC jars WILL appear in the WEB-INF lib of the Tomcat deploy.

If when you created your project and added in all the relevant libraries and never changed them, then you would never notice this problem.