jetty.project
jetty.project copied to clipboard
XML schemas not found
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.
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.
Can we submit our Catalogs or EntityResolver to their handling?
@joakime no, they look for these schemas/dtds in a static code block.
Closing, fixed in PR #8406
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}
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 I replied at https://github.com/GoogleCloudPlatform/appengine-java-standard/issues/107