jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

XML schemas not found

Open gregw opened this issue 3 years ago • 7 comments

Jetty version(s) 12

Description #8406 broke XML validation. Running the demos I get:

2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [XMLSchema.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [datatypes.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [xml.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2022-08-11 13:52:48.606:WARN :oatud.DigesterFactory:main: The XML schema [web-jsptaglibrary_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2022-08-11 13:52:48.606:WARN :oatud.DigesterFactory:main: The XML schema [jakartaee_10.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2022-08-11 13:52:48.606:WARN :oatud.DigesterFactory:main: The XML schema [jsp_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.

gregw avatar Aug 11 '22 03:08 gregw

These warnings are coming from jasper. When it initializes, it tries to load various schemas, so it can parse jsps, tlds etc. It does not use our xml schema setup in XmlParser/Catalog etc etc. It finds these .xsds and .dtds by asking the classloader that loaded the jakarta.servlet.ServletContext class to get those resources.

The issue is that the 6.0.0 version of the jakarta.servlet-api.jar in fact does not contain the following .xsds and .dtds. I don't know if that was a deliberate omission or not:

2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [XMLSchema.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled. 2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [datatypes.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled. 2022-08-11 13:52:48.603:WARN :oatud.DigesterFactory:main: The XML schema [xml.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.

I can't reproduce your errors for the other schemas. They are present in the 6.0.0 jar, and when I run the demos from a fresh build of 12.0.x they are found.

janbartel avatar Aug 11 '22 06:08 janbartel

Can we submit our Catalogs or EntityResolver to their handling?

joakime avatar Aug 11 '22 13:08 joakime

@joakime no, they look for these schemas/dtds in a static code block.

janbartel avatar Aug 12 '22 00:08 janbartel

Closing, fixed in PR #8406

joakime avatar Jan 25 '23 22:01 joakime

This is still happening in Jetty Demos. It's a warning, seems harmless, but it should be addressed.

2023-07-24 15:25:12.331:WARN :oejshC.ee10_demo_jaas:main: The test-jaas webapp is deployed. DO NOT USE IN PRODUCTION!
2023-07-24 15:25:12.375:WARN :oatud.DigesterFactory:main: The XML schema [XMLSchema.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2023-07-24 15:25:12.376:WARN :oatud.DigesterFactory:main: The XML schema [datatypes.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2023-07-24 15:25:12.376:WARN :oatud.DigesterFactory:main: The XML schema [xml.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2023-07-24 15:25:12.494:INFO :oejsh.ContextHandler:main: Started oeje10w.WebAppContext@70d2e40b{EE10 Demo JAAS WebApp,/ee10-test-jaas,b=file:///home/joakim/code/jetty/distros/bases/demos-12/work/jetty-0_0_0_0-8443-ee10-demo-jaas_war-_ee10-test-jaas-any-/webapp/,a=AVAILABLE,h=oeje10s.SessionHandler@6ecd665{STARTED}}{/home/joakim/code/jetty/distros/bases/demos-12/webapps/ee10-demo-jaas.war}

joakime avatar Jul 24 '23 20:07 joakime

Same for AppEngine https://github.com/GoogleCloudPlatform/appengine-java-standard/issues/107

Should I move these 3 dtd/xsd under a package that is used for resolution? I see them in jetty-xml jar file, but not in the same package as they are in javax....

ludoch avatar Apr 04 '24 20:04 ludoch

@ludoch I replied at https://github.com/GoogleCloudPlatform/appengine-java-standard/issues/107

joakime avatar Apr 05 '24 12:04 joakime