As I know, using @Autowiredannotation for fields staticusing is Springnot possible. When I start my server JBosseverything works fine, but I see a few warnings:
Autowired annotation is not supported on static fields: private static ...
I do not use this annotation very often (I have not used it in this project yet), but perhaps some of my colleagues find it more useful.
So, I accepted one of these warnings:
Autowired annotation is not supported on static fields: private static java.lang.String com.my.package.MyClass.myVariable
I opened this class, and inside:
@Value("${params.myvariable}")
private static String myVariable;
I discovered config.xml:
<bean id="myid" class="com.my.package.MyClass">
<property name="myVariable" value="${params.myvariable}" />
</bean>
As a last resort, I searched for strings Eclipsefrom Autowiredin my project. The size of the result set was 0 .
So my question is what causes the warning:
Autowired annotation is not supported on static fields
in this case?
Thank you in advance