This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 213631 - WSDL, XML and XSD file validation incorrectly reports success
Summary: WSDL, XML and XSD file validation incorrectly reports success
Status: CLOSED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.validation (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Gary Karasiuk CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-20 15:02 EST by Keith Chong CLA
Modified: 2008-01-28 10:30 EST (History)
8 users (show)

See Also:


Attachments
patch for this problem as well as some code cleanup (97.93 KB, patch)
2007-12-21 11:22 EST, Gary Karasiuk CLA
no flags Details | Diff
A patch for the JSP validation problem. (4.31 KB, patch)
2008-01-04 15:57 EST, Gary Karasiuk CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Chong CLA 2007-12-20 15:02:33 EST
Using this week's WTP 3.0 I-build I20071220083058, try validating individual
XML, WSDL or XSD files that contain errors.  The validator reports no errors.

(If you add the validation builder, error markers show up on the file(s).
but individual file validation still reports success.)
Comment 1 Keith Chong CLA 2007-12-20 15:04:17 EST
Changing abstract...
Comment 2 Amy Wu CLA 2007-12-20 17:12:46 EST
I confirmed the same problem with JSP validation.  I suspect the Validate action is broken for validating all file types.
Comment 3 Gary Karasiuk CLA 2007-12-20 17:40:10 EST
I'm looking into this.
Comment 4 Gary Karasiuk CLA 2007-12-21 11:22:08 EST
Created attachment 85717 [details]
patch for this problem as well as some code cleanup

Here is a patch for this problem. As well I have been cleaning up the old code (removing compiler warnings).
Comment 5 Matthias Fuessel CLA 2007-12-28 17:00:10 EST
This change makes the jsp validator fail in my sample project, producing error messages like "Path must include project and resource name: /WebContent", if invoked manually (context menu in project explorer). Validation while saving a file and incremental validation still work.

More specifically, you made the WorkbenchContext contain project-relative paths instead of workspace-relative ones like before (Validator.java:358). JSPValidator seems to expect workspace-relative paths in _helper.getUris(). Validation while saving file still produces workspace-relative paths.

Is this change intentional?
Comment 6 Chuck Bridgham CLA 2008-01-03 14:27:48 EST
This was already dropped in late December - If any issues remain please re-open
Comment 7 Keith Chong CLA 2008-01-03 18:24:45 EST
Verified using WTP M4 build 20080103043626.

Opened bug 214286 to address improving the status message that appears.
Comment 8 Keith Chong CLA 2008-01-03 18:25:11 EST
Closing bug
Comment 9 Keith Chong CLA 2008-01-03 18:28:56 EST
I should add, that WSDL, XSD and XML validation appear to be ok.  (The Validation Status dialog appears when there are valid errors in the files)
Comment 10 Keith Chong CLA 2008-01-03 18:30:37 EST
Amy, please verify HTML and JSP validation, and reopen if the problem still exists.
Comment 11 Amy Wu CLA 2008-01-03 18:45:51 EST
I verified that this is still not working for JSP & HTML validation.
I also verified that I see the problem Matthias reported in comment #5.

I'm reopening this bug for now, but please let me know if you'd rather me open 1 or 2 new bugs instead. Either way, I think these bugs are important to fix for M4.
Comment 12 Chuck Bridgham CLA 2008-01-04 09:03:50 EST
Dropping this to major....  and moving to M5 - assigning to Gary for a second look
Comment 13 Chuck Bridgham CLA 2008-01-04 09:05:50 EST
Sorry - moving back to M4...  Missed Amy's note stating this is needed for M4
Comment 14 Amy Wu CLA 2008-01-04 14:26:24 EST
I investigated this bug a bit more and found that:
a) the JSP Semantics (JSF) validator is the one that is throwing the error messages because apparently it is trying to validate every file.  I've cc'd Cameron on this bug since he seems to handle most of the jsf validator bugs.  I'll also open a separate bug for this issue.

b) The XML, WSDL, XSD validators expect project-relative paths to be returned when context.getURIs() is called.  The JSP, HTML, JS validators expect workspace-relative paths to be returned when context.getURIs() is called.

How these validators could expect different formats of the paths is because the XML, etc validators use org.eclipse.wst.xml.core.internal.validation.core.Helper for context while the JSP, etc validators use org.eclipse.wst.validation.internal.operations.WorkbenchContext.

Looking at WTP 2.0.2 code, I found that when populating both contexts' list of validation file uris, IWorkbenchContext.getPortableName() would be called.  That is where the XML's Helper turns workspace-relative paths into project-relative paths.  It looks like getPortableName() is no longer called in the new validator framework.

Gary, is there some place in the new validator framework (that handles old validators) where getPortableName() can be called?
Comment 15 Gary Karasiuk CLA 2008-01-04 15:57:00 EST
Created attachment 86227 [details]
A patch for the JSP validation problem.
Comment 16 Amy Wu CLA 2008-01-04 17:04:54 EST
I did a quick test of the patch in comment #15 and found that xml, wsdl, xsd, html, jsp validators all seem to be working correctly.
Comment 17 David Williams CLA 2008-01-04 19:13:50 EST
I've applied the patch from comment #15 so will move to 'fixed' again. 

Will be in builds >= 20080105

Thanks Amy, for your diagnosis and careful testing. 
Comment 18 Amy Wu CLA 2008-01-05 01:02:39 EST
using wtp3.0M4 20080105002406

verified jsp, html, xml, xsd, wsdl, dtd validators reports errors when there are some and report success when there arent any
Comment 19 Gary Karasiuk CLA 2008-01-28 10:30:12 EST
This is now fixed.