jamesfredley commented on code in PR #15824:
URL: https://github.com/apache/grails-core/pull/15824#discussion_r3591420330


##########
grails-spring/src/main/groovy/grails/spring/BeanBuilder.java:
##########
@@ -234,11 +218,11 @@ public void xmlns(Map<String, String> definition) {
 
             Assert.notNull(uri, "Namespace definition cannot supply a null 
URI");
 
-            final NamespaceHandler namespaceHandler = 
namespaceHandlerResolver.resolve(uri);
+            final NamespaceHandler namespaceHandler = 
getXmlSupport().resolveNamespaceHandler(uri);
             if (namespaceHandler == null) {
                 throw new BeanDefinitionParsingException(
                       new Problem("No namespace handler found for URI: " + uri,
-                            new Location(readerContext.getResource())));
+                            new 
Location(getXmlSupport().getReaderContext(beanBuildResource).getResource())));

Review Comment:
   Confirmed already addressed on this branch. The unknown-namespace error path 
builds its `Location` directly from the already-available `beanBuildResource` 
(`new Problem("No namespace handler found for URI: " + uri, new 
Location(beanBuildResource))`), so it does **not** call 
`getXmlSupport().getReaderContext(...)` and therefore never forces 
`XmlBeanDefinitionReader` / unrefreshed-context initialization on the error 
path. The regression test 
`testUnknownNamespaceDoesNotInitializeXmlReaderForErrorLocation` locks this in 
by making context initialization throw and asserting the namespace-handler 
error still surfaces. Merged the latest `8.0.x` as well.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to