-
Notifications
You must be signed in to change notification settings - Fork 37.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@EnableSpringConfigured gives BeanFactory has not been set on BeanConfigurerSupport [SPR-9019] #13658
Comments
Sateesh Valluru commented I had the same problem and debugging through found that internalBeanConfigurerAspect was being created only upon finishing the initialization of the context.
Essentially trying to make Spring context pre instantiate the internalBeanConfigurerAspect. |
Gerrit Hübbers commented
|
Sateesh Valluru commented It's just a bean that I added, with the following content:
|
Chris Beams commented Given that this issue is comparatively unlikely (occurs only for GAE-based apps using |
In revisiting our load-time weaving setup for 6.0, we might be able to enforce early initialization of the bean configurer aspect independent from the declaration order (which can be brittle with component scanning in general), avoiding the need for custom |
Marcel Overdijk opened SPR-9019 and commented
I'm facing an issue with AspectJ Dependency Injection when creating objects with the 'new' keyword.
I have 3 Configuration classes: the main AppConfig.java, the web MvcConfig.java and BootStrapConfig.java for doing some data creation.
The AppConfig contains the
@EnableSpringConfigured
annotation to enable dependency injection when creating new domain objects. This class looks like:The BootStrapConfig looks like:
Note that this one does not have the
@EnableSpringConfigured
as I assume once (in AppConfig) should be enough.I'm loading the configuration classes with the following definition in web.xml:
When running this code on local (!) Google App Engine the AOP stuff works perfectly as expected.
But on the production Google Infrastructure I always noticed inconsistent behavior as the AOP aspects did not seem to work always between deployments. Note that that time I was using dailly development snapshots of Spring 3.1 so I did not give it much attention then as it worked quit often the other day. Also note that I was changing my own JAva config setup because of new features in different 3.1 RC's.
Now after the 3.1 GA locally everything works still fine, but on Google App Engine infrastructure I'm not able to get it working anymore. Spring works fine on it, only the AOP seems to be broken with
@EnableSpringConfigured
.Note that I also noticed this DEBUG message on the Google App Engine infrastructure:
Another thing I found out is that when I move the BootStrap
@Bean
definition and inner class from BootStrapConfig to AppConfig it works on Google App Engine infrastructure.Is there something I'm doing wrong?
Could it maybe the case that on the Configuration classes are processed in different order?
E.g. DevelopmentBootStrapConfig before AppConfig which means
@EnableSpringConfigured
was not yet invoked maybe?I don't know how this internally works...
For reference I'm als posting the full stack trace I received on Google App Engine infrastructure:
As requested in the dicussion forum I have also uploaded a simple example project (Maven) that runs locally but gives above error on Google App Engine infrastructure.
Reference URL: http://forum.springsource.org/showthread.php?120751-EnableSpringConfigured-gives-BeanFactory-has-not-been-set-on-BeanConfigurerSupport
Attachments:
3 votes, 7 watchers
The text was updated successfully, but these errors were encountered: