问题遇到的现象和发生背景
在xml文件中配置spring aop配置时在expression="execution(com.UserDaoImpl.(..))"上报错
用代码块功能插入代码,请勿粘贴截图
package com
interface UserDao {
fun insert()
fun delete()
fun update()
fun select()
}
package com
class UserDaoImpl {
fun insert(){
println("Inserting")
}
fun delete(){
println("Deleting")
}
fun update(){
println("Updating")
}
fun select(){
println("selecting")
}
}
package com
import org.aspectj.lang.JoinPoint
import org.aspectj.lang.ProceedingJoinPoint
class XmlAdvice {
fun before(joinPoint: JoinPoint) {
print("前置")
print("目标类" + joinPoint.target)
println(",植入的增强项" + joinPoint.signature.name)
}
fun afterReturning(joinPoint: JoinPoint) {
print("返回")
println("被植入"+joinPoint.signature.name)
}
@Throws(Throwable::class)
fun around(point: ProceedingJoinPoint): Any {
println()
val objcet = point.proceed()
println("环绕后")
return objcet
}
fun afterException(){
println("异常")
}
fun after(joinPoint: JoinPoint) {
println("后置applicationContext.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
https://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="UserDao" class="com.UserDaoImpl"></bean>
<bean id="xmladvice" class="com.XmlAdvice"></bean>
<aop:config>
<aop:pointcut id="pointcut" expression="execution(*com.UserDaoImpl.*(..))"/>
<aop:aspect ref="xmladvice">
</aop:aspect>
</aop:config>
</beans>
运行结果及报错内容
com.UserDaoImpl.(..)的点会报错
我想要达到的结果
如何能解决报错?