Inject Non-Spring Bean

Additional Jar files:

org.springframework.aspects-3.1.0.M1.jar
c:\aspectj-1.6.11\lib\aspectjweaver.jar

Also need make sure JVM AspectJ-enabled.

put -javaagent:C:/aspectj-1.6.11/lib/aspectjweaver.jar
into VM Argument section

The above are just setting environments.

Why/when we want to inject stuff into a non-spring bean?
There are many scenarios that a bean is not instantiated by Spring, but we still want to inject value/references into this bean.

In config:

xmlns:aop="http://www.springframework.org/schema/aop"
...
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
...

<aop:spring-configured/>

<bean id='noSpringBean' class="packageA.NoSpringBean" abstract="true">
<property name="beanName" value="Bolun"/>
<property name="height" value="187"/>
</bean>

NoSpringBean.java

@Configurable("noSpringBean")
public class NoSpringBean
{
...
}

When you test it, you will see a lot of Waving stuff before our codes are really executed, performance wise, this could be really bad.

Adding org.springframework.transaction-3.1.0.M1.jar into path, removed a lot of complains.