Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse 2020-09 (for Java) XML Editor shows new errors which were not there before. What to do? #557

Closed
Master-01 opened this issue Nov 11, 2020 · 17 comments

Comments

@Master-01
Copy link

Hellow!
See my image:
https://www.eclipse.org/forums/index.php/fa/39251/0/
I installed new version Eclipse 2020-09 for Java and now the Xml Editor, when opening my old xml files, gives errors in the <name: subname> constructions, indicating that there is no schema for 'subname' (see attached picture). But I don't need such circuits. these files are generated by someone else's program and it is impossible to describe all variants of 'name: subname' and their possible parameters. This error makes it very difficult to view such files and find other real errors in them.
Previous versions of Eclipse 2020-03 and earlier did not have this bug, it only appeared in the latest version.
Moreover, this error is not detected during 'Validate', it is shown only if you open this file in an XML editor.
If file not opened "view Problems" does not show this error, but where file open - this error show from "view Problems"
"Generic text Editor" show this error also as "XML Editor"
Can you please tell me how to remove this error in the Eclipse XML editor? I have looked through every possible XML setting but nothing seems to help!

@red-lichtie
Copy link

I have a similar error.
At work behind a firewall there is no way to directly download the "xsi:schemaLocation" file and an error is reported.
It would appear that the XSDs that are already included in eclipse in the XML Catalog are ignored.
Deleting the "xsi:schemaLocation" in all the POM, persistence, orm, etc. XMLs is extreme to say the least.

The Tool should look in the XML Catalog before even trying to directly download a schema file.

@angelozerr
Copy link
Contributor

I suspect it's a problem coming from https:/eclipse/lemminx/.

@red-lichtie or @Master-01 could you share a little XML content which causes this problem please. Thanks!

@red-lichtie
Copy link

red-lichtie commented Dec 16, 2020

Both screenshots are from the same Maven POM showing the combined effect of the error caused by being behind a firewall.

The XSD from the XML Catalog isn't used, I'm guessing because there is an schemaLocation attribute --> Error
image

XSD can't be loaded --> Warning
image

@mickaelistria
Copy link
Contributor

It looks like you have the legacy "Web Tools" XML editor installed. So I'm curious about how you configure your XML catalogs? I guess you have them configured for web tools but not for Wild Web Developer, which makes that Wild Web Developer doesn't resolve schema from catalog.

@red-lichtie
Copy link

I just installed the "Wild Web Developer" feature today, I didn't configure anything, I don't understand how or even why I would have to configure it to use a standard component.
The default catalog has the Maven and persistence name spaces.
Also, I don't see anything in preferences with even the word "wild" in it. Only a new "TextMate" element has been added.

@red-lichtie
Copy link

Also, it is opened in the maven POM editor. The XML error is not just in the editor but also visible in the package explorer view too.

@red-lichtie
Copy link

No user entries:
image

Maven Pom is there too:
image

@angelozerr
Copy link
Contributor

I just installed the "Wild Web Developer" feature today, I didn't configure anything, I don't understand how or even why I would have to configure it to use a standard component.

I understand that it's not clear. Let me try to explain you the problem. When you install WWD, it provides the TextMate support to colorize ts, js, xml etc with TextMate and language server for those languages. To see those TextMate in action, for xml file for instance open the file with Generic Editor instead of the WTP XML Editor.

When you install WWD, it provides a language server for XML https:/eclipse/lemminx/ which validates XML files when the file is opened.

Both screenshots are from the same Maven POM showing the combined effect of the error caused by being behind a firewall.

Indeed, LemMinx tried to download the maven schema but it failed.

The default catalog has the Maven and persistence name spaces.

I understand again it's not clear. Those catalog comes from WTP XML Catalog and the WWD doesn't use those XML catalogs (IMHO I think it should but I'm not sure it's an easy task since catalog comes from plugin) but it uses another XMLcatalogs preferences since WWD have none dependency to the WTP:

image

This XML catalog is very basic compared to WTP and if you wish to fix the maven problem, you should add at hand the XSD maven coming from your local hard drive.

