lmy若曦 lmy若曦
关注数: 1 粉丝数: 2 发帖数: 84 关注贴吧数: 3
spring 配置文件问题 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f" xmlns:aop="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop&urlrefer=38f64d940c80f0c3bf17aabd28afbd76" xmlns:xsi="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance&urlrefer=8c31805956ebb9a7292762c26181562e" xsi:schemaLocation="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans%2Fspring-beans-2.5.xsd&urlrefer=a5ad0ad63bffbdde1ad640fab45428c8 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop&urlrefer=38f64d940c80f0c3bf17aabd28afbd76 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop%2Fspring-aop-2.5.xsd&urlrefer=484701958736420a407fe78f86a6a026"> <!-- Root Context: defines shared resources visible to all other web components --> <bean id="dao" class="test.spring.dao.impl.UserDaoImpl"/> <bean id="service" class="test.spring.service.impl.UserServiceImpl"> <property name="dao" ref="dao"/> </bean> <bean id="userAction" class="test.spring.action.UserAction"> <property name="service" ref="service"/> </bean> <bean id="logAspectJ" class="test.spring.aop.LogAspectJ"/> <aop:config> <aop:aspect id= "logaop" ref="logAspectJ"> <aop:pointcut id="logpointcut" expression="execution(* test.spring.action.UserAction.*(..))"/> <aop:before pointcut-ref="logpointcut" method="myBeforeAdvice"/> <aop:after-returning pointcut-ref="logpointcut" method="myAfterReturningAdvice"/> <aop:after-throwing pointcut-ref="logpointcut" method="myAfterThrowingAdvice" throwing="e"/> <aop:after pointcut-ref="logpointcut" method="myAfterAdvice"/> <aop:around pointcut-ref="logpointcut" method="myAroundAdvice"/> </aop:aspect> </aop:config> </beans> 错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in file [E:\Eclipse_workplace\AOP2\src\main\webapp\WEB-INF\spring\root-context.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'logpointcut' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logpointcut': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException 什么意思啊,,,,求大神啊
spring配置文件错误,这个是什么意思? 配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f" xmlns:aop="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop&urlrefer=38f64d940c80f0c3bf17aabd28afbd76" xmlns:xsi="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance&urlrefer=8c31805956ebb9a7292762c26181562e" xsi:schemaLocation="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans%2Fspring-beans-2.5.xsd&urlrefer=a5ad0ad63bffbdde1ad640fab45428c8 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop&urlrefer=38f64d940c80f0c3bf17aabd28afbd76 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop%2Fspring-aop-2.5.xsd&urlrefer=484701958736420a407fe78f86a6a026"> <!-- Root Context: defines shared resources visible to all other web components --> <bean id="dao" class="test.spring.dao.impl.UserDaoImpl"/> <bean id="service" class="test.spring.service.impl.UserServiceImpl"> <property name="dao" ref="dao"/> </bean> <bean id="userAction" class="test.spring.action.UserAction"> <property name="service" ref="service"/> </bean> <bean id="logAspectJ" class="test.spring.aop.LogAspectJ"/> <aop:config> <aop:aspect id= "logaop" ref="logAspectJ"> <aop:pointcut id="logpointcut" expression="execution(* test.spring.action.UserAction.*(..))"/> <aop:before pointcut-ref="logpointcut" method="myBeforeAdvice"/> <aop:after-returning pointcut-ref="logpointcut" method="myAfterReturningAdvice"/> <aop:after-throwing pointcut-ref="logpointcut" method="myAfterThrowingAdvice" throwing="e"/> <aop:after pointcut-ref="logpointcut" method="myAfterAdvice"/> <aop:around pointcut-ref="logpointcut" method="myAroundAdvice"/> </aop:aspect> </aop:config> </beans> 错误信息如下: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [E:/Eclipse_workplace/AOP2/src/main/webapp/WEB-INF/spring/root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [E:/Eclipse_workplace/AOP2/src/main/webapp/WEB-INF/spring/root-context.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
配置文件 <?xml version="1.0" encoding="GBK"?> <beans:beans xmlns="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fmvc&urlrefer=643390e06e7289de1b066d23aefde159" xmlns:xsi="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance&urlrefer=8c31805956ebb9a7292762c26181562e" xmlns:beans="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f" xmlns:context="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext&urlrefer=eda4949cc9c44315ba915f719c8a3685" xsi:schemaLocation="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fmvc&urlrefer=643390e06e7289de1b066d23aefde159 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fmvc%2Fspring-mvc-3.0.xsd&urlrefer=0a09b061560d02d8942657dacb0f0f1c http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans&urlrefer=2cfe664a6b89a7a8c06b489461ff152f http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans%2Fspring-beans-3.0.xsd&urlrefer=17c65d54ecb3a22f4f62d71a52fbb9c0 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext&urlrefer=eda4949cc9c44315ba915f719c8a3685 http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext%2Fspring-context-3.0.xsd&urlrefer=523106865db937625592efd7b5e799da"> <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --> <!-- Enables the Spring MVC @Controller programming model --> <annotation-driven /> <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --> <resources mapping="/resources/**" location="/resources/" /> <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory --> <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <beans:property name="prefix" value="/WEB-INF/views/" /> <beans:property name="suffix" value=".jsp" /> </beans:bean> <context:component-scan base-package="com.edu.controller" /> </beans:beans> spring mvc项目里面的<resources mapping="/resources/**" location="/resources/" /> 这句是用来干什么的/?
1 下一页