老师我在运行Dao junit测试时报错 没有找到具体原因
来源:2-7 验证Dao
weixin_慕九州3551998
2020-01-18
/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 “-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=49500:/Applications/IntelliJ IDEA.app/Contents/bin” -Dfile.encoding=UTF-8 -classpath “/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/tools.jar:/Users/qiaojingwen/IdeaProjects/o2o/target/test-classes:/Users/qiaojingwen/IdeaProjects/o2o/target/classes:/Users/qiaojingwen/maven/respository/junit/junit/4.12/junit-4.12.jar:/Users/qiaojingwen/maven/respository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/qiaojingwen/maven/respository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/qiaojingwen/maven/respository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/qiaojingwen/maven/respository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-core/4.3.7.RELEASE/spring-core-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-beans/4.3.7.RELEASE/spring-beans-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-context/4.3.7.RELEASE/spring-context-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-aop/4.3.7.RELEASE/spring-aop-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-expression/4.3.7.RELEASE/spring-expression-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-jdbc/4.3.7.RELEASE/spring-jdbc-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-tx/4.3.7.RELEASE/spring-tx-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-web/4.3.7.RELEASE/spring-web-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-webmvc/4.3.7.RELEASE/spring-webmvc-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/org/springframework/spring-test/4.3.7.RELEASE/spring-test-4.3.7.RELEASE.jar:/Users/qiaojingwen/maven/respository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar:/Users/qiaojingwen/maven/respository/com/fasterxml/jackson/core/jackson-databind/2.8.7/jackson-databind-2.8.7.jar:/Users/qiaojingwen/maven/respository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/qiaojingwen/maven/respository/com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.jar:/Users/qiaojingwen/maven/respository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar:/Users/qiaojingwen/maven/respository/org/mybatis/mybatis/3.4.2/mybatis-3.4.2.jar:/Users/qiaojingwen/maven/respository/org/mybatis/mybatis-spring/1.3.1/mybatis-spring-1.3.1.jar:/Users/qiaojingwen/maven/respository/mysql/mysql-connector-java/5.1.37/mysql-connector-java-5.1.37.jar:/Users/qiaojingwen/maven/respository/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2.jar” com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.imooc.o2o.dao.AreaDaoTest
一月 18, 2020 11:22:57 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: Loaded default TestExecutionListener class names from location [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]
一月 18, 2020 11:22:57 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@13fee20c, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4e04a765, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@783e6358, org.springframework.test.context.support.DirtiesContextTestExecutionListener@17550481, org.springframework.test.context.transaction.TransactionalTestExecutionListener@735f7ae5, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@180bc464]
一月 18, 2020 11:22:57 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]
一月 18, 2020 11:22:57 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]
一月 18, 2020 11:22:57 下午 org.springframework.context.support.GenericApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.GenericApplicationContext@735b5592: startup date [Sat Jan 18 23:22:57 CST 2020]; root of context hierarchy
一月 18, 2020 11:22:57 下午 com.mchange.v2.log.MLog
信息: MLog clients using java 1.4+ standard logging.
一月 18, 2020 11:22:58 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
23:22:58.464 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using ‘class org.apache.ibatis.logging.slf4j.Slf4jImpl’ adapter.
23:22:58.605 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VFS
23:22:58.605 [main] DEBUG org.apache.ibatis.io.JBoss6VFS - JBoss 6 VFS API is not available in this environment.
23:22:58.606 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VirtualFile
23:22:58.606 [main] DEBUG org.apache.ibatis.io.VFS - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
23:22:58.607 [main] DEBUG org.apache.ibatis.io.VFS - Using VFS adapter org.apache.ibatis.io.DefaultVFS
23:22:58.608 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
23:22:58.608 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
23:22:58.701 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: Area.class
23:22:58.701 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: HeadLine.class
23:22:58.701 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: LocalAuth.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: PersonInfo.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ProductCategory.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: Shop.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ShopCategory.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: WechatAuth.class
23:22:58.702 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Listing file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
23:22:58.703 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Area.class
23:22:58.703 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Area.class
23:22:58.703 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�3
23:22:58.704 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/HeadLine.class
23:22:58.704 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/HeadLine.class
23:22:58.705 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�D
23:22:58.706 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/LocalAuth.class
23:22:58.706 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/LocalAuth.class
23:22:58.707 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�:
23:22:58.707 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/PersonInfo.class
23:22:58.707 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/PersonInfo.class
23:22:58.709 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�J
23:22:58.709 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ProductCategory.class
23:22:58.709 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ProductCategory.class
23:22:58.710 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�5
23:22:58.710 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Shop.class
23:22:58.710 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Shop.class
23:22:58.711 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�k
23:22:58.711 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ShopCategory.class
23:22:58.711 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ShopCategory.class
23:22:58.712 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�F
23:22:58.712 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/WechatAuth.class
23:22:58.713 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/WechatAuth.class
23:22:58.713 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: �������3�0
23:22:58.714 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.Area matches criteria [is assignable to Object]
23:22:58.715 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.HeadLine matches criteria [is assignable to Object]
23:22:58.715 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.LocalAuth matches criteria [is assignable to Object]
23:22:58.716 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.PersonInfo matches criteria [is assignable to Object]
23:22:58.716 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.ProductCategory matches criteria [is assignable to Object]
23:22:58.716 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.Shop matches criteria [is assignable to Object]
23:22:58.717 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.ShopCategory matches criteria [is assignable to Object]
23:22:58.717 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.WechatAuth matches criteria [is assignable to Object]
23:22:58.718 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Scanned package: ‘com.imooc.o2o.entity’ for aliases
一月 18, 2020 11:22:58 下午 org.springframework.context.support.GenericApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
一月 18, 2020 11:22:58 下午 org.springframework.test.context.TestContextManager prepareTestInstance
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@783e6358] to prepare test instance [com.imooc.o2o.dao.AreaDaoTest@957e06]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner2.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.junit.runner.JUnitCore.run(JUnitCore.java:137)atcom.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)atcom.intellij.rt.execution.junit.IdeaTestRunner2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner2.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.junit.runner.JUnitCore.run(JUnitCore.java:137)atcom.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)atcom.intellij.rt.execution.junit.IdeaTestRunnerRepeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
… 24 more
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:500)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
… 39 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:120)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:494)
… 42 more
Caused by: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.settingsAsProperties(XMLConfigBuilder.java:133)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106)
… 44 more
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
… 24 more
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:500)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
… 39 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:120)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:494)
… 42 more
Caused by: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known. Make sure you spelled it correctly (case sensitive).
at org.apache.ibatis.builder.xml.XMLConfigBuilder.settingsAsProperties(XMLConfigBuilder.java:133)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106)
… 44 more
Process finished with exit code 255
1回答
-
翔仔
2020-01-19
同学好,异常非常明显
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting useGneratedKeys is not known.
说的是[mybatis-config.xml]里面的useGneratedKeys这个属性不存在 应该是
useGeneratedKeys吧?
022020-01-19
相似问题