- This topic has 7 replies, 5 voices, and was last updated 20 years ago by searcherrr.
-
AuthorPosts
-
Brice RuthMemberI get a message from Eclipse reading:
“Editor could not be initialized”
when I try to open an XML file I have. It has to do with DTD resolution. I have a DTD set (SYSTEM) that has a particular URL in it:
http://www.fiskars.com/xml/navigation.dtd
Now, per what I know about XML, these URLs aren’t necessarily supposed to be “real” … in this case, until just a few moments ago, this URL was just symbolic … when loading this XML file in my application, I used a custom EntityResolver that knew where the navigation.dtd file was located (within my application’s WAR). Obviously, MyEclipse can’t know that. But, I would think that the XML Editor should do something more graceful than simply crashing. I could see this being a problem for “valid” URLs, if the URL cannot be reached for any reason … (working offline, for instance)
This is on 3.7RC2, running on Eclipse 3.0M6, on WinXP Pro.
I’ve tested that this is in fact the problem by quickly creating an xml directory with that DTD in it, at http://www.fiskars.com/ – I happen to control the site, so I can do that quickly ;).
Should I be putting a different type of DOCTYPE declaration in this file? Here’s the full text of my DOCTYPE:
<!DOCTYPE navigation SYSTEM “http://www.fiskars.com/xml/navigation.dtd” [
<!ENTITY % isolat1 PUBLIC
“ISO 8879:1986//ENTITIES Added Latin 1//EN//XML”
“http://www.w3.org/2003/entities/iso8879/isolat1.ent”
>
%isolat1;
]>One recommendation I might have on ‘gracefully’ recovering from an error of this sort, is to prompt the user for the location of the DOCTYPE.
Thanks, and great work!!
Riyad KallaMemberbdruth,
You are hitting the nail on the head. The XML editor implicitly is trying to resolve the URL but doesn’t give a informative or graceful error message when DTD loading fails. This is the 3rd ‘bug’ reported this week due to DTD-loading being make-it or break-it. I’m going to file this as a Bug asking that Scott talk with the dev team about implementing some simple yet information dialogs that let the users know whats going on when DTD resolution fails.Scott, please have the dev team check for and respond to the following cases:
-
1) URL valid, DTD found (no message)
2) URL invalid, DTD not found (“Unable to load DTD referenced by this document, please check the URL and try again”)
3) URL timed out, DTD not found (“The operation timed out while attempting to load the DTD referenced by this document. The hosting server may be down.”)
4) URL invalid/timed out, BUT DTD is in the cache (no message, just load from cache)
5) Allow user to turn off DTD resolution if they know what they are doing and don’t want it (no message, don’t load from cache, just ignore DTD references)Am I missing any cases? Does this sound alright to everyone?
Scott AndersonParticipantInteresting points. Part of the issue with notifying the user is that validation takes place during the build loop of a project. If you have 20 XML files that reference 20 invalid DTD’s I doubt you really want a dialog each time. Additionally, putting up a dialog at that time is not possible anyway since the build loop thread is not the Eclipse UI thread, so it’s rather tricky business. I’m not sure of a good solution, but I’ll kick it to the dev team. Even without finding the DTD, it should at least be ignored rather than causing the editor not to initialize for the file. In the interim, I’d suggest using valid DTD’s, removing unresolvable ones, or turning validation off.
Riyad KallaMemberThank you for looking into this Scott. Maybe if the guys could “queue” a warning message during build, and display it when the file is actually opened with the editor?
snpeMemberYou see xml catalog on http://www.oasis-open.org/committees/entity/spec.html
regards
Riyad KallaMemberFixed in 2.7 GA, XML editor will not die now with invalid DTD.
snpeMemberxml cataalog is specifiation for setting local dtd (or xsd) for any remote interface
It is fine if we haven’t internte connection (or validate and chek xml without
network roundtrip)regards
searcherrrMemberI’m using IBM WebSphere which uses regular Eclipse.
The IBM version numbers: Version: 5.0.1 Build id: 20030516_1007
According to the Plug-in window its using Eclipse Platform: 2.0.3I’m experiencing the EXACT same problem as you guys using MyEclipse were experiencing and its causing the whole IDE to bomb due to the time-outs which seem to never stop trying to connect. Anyone know how I can get this fixed? Am I running a really old version of Eclipse within WebSphere or what? Anyone know of a specific fix for this problem just for the regular “Eclipse Platform” ?
Thanks and this is kinda urgent.
-
AuthorPosts