Spring 方面无法在类似项目中使用相同的配置
Spring aspect not working with identical configuration in similar project
我有 2 个 war 项目具有共同配置的类似项目:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<aop:aspectj-autoproxy proxy-target-class="true" />
<bean class="config.store.PersistentAspect">
</bean>
方面方法是:
@AfterReturning("@annotation(org.springframework.jmx.export.annotation.ManagedOperation) && !execution(* get*(..)) && !execution(* is*(..)) && !execution(* reset())")
public void do(JoinPoint jp) {
}
当我看到应用程序日志方面在两个项目中都已初始化时。问题是这方面只在一个项目中起作用,在第二个项目中起作用。
当我关闭日志记录时 org.springframework 我可以看到,在它工作的项目中,这一行:
01:59:31.299 [RMI TCP Connection(4)-127.0.0.1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'config.store.PersistentAspect#0'
第二名我应该如何调试它并找出它不起作用的原因?有什么可以阻止这方面的工作?另一个方面?
还行
当我打开整个日志时 spring 我发现了这个:
Bean 'myClass' of type [class MyClass] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
我只是想知道为什么它至少不是警告而是调试信息。这 solution 是否仍然适用于 Web 服务等多线程应用程序?
我有 2 个 war 项目具有共同配置的类似项目:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<aop:aspectj-autoproxy proxy-target-class="true" />
<bean class="config.store.PersistentAspect">
</bean>
方面方法是:
@AfterReturning("@annotation(org.springframework.jmx.export.annotation.ManagedOperation) && !execution(* get*(..)) && !execution(* is*(..)) && !execution(* reset())")
public void do(JoinPoint jp) {
}
当我看到应用程序日志方面在两个项目中都已初始化时。问题是这方面只在一个项目中起作用,在第二个项目中起作用。
当我关闭日志记录时 org.springframework 我可以看到,在它工作的项目中,这一行:
01:59:31.299 [RMI TCP Connection(4)-127.0.0.1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'config.store.PersistentAspect#0'
第二名我应该如何调试它并找出它不起作用的原因?有什么可以阻止这方面的工作?另一个方面?
还行
当我打开整个日志时 spring 我发现了这个:
Bean 'myClass' of type [class MyClass] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
我只是想知道为什么它至少不是警告而是调试信息。这 solution 是否仍然适用于 Web 服务等多线程应用程序?