Spring Boot, @Autowire into an unmanaged class using @Configurable and load time weaving

前端 未结 1 501
暗喜
暗喜 2021-01-02 18:40

I have a collection of unmanaged classes that I are instantiated outside of Spring. I\'ve been attempting to use Spring AOP with load time weaving to @Autowire

1条回答
  •  情书的邮戳
    2021-01-02 19:09

    In order to instrument LTW you'll need to either use the javaagent or place spring-tomcat-weaver.jar in the \lib folder and set up TomcatInstrumentableClassLoader in context.xml.

    javaagent example:

    -javaagent:"${settings.localRepository}/org/springframework/spring-agent/2.5.6.SEC03/spring-agent-2.5.6.SEC03".jar
    

    ClassLoader example:

    
        
    
    

    0 讨论(0)
提交回复
热议问题