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

Bug 328785

Summary: Tag library functionality is broken when same library used in multiple projects
Product: [WebTools] WTP Source Editing Reporter: Ian Trimble <ian.trimble>
Component: jst.jspAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: blocker    
Priority: P3 CC: raghunathan.srinivasan, thatnitind, yurykats
Version: 3.2.3Flags: thatnitind: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 328783    
Attachments:
Description Flags
patch none

Description Ian Trimble CLA 2010-10-26 21:24:24 EDT
Only one dynamic web project can work with tag libraries - any subsequent project in the same workbench session fails (validation, content-assist, etc).

Create a dynamic web project with the JSF 1.2 preset (or manually include some JSP tag library in an application - this is NOT JSF-specific). Create a "JSF" JSP and open it with the JSP Editor. Note the taglib directives show no errors. Note the "f:view" element shows no errors. Use content-assist to add "h:form" element inside the "f:view". Note content-assist works and no validation errors or warnings are present.

Create a second dynamic web project with the JSF 1.2 preset. Create a "JSF" JSP and open it in the JSP Editor. Note validation errors for both taglib directives (e.g. "Can not find the tag library descriptor for "http://java.sun.com/jsf/core""). Note the validation warning for the "f:view" element ("Unknown tag (f:view)"). Attempt to use content-assist to add "h:form" element inside the "f:view". Note content-assist is not working.
Comment 1 Ian Trimble CLA 2010-10-26 22:12:36 EDT
Further investigation indicates the JSF facet *is* required - once one JSF-faceted project has used tag library functionality, subsequent JSF-faceted projects cannot.

Re-assigning to JSF Tools.
Comment 2 Ian Trimble CLA 2010-10-27 16:22:28 EDT
Sorry for the churn back-and-forth, but I am now able to reproduce with no JSF facet. I create two Dynamic Web Projects with JSF libraries added as a User Library. The first project to use ProjectDescription to resolve tag libraries succeeds, subsequent projects do not. A diff of 3.2.2 and 3.3 streams shows fJarRecords has been added to cache one JarRecord per file for all instances, but I'm not sure all necessary members get initialized correctly when JarRecord.isConsistent causes early exit - for example, is fClasspathReferences properly initialized? It appears to be empty later during resolution when the failure is witnessed.
Comment 3 Ian Trimble CLA 2010-10-27 16:27:00 EDT
NOTE: it may not have been clear - both projects should use the same User Library so the second project finds the JARRecord in the cache.
Comment 4 Nick Sandonato CLA 2010-10-27 17:39:57 EDT
Created attachment 181889 [details]
patch

When finding consistent library records, we need to make sure they're accounted for in the classpath JARs and References.
Comment 5 Nitin Dahyabhai CLA 2010-10-27 20:32:25 EDT
Approved and released, although I suspect bug 327028 has altered how we handle
the visibility of these records across projects.  Needs a little more investigation.