我开始学习Spring,尝试在Spring 3.2中使用AspectJ技术。我正在跟随书籍《Spring实战》的指导。作者通过以下方式导入AspectJ包来使用AspectJ:
import org.aspectj.lang.annotation.Aspect
然而,使用那个会让我面临着……
package org.aspectj.lang.annotation does not exist
我尝试将 aspectj.jar
(版本1.8.4)导入到NetBeans
的库中,但没有任何效果。我将这个jar放在几十个SPRING FRAMEWORK 3.2.3 RELEASE xxxxxx's
下面,但它仍然找不到该包。有什么可能导致这个问题?下面是我的beans.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
" xmlns:util="http://www.springframework.org/schema/util">
<context:component-scan base-package="heyspring">
</context:component-scan>
<aop:aspectj-autoproxy>