glassfish icon indicating copy to clipboard operation
glassfish copied to clipboard

Need more descriptive error message in case of an invalid schema

Open kitlei-robert opened this issue 4 years ago • 2 comments

Environment Details

  • GlassFish Version (and build number): 6.2.1 release

Problem Description

I am in the process of updating some old JEE projects to Jakarta EE 9(.1). As the projects are quite simple, it takes me only two steps: replacing javax. package name prefixes with jakarta. as appropriate, and updating the schemas. This issue concerns the latter step.

If I try to use the projects with GlassFish 6.2.1, I get the error message thrown on this line of code. It is possibly loaded from this file, however, the two texts are the same: Requested schema is not found in local repository, please ensure that there are no typos in the XML namespace declaration.

This error message is not helpful enough, as it doesn't mention the name of the wrong schema, forcing me into a guessing game.

Suggestion: include the name of the missing/wrong schema's name in the error message like this: "Requested schema wrong_schema.xsd is not found in local repository, please ensure that there are no typos in the XML namespace declaration." Optionally, for further assistance, the message could also mention the path of the local repository.

Performing the change seems to be trivial: the required name should be one of the two arguments on this line.

kitlei-robert avatar Sep 12 '21 18:09 kitlei-robert

The link in "on this line" should be this one: https://github.com/eclipse-ee4j/glassfish/blob/abbf4b4460af59cd98056c30f3e1e1028b210b8a/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/node/SaxParserHandler.java#L229 (when linking to the code, it's always better to refer to a specific commit rather than the master branch, which may change in the future)

OndroMih avatar Aug 03 '22 22:08 OndroMih

I will go through LogStrings.properties in org.glassfish.main.deployment.deployment-common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment , seems many of these log keys are used by loggers with different bundles.

dmatej avatar Aug 16 '22 09:08 dmatej