Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class.

WARN [localhost-startStop-1] - 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-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\java_workbase\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\fruitsystem\WEB-INF\classes\com\mpn\mapper\TPowerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'TPowerManagedtomap'.  Cause: java.lang.ClassNotFoundException: Cannot find class: TPowerManagedtomap
DEBUG [localhost-startStop-1] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@38cf0a88: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,multipartResolver,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,TCostMapper,TCultivationMapper,TDiseasesMapper,TFruittreeMapper,TIncomeMapper,TIrrigationwateMapper,TLeafinfoMapper,TMenuMapper,TNaturaldisasterMapper,TOrchardbaseinfoMapper,TParameterMapper,TPhenologicalphaseMapper,TPlantprotectionMapper,TPowerMapper,TQualityMapper,TRoleMapper,TSoilnutrientinfoMapper,TSpecialoperationMapper,TSubregionMapper,TUserMapper,TZdCultivationmanagementtypeMapper,TZdDiseasestypeMapper,TZdMainplanttypeMapper,TZdOperatetypeMapper,TZdPlantmodelMapper,TZdSprayingequipmentMapper,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory]; root of factory hierarchy
DEBUG [localhost-startStop-1] - Invoking destroy method 'close' on bean with name 'dataSource'
ERROR [localhost-startStop-1] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\java_workbase\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\fruitsystem\WEB-INF\classes\com\mpn\mapper\TPowerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'TPowerManagedtomap'.  Cause: java.lang.ClassNotFoundException: Cannot find class: TPowerManagedtomap
	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.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5110)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
 <select id="search" parameterType="com.mpn.model.TPower" resultType="TPowerManagedtomap" >
   select p*,m.menuname,r.rolename from t_power p,t_menu m,t_role r where p.roleid=r.roleid and p.menuid=m.menuid
  </select>

我的返回值类型应该是一个Map 而我写的是一个基本类型的返回值

 

因此如果返回的值是一个基本的数据类型使用的是resultType 如果是和resultMap 
匹配的,比如说是集合,map等则使用resultMap

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值