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

Bug 100708

Summary: catelog uri reference broken with emf-sdo-xsd-SDK-I200506160200
Product: [Eclipse Project] PDE Reporter: David Williams <david_williams>
Component: UIAssignee: Konrad Kolosowski <konradk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: csalter, dejan, ebelisar, Ed.Merks, jeffliu, thatnitind, wassim.melhem
Version: 3.1   
Target Milestone: 3.1 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
100708 ExtensionsErrorReporter patch.txt none

Description David Williams CLA 2005-06-18 15:38:49 EDT
I was investigating our "move up" to RC3 level (and recent builds of 
pre-reqs) and found ... 
 
With emf-sdo-xsd-SDK-I200506160200 version of "xsd infoset", 
the xml catalog uri reference is broken due to the org.eclipse.xsd
plug in being "jarrred". The reference uses 

platform:plugin/org.eclpise.xsd/cache/.....

Being jarred is good, but need to have these schemas "in the clear" 
to refer to them?

BTW, what I'm reporting its that PDE plugin.xml validation reports it as 
"not found" ... not sure if it is really "not found" at runtime. (I'm not clear 
on a good simple test case is).
Comment 1 David Williams CLA 2005-06-18 15:40:50 EDT
CCing Ed Merks for comment ... have you seen this the jarred plugins too?
Comment 2 Ed Merks CLA 2005-06-20 06:44:08 EDT
Finding the cached schemas via a platform:/plugin URL should work transparently
the same whether the file is in a jar or not.  Just in case it's not a typo
below, the reference should use platform:/plugin/org.eclipse.xsd/cache/...
Comment 3 David Williams CLA 2005-06-20 15:34:56 EDT
Yes, it was a typo, the full URI given is
			uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd" />

And, I've convinced myself we can find it just fine, I'll open bug 
on PDE. 
Comment 4 David Williams CLA 2005-06-20 15:39:59 EDT
In case its not clear from 'moving' bug, I think this is 
an erroneous error/valdation message the PDE Editor/validator gives
for a plugin.xml file that contains a URI using platform:/plugin
for a jarred plugin. In previous version, the referenced plugin
was not jarred, and did not give the error messages. 

I found this using RC3 development environment. 
 
The jarred plugin is in the PDE target environment. 
Comment 5 Wassim Melhem CLA 2005-06-20 18:20:54 EDT
David, can you please restate the problem in comment 4 more clearly, with a 
sample xml snippet and what the alleged erroneous PDE behavior is?  thanks.
Comment 6 David Williams CLA 2005-06-20 22:11:27 EDT
Yes, the snippet below gives a "resource not found" error in problems view and
PDE editor (or warning, depending on setttings. To be exact, here's a past from
problem's view. 

2	Referenced resource
'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd' in
attribute 'uri' cannot be found.	plugin.xml	org.eclipse.wst.xsd.ui	line 152	June
20, 2005 4:00:15 PM

Here's the snippet from our plugin.xml
	<extension
		point="org.eclipse.wst.xml.core.catalogContributions">
		<catalogContribution id="default">
			<uri
				name="http://www.w3.org/2001/XMLSchema"
				uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd" />
		</catalogContribution>
	</extension>
Comment 7 Wassim Melhem CLA 2005-06-20 22:23:06 EDT
Thanks David.  The code checking for the presence of a resource is still 
assuming a flat structure.

Konrad, please investigate a fix for RC4.
Comment 8 Dejan Glozic CLA 2005-06-21 15:21:06 EDT
Created attachment 23658 [details]
100708 ExtensionsErrorReporter patch.txt
Comment 9 Konrad Kolosowski CLA 2005-06-21 15:35:08 EDT
The Patch _I_ attached above, fixes following problems in the error reporter:

Resources referenced using platform: did not work on non Windows platform, 
because on Windows IPath returns platform: as device and on non Windows as 
first segment.  I added the code to expect platform: as the first segment as 
well when parsing.

Code was assuming plug-ins in the target platform are flat.  I added the code 
to check existance of jar entry in the jar if plug-in location ends 
with ".jar".

Wassim,
Please evaluate risk/benefits of this fix for RC4.
Thanks.
Comment 10 Konrad Kolosowski CLA 2005-06-21 15:37:03 EDT
The old code + new code could be simplified/generalized, but I was trying not 
to refactor anything, and leave as much of existing code as is.
Comment 11 Wassim Melhem CLA 2005-06-22 16:07:04 EDT
*** Bug 101341 has been marked as a duplicate of this bug. ***
Comment 12 David Williams CLA 2005-06-23 11:06:31 EDT
I would like to advocate to have this fixed in 3.1 if at all possible. 
I find this "resource checking" to be very handy because there's no other way 
to do it, and these types of bugs are hard to find "just by testing". (That is, 
may be a long time before the problem is hit). 

I was reminded of this today as I set up a linux environment (I saw orignal
problem on windows), and saw on Linux that even "icons" were not being correctly
"found" in another plugin. (They were when ran, just that it was being reported
as an error in dev. env.). 

All in all, I've found that incorrect validation messages makes users ignore
them completely, so would be a shame to spoil the 3.1 bushel with this bad apple
(sorry for the metaphore, I'm just in a poetic mood or something). 

Thanks all. 

If there's anything I can do to help, let me know. 
Comment 13 David Williams CLA 2005-06-23 11:07:22 EDT
*** Bug 101461 has been marked as a duplicate of this bug. ***
Comment 14 Konrad Kolosowski CLA 2005-06-23 11:48:47 EDT
Wassim, and I propose releasing this into RC4.
Dejan?
Comment 15 Wassim Melhem CLA 2005-06-23 11:50:15 EDT
+1
Comment 16 Dejan Glozic CLA 2005-06-23 11:59:09 EDT
The patch is not exactly a one-liner as I would like it, but it is seems 
important for 3.1. Please apply rigorous testing after applying.

+1
Comment 17 Wassim Melhem CLA 2005-06-23 15:05:20 EDT
tagged for the 4 pm build.

thanks konrad.
Comment 18 Dejan Glozic CLA 2005-06-23 16:50:30 EDT
The patch has two strings that need to be tagged as NON-NLS. Please consider 
doing it for 8pm.

lines 345, 360:

	if(bundleLocation.endsWith(".jar")) {
Comment 19 Ella Belisario CLA 2005-06-24 00:03:44 EDT
*** Bug 101338 has been marked as a duplicate of this bug. ***