Spring 3.0 annotation and xml configuration
Followed by 5 people
Currently I see that xml configuration doesn’t take Annotation configuration in consideration.
I have a bean configured via annotaion, but in my context.xml its usage is red.
Am I missing something or it just not yet there?
Everything works fine, but the red marks just bother me.
Please sign in to leave a comment.
Do you have a small example snippet?
As far as I remember, annotation-driven beans used in some of our projects work in IDEA - we're using the 2.5 namespaces though.
-tt
In XML file define bean like this:
Here's how it really looks in IDEA:
<property name="client" ref="myClient"/>
Thies RED thing - bugs me a million:(
In Java, like this:
And I would like to highlight that this code works fine.
But, myClient is red, i.e. IDEA can't recognize bean configured via annotation from XML config file.
But, I hope that I'm missing something and it can work properly.
Thnx, Andrey
I though you were referring to the annotation-driven configuration, but it seems you're using Spring JavaConfig (or whatever it's called these days).
We're not using that.
Hi Andrey,
What is your @Configuration ? org.springframework.config.java.annotation.Configuration
or org.springframework.context.annotation.Configuration ?
Idea uses classpath scanning (http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch03s10.html)
to find proper @Configuration classes.
Do you have <context:component-scan base-package="org.andrey12345"/> in
your configuration?
serega.
Spring3.0 annotation ,I cannot configure,If import some packages? (I am Chinese,my english is poor,please help me,my msn: fukailong@msn.com)
Hello there.
I am having the same problem.
I use spring context 3.0.6
intelliJ 10.5.2 component based scan.
and use the @Bean tag.
Is it still not supported even though spring 3.0.x supports is fully?