【发布时间】:2014-12-05 20:18:22
【问题描述】:
我正在尝试使用 spring AOP 框架。编译的代码没有错误。 当我尝试运行它时,我得到了上述异常。我正在使用 netbeans IDE 8.0.1。 我包含以下库和 jar 文件。
1) Spring Framework 4.0.1
2) aspectjrt.jar
3) aspectjweaver.jar
4) aopalliance-alpha1.jar
5) asm-5.03.jar
6) cglib-3.1.jar
这是我的 spring.xml 配置文件
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
">
<aop:aspectj-autoproxy/>
<bean name="triangle" class="springaop.Triangle">
<property name="name" value="My Triangle" />
</bean>
<bean name="circle" class="springaop.Circle">
<property name="name" value="My Circle" />
</bean>
<bean name="shapeService" class="springaop.ShapeService" autowire="byName" >
</bean>
<bean name="loginAspect" class="springaop.LoginAspect" />
</beans>
这些是每个发布者提供的最新 jar 文件。 我在 aopalliance jar 中的任何地方都没有看到 Advice 类。我搜索了这个问题。看来 Advice 类可能已从 aopalliance jar 中删除。我一直无法搜索它。除了告诉我使用 Maven 之外,有谁知道如何解决这个问题 :)?
【问题讨论】:
标签: java spring netbeans spring-aop