Affects Version/s: 1.0.2
Fix Version/s: None
I'm annotating some of my service methods using @javax.annotation.PostConstruct. This ensures spring will call that method on the bean after the bean is created. To get this working, I added " bean(org.springframework.context.annotation.CommonAnnotationBeanPostProcessor)" to resources.groovy.
This is failing silently if either the service has "static transactional = true" or if the service is injected into another service that has "static transactional = true".
See the attached sample grails project created with "grails bug-report". If you run "grails run-app", you will see the message on stdout: "setUp() annotated with @PostConstruct called in PostConstructService". If you change the transactional property to false in services/PostConstructService.groovy or services/UsesPostConstructService.groovy, then the @PostConstruct method will not be called and the message above will not be printed to stdout.
A workaround for this is to implement Spring's InitializingBean interface and define afterPropertiesSet(). This is a little more invasive than using the @PostConstruct annotation.