做Maven项目时出现的错误,菜鸟求助

[复制链接]
查看11 | 回复10 | 2021-1-27 07:15:45 | 显示全部楼层 |阅读模式
错误如下,帮我看看是哪里出现了错误
三月06,20189:31:23上午org.springframework.test.context.support.DefaultTestContextBootstrappergetDefaultTestExecutionListenerClassNames
信息:LoadeddefaultTestExecutionListenerclassnamesfromlocation[META-INF/spring.factories]:[org.springframework.test.context.web.ServletTestExecutionListener,org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener,org.springframework.test.context.support.DependencyInjectionTestExecutionListener,org.springframework.test.context.support.DirtiesContextTestExecutionListener,org.springframework.test.context.transaction.TransactionalTestExecutionListener,org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
三月06,20189:31:23上午org.springframework.test.context.support.DefaultTestContextBootstrappergetTestExecutionListeners
信息:UsingTestExecutionListeners:[org.springframework.test.context.web.ServletTestExecutionListener@2ef9b8bc,org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@5d624da6,org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1e67b872,org.springframework.test.context.support.DirtiesContextTestExecutionListener@60addb54,org.springframework.test.context.transaction.TransactionalTestExecutionListener@3f2a3a5,org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@4cb2c100]
三月06,20189:31:23上午org.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitions
信息:LoadingXMLbeandefinitionsfromclasspathresource[spring/spring-dao.xml]
三月06,20189:31:23上午org.springframework.context.support.GenericApplicationContextprepareRefresh
信息:Refreshingorg.springframework.context.support.GenericApplicationContext@4520ebad:startupdate[TueMar0609:31:23CST2018];rootofcontexthierarchy
三月06,20189:31:23上午org.springframework.context.support.GenericApplicationContextrefresh
警告:Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.mybatis.spring.mapper.MapperScannerConfigurer#0'definedinclasspathresource[spring/spring-dao.xml]:Initializationofbeanfailed;nestedexceptionisjava.lang.NoClassDefFoundError:org/apache/ibatis/session/SqlSession
三月06,20189:31:23上午org.springframework.test.context.TestContextManagerprepareTestInstance
严重:CaughtexceptionwhileallowingTestExecutionListener[org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1e67b872]topreparetestinstance[com.imooc.o2o.dao.AreaDaoTest@7f9fcf7f]
java.lang.IllegalStateException:FailedtoloadApplicationContext
atorg.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
atorg.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
atorg.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
atorg.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
atorg.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
atorg.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
atorg.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
atorg.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
atorg.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
atorg.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
atorg.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
atorg.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
atorg.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
atorg.junit.runners.ParentRunner.run(ParentRunner.java:363)
atorg.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
atorg.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
atorg.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.mybatis.spring.mapper.MapperScannerConfigurer#0'definedinclasspathresource[spring/spring-dao.xml]:Initializationofbeanfailed;nestedexceptionisjava.lang.NoClassDefFoundError:org/apache/ibatis/session/SqlSession
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
atorg.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115)
atorg.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
atorg.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)
atorg.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
atorg.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)
atorg.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)
atorg.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
atorg.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
...25more

分 -->
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
严重:CaughtexceptionwhileallowingTestExecutionListener[org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1e67b872]topreparetestinstance[com.imooc.o2o.dao.AreaDaoTest@7f9fcf7f]
java.lang.IllegalStateException:FailedtoloadApplicationContext
你的监听类未能加载成功。这个属于逻辑代码问题你看下你的逻辑代码是否出现问题
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
警告:Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.mybatis.spring.mapper.MapperScannerConfigurer#0'definedinclasspathresource[spring/spring-dao.xml]:Initializationofbeanfailed;nestedexceptionisjava.lang.NoClassDefFoundError:org/apache/ibatis/session/SqlSession
创建名字为MapperScannerConfigurer#0的bean失败这个查看下你的配置文件是否配置错误
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
引用2楼xiongdejun的回复:警告:Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.mybatis.spring.mapper.MapperScannerConfigurer#0'definedinclasspathresource[spring/spring-dao.xml]:Initializationofbeanfailed;nestedexceptionisjava.lang.NoClassDefFoundError:org/apache/ibatis/session/SqlSession
创建名字为MapperScannerConfigurer#0的bean失败这个查看下你的配置文件是否配置错误

spring-dao.xml文件如下



























回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
spring-service.xml文件如下:










spring-web.xml文件如下:











回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
Maven项目包如下:


搜了很久也不清楚问题出在哪里,希望大家帮我看看。。可以加分


回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
引用3楼sunknight1213的回复:Quote: 引用2楼xiongdejun的回复:
警告:Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.mybatis.spring.mapper.MapperScannerConfigurer#0'definedinclasspathresource[spring/spring-dao.xml]:Initializationofbeanfailed;nestedexceptionisjava.lang.NoClassDefFoundError:org/apache/ibatis/session/SqlSession
创建名字为MapperScannerConfigurer#0的bean失败这个查看下你的配置文件是否配置错误

spring-dao.xml文件如下



























把去掉,因为你就一个数据库连接方式Spring会自动装配你试下这样子还会不会报错
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
引用把去掉,因为你就一个数据库连接方式Spring会自动装配你试下这样子还会不会报错
还是报错
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
引用7楼sunknight1213的回复:引用把去掉,因为你就一个数据库连接方式Spring会自动装配你试下这样子还会不会报错
还是报错

还是一样的报错吗
回复

使用道具 举报

千问 | 2021-1-27 07:15:45 | 显示全部楼层
引用8楼xiongdejun的回复:Quote: 引用7楼sunknight1213的回复:
引用把去掉,因为你就一个数据库连接方式Spring会自动装配你试下这样子还会不会报错
还是报错

还是一样的报错吗

是的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行