Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345200 - DTD parser does not see public id catalog contributions
Summary: DTD parser does not see public id catalog contributions
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-09 16:21 EDT by Greg Amerson CLA
Modified: 2021-11-19 09:21 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Amerson CLA 2011-05-09 16:21:29 EDT
While working offline I made some edits to an XML file and the DTD parser for sapphire tried to load a DTD from a URL and it failed since network was offline.  Perhaps it could try to use the WTP XML catalog to see if it could load the DTD entries locally.
Comment 1 Konstantin Komissarchik CLA 2011-05-09 16:27:02 EDT
This is already happening. See DtdParser.parseFromUrl() method. Perhaps there is mismatch between what's registered in the catalog and what Sapphire is trying too lookup?
Comment 2 Konstantin Komissarchik CLA 2011-05-09 16:27:50 EDT
See Comment #1.
Comment 3 Greg Amerson CLA 2011-05-09 16:46:53 EDT
Ok I see where that is being called now, and I am specifying entries in the WTP catalog from my own plugin like this:

         <public
               publicId="-//Liferay//DTD Service Builder 6.0.0//EN"
               uri="platform:/plugin/com.liferay.ide.eclipse.server.core/dtd/liferay-service-builder_6_0_0.dtd"
               webURL="http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
         </public>

However, the WTP resolver is not finding it by systemId even though it matches exactly.
Comment 4 Greg Amerson CLA 2011-05-09 16:50:04 EDT
Hmm, it seems that sapphire doesn't pass in the Public ID but only does the systemId lookup.  All of my XML catalog entries in my plugin use the public ID.  I think if I add system ids to my plugin contribution to XML catalog that will make the sapphire lookup work.
Comment 5 Greg Amerson CLA 2011-05-09 16:50:38 EDT
I can make this work with supplying systemId's.  Thanks.
Comment 6 Konstantin Komissarchik CLA 2013-03-21 11:04:03 EDT
Another adopter ran into this. We need to look into this further.
Comment 8 Ling Hao CLA 2013-05-16 20:07:43 EDT
Tried to verify via JUnit test. Got this exception in my dev Eclipse, but Hudson test results are clear. What's the best way to verify this bug?

ERROR : Failed while parsing DTD located at "http://www.eclipse.org/sapphire/tests/xml/dtd/0005p.dtd".
java.lang.RuntimeException: Failed while parsing DTD located at "http://www.eclipse.org/sapphire/tests/xml/dtd/0005p.dtd".
	at org.eclipse.sapphire.modeling.xml.dtd.DtdParser.parse(DtdParser.java:48)
	at org.eclipse.sapphire.modeling.xml.schema.XmlDocumentSchemasCache.getSchema(XmlDocumentSchemasCache.java:121)
	at org.eclipse.sapphire.tests.modeling.xml.dtd.t0005.TestCatalogResolution.testPublicContribution1(TestCatalogResolution.java:64)
Comment 9 Ling Hao CLA 2013-05-17 13:08:31 EDT
Verified org.eclipse.sapphire.tests.modeling.xml.dtd.t0005.TestCatalogResolution using JUnit Plugin test in 0.6.2 and 0.7. Closing.