本人在学习myBatis时遇到了一个错误,求各位大佬帮助!

org.apache.ibatis.exceptions.PersistenceException: 
###构建SqlSession时出错。
###该错误可能存在于mapper.xml中
###处理mapper_resultMap [userMap]
###时发生错误原因:org.apache.ibatis.builder.BuilderException:解析SQL映射器配置时出错。原因:org.apache.ibatis.builder.BuilderException:解析Mapper XML错误。原因:org.apache.ibatis.builder.BuilderException:解析类时出错。原因:org.apache.ibatis.type.TypeException:无法解析类型别名'User'。原因:java.lang.ClassNotFoundException:在org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:82
找不到类org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)

at
sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at cn.itcast.myBatis.UserDaoTest.setUp(UserDaoTest.java:26)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:66)at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:606)
在org.junit。 runners.model.FrameworkMethod $ 1.runReflectiveCall(FrameworkMethod.java:45)
位于org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod的.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner .java:68)
at org.junit.runners.ParentRunner
$ 3.run(ParentRunner.java:231)
org.junit.runners.ParentRunner $ 1 org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:47)
在org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
上的日程安排(ParentRunner.java:60)在org.junit.runners.ParentRunner.access $ 000(ParentRunner.java:50)
在org.junit.runners。 ParentRunner $ 2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse .jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
在org.eclipse.jdt.internal
在org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)上的.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:382)
原因:org.apache.ibatis.builder.BuilderException:解析SQL映射器配置时出错。原因:org.apache.ibatis.builder.BuilderException:解析Mapper XML错误。原因:org.apache.ibatis.builder.BuilderException:解析类时出错。原因:org.apache.ibatis.type.TypeException:无法解析类型别名'User'。原因:抛出java.lang.ClassNotFoundException:找不到类:用户
在org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:109)
在org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder .java:92)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
... 25 more
原因:org.apache.ibatis.builder.BuilderException:解析Mapper XML错误。原因:org.apache.ibatis.builder.BuilderException:解析类时出错。原因:org.apache.ibatis.type.TypeException:无法解析类型别名'User'。原因:java.lang.ClassNotFoundException:找不到类:User
org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder .java:92)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:322)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:107)
...另有27个
造成者:org.apache.ibatis.builder.BuilderException:错误解析类。原因:org.apache.ibatis.type.TypeException:无法解析类型别名'User'。原因:java.lang.ClassNotFoundException:无法找到类:用户
org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:103)
在org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java :264),
位于org.apache的org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:243)
处的org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:251)
。 ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116)
... 30更多
引起:org.apache.ibatis.type.TypeException:无法解析类型别名'用户'。原因:java.lang.ClassNotFoundException:无法找到类:用户
org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:117)
在org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:130 )
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:101)
... 34更多
原因:java.lang.ClassNotFoundException:
在org.apache.ibatis.io.ClassLoaderWrapper 找不到类:User 在org.apache.ibatis.io.Resources.classForName(Resources.java:256)
处的org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)
处使用classFormat(ClassLoaderWrapper.java:190
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:113)
... 36 more

你可能感兴趣的:(在线交流)