title: I am using Spring and MyBatis for my demo project for learning MyBatis Framework. I am repeatedly getting CLASS NOT FOUND Exception
body: <p>I am getting Class not Found Exception Repeatedly.</p>
  
  <pre><code>Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error registering typeAlias for 'Emp'. Cause: java.lang.ClassNotFoundException: Cannot find class: classpath*:com.attinad.model.Employee
  </code></pre>
  
  <p>My myBatis-config.xml file is given below:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE configuration
      PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
      "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;
  
   &lt;configuration&gt;
    &lt;typeAliases&gt;&lt;typeAlias type="classpath*:com.attinad.model.Employee" alias="Emp"/&gt;&lt;/typeAliases&gt;
  
   &lt;mappers&gt;
          &lt;mapper resource="classpath:com/attinad/mappers/EmployeeMapper.xml" /&gt;
   &lt;/mappers&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And the ds-config.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt;
   &lt;beans &gt;
      &lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName" value="java:comp/env/jdbc/corpds"/&gt;
      &lt;/bean&gt;
      &lt;bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
       &lt;/bean&gt;
  
              &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
              &lt;property name="dataSource" ref="dataSource" /&gt;             
              &lt;property name="typeAliasesPackage" value="classpath*:com/attinad/model/*"/&gt;        
              &lt;property name="configLocation" value="classpath:myBatis-config.xml" /&gt;
              &lt;property name="mapperLocations" value="classpath*:com/attinad/mappers/*.xml" /&gt;
       &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>My mapper file EmployeeMapper.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE mapper
  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;
  
  
  &lt;mapper namespace="com.attinad.dao.EmployeeMapperInterface"&gt;
  &lt;resultMap type="Emp" id="EmpResult"&gt;
      &lt;id property="id" column="id"/&gt;
      &lt;result property="createdAt" column="createdAt"/&gt;
      &lt;result property="department" column="department"/&gt;
      &lt;result property="displayName" column="displayName"/&gt;
      &lt;result property="emailId" column="emailId"/&gt;
      &lt;result property="isEnable" column="isEnable"/&gt;
      &lt;result property="name" column="name"/&gt;
      &lt;result property="updatedAt" column="updatedAt"/&gt;
  &lt;/resultMap&gt;
  
  &lt;select id="getEmployeeWithId" parameterType="Long" resultMap="EmpResult"&gt; 
          select *  from
          employees where
          id=#{empId}
  
      &lt;/select&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>This is my dao class:</p>
  
  <pre><code>package com.attinad.dao;
  
  import java.util.*;
  import com.attinad.model.*;
  public interface EmployeeMapperInterface extends BaseMapperInterface{
      public List&lt;Employee&gt; getEmployeeWithId(long id);
      public int insertEmployee(Employee e);
      public int updateEmployee(Employee e);
      public void deleteEmployee(int id);
  
  }
  </code></pre>
  
  <p>And my service class:</p>
  
  <pre><code>package com.attinad.service;
  
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  
  import com.attinad.dao.EmployeeMapperInterface;
  import com.attinad.model.Employee;
  
  
      @Service
      public class EmployeeService implements EmployeeBaseService{
  
          @Autowired
          EmployeeMapperInterface employeeMapper;
  
           @Override    
           public Employee getEmployeeById(long empId){
  
              List&lt;Employee&gt; empList = employeeMapper.getEmployeeWithId(empId);
              if(empList != null &amp;&amp; empList.size()&gt;0){
                  //System.out.println("List accumulated");
                  System.out.println(empList);
                  return (Employee) empList.get(0);
  
              }
              return null;
  
          }
  }
  </code></pre>
  
  <p>Eclipse build path:src/main/java is included in the Java Build Path and my packages are under this classpath.</p>
  
  <p>Please help me with this error. I can't figure out the actual cause. When I removed the resultMap and made it ResultType="hashMap", it worked. But now if I try doing that, I am getting ClassNotFound for other classes.</p>