Skip to content

spring-beans-4.3.xsd and spring-utils-4.3.xsd schemaLocation change from http to https: is inconsistent with META-INF/spring.schemas #22739

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

Closed
robvarga opened this issue Apr 4, 2019 · 9 comments
Assignees

Comments

@robvarga
Copy link

robvarga commented Apr 4, 2019

The XSD files spring-util-4.3.xsd and spring-context-4.3.xsd in the 4.3.23 release changed the schemaLocation for the xsd:import lines so now they refer to https URLs. in schemaLocation.

<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="https://www.springframework.org/schema/beans/spring-beans-4.3.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="https://www.springframework.org/schema/tool/spring-tool-4.3.xsd"/>

However the spring.schemas files in the spring-beans and spring-context jars do not contain entries for https urls, and MyEclipse Spring Editor (which is an extended version of Spring Tool Suite) now chokes on the XML context configuration files which were working fine with Spring 4.3.22 with various errors (cvc-elt.1, cvc-complex-type.2.4.c, Referenced file contains errors (http://..../spring-context-4.3.xsd...) and Referenced file contains errors (http://..../spring-utils-4.3.xsd...).

There are possible other XSD files pulling in other XSDs with a changed https location, I only encountered these two in my code, yet.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 4, 2019
@jhoeller
Copy link
Contributor

jhoeller commented Apr 4, 2019

This is being resolved from spring.schemas with automatic adaptation from https to canonical http URLs, by both the framework itself and by the recent STS 3.9.8 release. A corresponding STS upgrade should help.

@jhoeller jhoeller self-assigned this Apr 4, 2019
@jhoeller
Copy link
Contributor

jhoeller commented Apr 4, 2019

As a quick measure, could you possibly manually register those URLs as valid schemas (with downloaded xsd files) in the Eclipse XML editor?

@robvarga
Copy link
Author

robvarga commented Apr 4, 2019

Yeah, the problem is that an STS upgrade is probably not possible in a MyEclipse installation which integrates STS in its own product.

Is the URL lookup from spring.schemas used in runtime, or only by the editor?

@sbrannen
Copy link
Member

sbrannen commented Apr 4, 2019

As a quick measure, could you possibly manually register those URLs as valid schemas (with downloaded xsd files) in the Eclipse XML editor?

That should definitely work.

I have done that in the past due to corporate firewalls blocking direct downloads of the schemas.

@robvarga, you should be able to configure that under Eclipse Preferences / XML / XML Catalog. There you can Add... entries for schemas that you have on your local disk.

@jhoeller
Copy link
Contributor

jhoeller commented Apr 4, 2019

spring.schemas is primarily used at framework runtime but STS picks up the local xsd files from there as well. You could also try including a custom spring.schemas file in your application classpath which adds explicit https mappings for those schemas, STS (even older versions) should pick it up from there as well.

@robvarga
Copy link
Author

robvarga commented Apr 4, 2019

I am doing the XML catalog approach at the moment, but it seems it is not sufficient to add only those two, as some validation steps still failed. I will try the custom spring.schemas first, although it may not be possible to put that file to the front of the classpath in a deterministic manner for unit tests (fortunately the app is a web-app, so putting it in WEB-INF/classes should take care of the full application).

How is the spring.schemas file picked up? Are all the spring.schemas files picked up and joined together (i.e. I can just add the additional entries to the custom file, or do I need to create a single file with all the spring.schemas files joined together added to WEB-INF/classes?)

Thanks for the quick answers and best regards,

Robert

@jhoeller
Copy link
Contributor

jhoeller commented Apr 4, 2019

All spring.schemas files should get picked up, with the order on the classpath being irrelevant (unless you want to override existing entries with a different value). So for your purposes, you'd just have to add a file with the specific missing entries.

That said, it'd be great if MyEclipse delivered an update built on STS 3.9.8 soon.

@robvarga
Copy link
Author

robvarga commented Apr 4, 2019

Adding the spring.schemas files to mirror the entries in the spring jars with https prefix in the classpath do fix the issue in MyEclipse.

@sbrannen
Copy link
Member

sbrannen commented Apr 5, 2019

Adding the spring.schemas files to mirror the entries in the spring jars with https prefix in the classpath do fix the issue in MyEclipse.

Great.

Thanks for trying it out and for providing us feedback!

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