sunmingtao / sample-code

3 stars 4 forks source link

Trove admin: New service doesn't get recognised as Spring bean (Super weird) #246

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago

Create a new KeycloakService under grails-app/services/au/gov/nla/trove/admin

Inject the service to a controller. The service is always null.

But other services are successfully injected without any annotation or xml bean definition.

sunmingtao commented 3 years ago

After I renamed another service and then renamed it back, all of a sudden the KeycloakService gets recognized as a Spring bean. I am still not sure what I did fixed the problem.

For future reference, I guess I might have need to do a ./gradlew build -x test to rebuild