org.springframework.beans.factory.BeanCreationExce

本文探讨了Spring框架中AOP配置出现的问题,具体表现为在初始化名为'dataSource'的bean时发生的BeanCreationException异常。异常根源在于aspectj表达式的路径设置错误,导致无法正确匹配类型。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [/dao-applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: warning no match for this type name: com.ssh.website.service.impl [Xlint:invalidAbsoluteTypeName]
Caused by: java.lang.IllegalArgumentException: warning no match for this type name: com.ssh.website.service.impl [Xlint:invalidAbsoluteTypeName]
at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:315)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:189)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:176)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:157)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:179)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:236)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:270)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:312)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1180)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:184)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:159)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:145)
at com.ssh.website.test.userServiceTest.main(userServiceTest.java:25)

这是因为aop中的expression的路径不对,只要是xml文件有错,都会有异常!
freadahead.c: In function 'freadahead': freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." 92 | #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." | ^~~~~ make[7]: *** [Makefile:1910: freadahead.o] Error 1 make[7]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/lib' make[6]: *** [Makefile:1674: all] Error 2 make[6]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/lib' make[5]: *** [Makefile:1572: all-recursive] Error 1 make[5]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18' make[4]: *** [Makefile:1528: all] Error 2 make[4]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18' make[3]: *** [Makefile:29: /home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/.built] Error 2 make[3]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/tools/m4' make[2]: *** [tools/Makefile:150: tools/m4/compile] Error 2 make[2]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit' make[1]: *** [tools/Makefile:146: /home/wk/lede_AR9331_zhuotk_source_64bit/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyyyyyyyyyyyyyyyyyynyynynyyyynny] Error 2 make[1]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit' make: *** [/home/wk/lede_AR9331_zhuotk_source_64bit/include/toplevel.mk:209:world] 错误 2
最新发布
04-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值