0

I made a boardContentMap in clubMapper.xml, but I don't know why they can't find it.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\workspace_springProject.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\controller\WEB-INF\classes\mappers\clubMapper.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 'boardContentMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: boardContentMap

clubMapper.xml

<?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="com.joinus.mapper.ClubMapper">


<resultMap type="MembersVo" id="membersMap">
   <id property="member_no" column="member_no"/>
   <id property="member_email" column="member_email"/>
   <id property="member_pass" column="member_pass"/>
   <id property="member_name" column="member_name"/>
   <id property="member_tel" column="member_tel"/>
   <id property="member_image" column="member_image"/>
   <id property="member_regdate" column="member_regdate"/>
   <id property="member_updatedate" column="member_updatedate"/>
   <id property="member_authority" column="member_authority"/>
   <id property="member_signup_type" column="member_signup_type"/>
   <id property="member_status" column="member_status"/>
</resultMap>

<resultMap type="ClubsVo" id="clubsMap">
   <id property="club_no" column="club_no"/>
   <id property="club_name" column="club_name"/>
   <id property="club_capacity" column="club_capacity"/>
   <id property="club_content" column="club_content"/>
   <id property="club_image" column="club_image"/>
   <id property="club_regdate" column="club_regdate"/>
</resultMap>

<resultMap type="ClubBoardsVo" id="clubBoardsMap">
    <id property="club_board_no" column="club_board_no"/>
    <id property="club_no" column="club_no"/>
    <id property="board_type_no" column="board_type_no"/>
    <id property="member_no" column="member_no"/>
    <id property="club_board_title" column="club_board_title"/>
    <id property="club_board_content" column="club_board_content"/>
    <id property="club_board_image" column="club_board_image"/>
    <id property="club_board_date" column="club_board_date"/>
    <id property="club_board_updatedate" column="club_board_updatedate"/>
    <id property="club_board_like" column="club_board_like"/>
    <id property="club_board_commentcnt" column="club_board_commentcnt"/>
</resultMap>

<resultMap type="BoardTotalBean" id="boardListMap">
    <collection property="membersVo" resultMap="membersMap"/>
    <collection property="clubBoardsVo" resultMap="clubBoardsMap" />
</resultMap>

<resultMap type="BoardTotalBean" id="boardContentMap">
    <collection property="clubBoardsVo" resultMap="clubBoardsMap"></collection>
    <collection property="clubsVo" resultMap="clubsMap"></collection>
    <collection property="membersVo" resultMap="membersMap"></collection>
</resultMap>


<select id="getBoardList" resultMap="boardListMap">
    select b.club_board_no, m.member_name, m.member_image, b.club_board_title, b.club_board_content, b.club_board_image, b.club_board_date, b.club_board_updatedate, b.club_board_like, b.club_board_commentcnt
    from club_boards b
    join members m
        on (b.member_no = m.member_no)
    where b.club_no = #{club_no} and b.board_type_no = #{board_type_no}
    order by club_board_no desc
</select>


<select id="getBoardContent" resultType="boardContentMap">
    select c.club_name, b.board_type_no, m.member_name, m.member_image, b.club_board_title, b.club_board_content, b.club_board_image, b.club_board_date, b.club_board_updatedate 
    from club_boards b
    join clubs c
        on (b.club_no = c.club_no)
    join members m
        on (b.member_no = m.member_no)
    where club_board_no = #{club_board_no}
</select>


</mapper> 

BoardTotalBean.java

package com.joinus.domain;

import lombok.Data;

@Data
public class BoardTotalBean {

private MembersVo membersVo;
private ClubBoardsVo clubBoardsVo;
private ClubsVo clubsVo;

}
2
  • I think that should be resultMap="boardContentMap" Commented Jul 8, 2022 at 13:34
  • Oh my god!! Thank you so much. Why did I miss this? Thank you!!!!!!!!!! Commented Jul 8, 2022 at 13:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.