Why doesn't AspectJ compile-time weaving of Spring's @Configurable work?

后端 未结 4 1510
后悔当初
后悔当初 2020-12-02 13:51

Update 5: I\'ve downloaded the latest Spring ToolsSuite IDE based on the latest Eclipse. When I import my project as a Maven project, Eclipse/STS appears to

4条回答
  •  一个人的身影
    2020-12-02 14:16

    I successfully configured load-time weaving in my app, if this is an alternative for you.

    My environment:

    • JDK-1.6
    • Spring-2.5.6
    • JPA with eclipselink-1.1.0

    Configuration details:

    Spring XML configuration:

    
    
    
    
    
      
    
    
    
      
    
    
    
      
    
    

    Spring annotations

    @Configurable("baseEntity")
    public abstract class BaseEntity
    
    @Configurable("historyHandler")
    public class HistoryJpaHandler extends SessionEventAdapter implements HistoryHandler 
    

    Java VM Parameter

    /bin/java -javaagent:/full/path/to/spring-agent-2.5.6.jar
    

    Instances of historyHandler and baseEntitty are created by ecliselink. historyHandler in baseEntitty and historyDao in historyHandler is set by load-timeweaving.

    You can set the VM Parameter in Eclipse run configuration or in Tomcats catalina.sh/bat.

提交回复
热议问题