猿问

报错求解决MYbaits

### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: 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 'Messageresult'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Messageresult

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)

at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:54)

at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:38)

at com.gjh.db.DbAcess.getSqlSession(DbAcess.java:19)

at com.gjh.dao.MessageDao.queryMessageList(MessageDao.java:21)

at com.gjh.service.ListService.queryMessageList(ListService.java:11)

at com.gjh.servlet.ListServlet.doGet(ListServlet.java:31)

at com.gjh.servlet.ListServlet.doPost(ListServlet.java:39)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper

    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"

    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">


<mapper namespace="Message">


  <resultMap type="com.gjh.bean.Message" id="Messageresult">

    <id column="id" jdbcType="INTEGER" property="id"/>

    <result column="command" jdbcType="VARCHAR" property="command"/>

    <result column="description" jdbcType="VARCHAR" property="description"/>

    <result column="content" jdbcType="VARCHAR" property="content"/>

  </resultMap>


    <select id="queryMessage" parameterType="com.gjh.bean.Message" resultType="Messageresult" >

    SELECT  id,  command, description, content FROM message 

<where>

    <if test="command != null and !&quot;&quot;.equals(command.trim())">

    and command=#{command}

   </if>

   <if test="description != null and !&quot;&quot;.equals(description.trim())">

    and description like '%' #{description} '%'

   </if>

    </where>

  </select>

</mapper>


qq_画个圈圈诅咒你_03164602
浏览 3957回答 3
3回答

qq_画个圈圈诅咒你_03164602

发现错误了,resultmap弄成resultype了

慕瓜4807886

不就是报Could not resolve type alias 'Messageresult'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Messageresult找不到类嘛,仔细检查一下名字和路径
随时随地看视频慕课网APP

相关分类

Java
WebApp
我要回答