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


##########
grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/bootstrap/AbstractDatastoreInitializer.groovy:
##########
@@ -330,6 +330,19 @@ abstract class AbstractDatastoreInitializer implements 
ResourceLoaderAware {
                 final Class<Service> clazz = serviceDefinition.getType()
                 final Class<?> serviceClass = loadServiceClass(clazz)
                 final grails.gorm.services.Service ann = 
clazz.getAnnotation(grails.gorm.services.Service)
+
+                // Skip services whose domain class is not mapped in this 
initializer.
+                // When persistentClasses is explicitly set, only register 
services for
+                // domains that are actually configured - prevents classpath 
pollution from
+                // unrelated @Service implementations (e.g., TCK test 
services) causing
+                // startup failures due to missing datasource connections.
+                if (ann != null && !persistentClasses.isEmpty()) {

Review Comment:
   AbstractDatastoreInitializer.groovy changes have relocated in 
https://github.com/apache/grails-core/pull/15429/changes/4cba7f600d5101096a15aaaf46ccb3f371624cb9
 and removed in 
https://github.com/apache/grails-core/pull/15429/changes/f904ca8a412f090c7a151ea103fe172ee49ad944



-- 
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