@red-lichtie
Copy link

As I said, that element isn't there.

image
So I wouldn't be able to configure it, even if I should.

I only installed Wild Web Developer for TypeScript support, why on earth should I now have to copy all of the schemas that are already in use over from "XML -> XML Catalog" to "XML (Wild Web Developer) -> XML Catalogs"?

Surely if WTP is installed, then that catalogue should be automatically referenced.

At the very least I would expect a dependency to and the use of "org.eclipse.jst.standard.schemas" in the "Wild Web Developer" feature.

@angelozerr
Copy link
Contributor

angelozerr commented Dec 16, 2020

I only installed Wild Web Developer for TypeScript support, why on earth should I now have to copy all of the schemas that are already in use over from "XML -> XML Catalog" to "XML (Wild Web Developer) -> XML Catalogs"?

For user point view I totally agree with you. But for technical point view, it will require that WWD will have a dependency to WTP, and it's not the goal of WWD. But perhaps the WWD LemMinx integration could try to check XML catalogs from WTP exists and in this case it register them to LemMinx XML Language Server.

An another idea is to give the capability to disable XML validation from LemMinx when XML file is not opened with Generic editor, but I'm not sure it's a good idea since LemMinx maven improves the reporting error for maven.

@red-lichtie
Copy link

red-lichtie commented Dec 16, 2020

For user point view I totally agree with you. But for technical point view, it will require that WWD will have a dependency to WTP, and it's not the goal of WWD. But perhaps the WWD LemMinx integration could try to check XML catalogs from WTP exists and in this case it register them to LemMinx XML Language Server.

The technicalities are normally of no interest to users (as I am sure we all know from our own projects), in this case I consider myself in the role of the "non technical user" and look at this solely from the usability aspect and the user experience.

  1. Adding a new editor shouldn't have this kind of wide reaching impact on all "types" that the editor supports
  2. A new editor should be able to integrate known existing capabilities. In this case is is almost 100% likely that somonne installing wild web developer already is using a JEE installation and/or even WTP.

Possibly there should be a proposal to move "org.eclipse.jst.standard.schemas" to a common project (area/bundle) so that there is no direct dependency. Even a straight "copy" of the standard schemas could be considered to provide a better user experience (regardless of how technically reasonable/viable that may seem).

@mickaelistria
Copy link
Contributor

@red-lichtie code contributions towards what you suggest are welcome as pull requests.

@red-lichtie
Copy link

@red-lichtie code contributions towards what you suggest are welcome as pull requests.

I don't know the insides of eclipse, let alone LemMinx, TextMate and whatever other voodoo is involved :-)

@ljettddci
Copy link

WTP provides an interface to add user defined catalog entries (e.g. XMLCorePlugin.getDefault().getDefaultXMLCatalog()) where we can add our xsd files so it is done automatically for the users of our plugins. Does Wild Web Developer provide an interface or extension point? I tried to use XMLPreferenceInitializer, but it "cannot be resolved" from my plugin. Any hint/help would be appreciated.

@angelozerr
Copy link
Contributor

Does Wild Web Developer provide an interface or extension point?

No and I think it should provide it. IMHO I think it should be very nice to load XML catalog from the plugin https:/eclipse/webtools.sourceediting/tree/master/xml/bundles/org.eclipse.wst.standard.schemas

@mickaelistria
Copy link
Contributor

WTP provides an interface to add user defined catalog entries (e.g. XMLCorePlugin.getDefault().getDefaultXMLCatalog()) where we can add our xsd files so it is done automatically for the users of our plugins. Does Wild Web Developer provide an interface or extension point? I tried to use XMLPreferenceInitializer, but it "cannot be resolved" from my plugin. Any hint/help would be appreciated.

Please open a different discussion for this topic.

@mickaelistria
Copy link
Contributor

With latest release of Wild Web Developer, the local XSD defined in m2e.core (to WTP catalog extension) should now be used and passed as argument to intialization options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants