首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Junit测试报错解决方案

2013-09-11 
Junit测试报错使用junit测试报错求解决java.lang.IllegalStateException: Failed to load ApplicationCont

Junit测试报错
使用junit测试报错求解决
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activateTablesService': Injection of autowired dependencies failed; 

nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.ActivateTablesService.budgeteeringTableService; nested 

exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableService': Injection of autowired dependencies 

failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService.budgeteeringTableRecService; 

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableRecService': Injection of autowired 

dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.ActivateTablesService.budgeteeringTableService; nested 

exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableService': Injection of autowired dependencies 

failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService.budgeteeringTableRecService; 

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableRecService': Injection of autowired 

dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject

(AutowiredAnnotationBeanPostProcessor.java:502)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableService': Injection of autowired dependencies 

failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService.budgeteeringTableRecService; 



nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableRecService': Injection of autowired 

dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService.budgeteeringTableRecService; 

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableRecService': Injection of autowired 

dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject

(AutowiredAnnotationBeanPostProcessor.java:502)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
... 51 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'budgeteeringTableRecService': Injection of autowired dependencies 

failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

... 53 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private 

com.supporter.prj.bm.budgeteering.service.BudgeteeringTableService com.supporter.prj.bm.budgeteering.service.BudgeteeringTableRecService.budgeteeringTableService; 

nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject

(AutowiredAnnotationBeanPostProcessor.java:502)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
... 64 more
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V



[解决办法]
加载Spring文件失败?

把你这个Junit方法贴下呗。
[解决办法]
注入失败啊,你用的是自动扫描注解?

热点排行