title: ClassNotFound while using myBatis config
body: <p>I am trying to connect to DB2 using mybatis. My problem is, mybatis-config is not able to find my class file for the data type I am using.</p>
  
  <p>ClientMapper.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='Client'&gt; 
      &lt;select id='getNumber' parameterType='String'
          resultType='org.TE1.Client'&gt;
          SELECT
          number AS phone
          FROM client
          WHERE name = #{name}
      &lt;/select&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>ClientMapperInterface.java</p>
  
  <pre><code>package org.TE1.Mapper;
  
  public interface ClientMapperInterface {
      public String getNumber(String name);
  }
  </code></pre>
  
  <p>Client.java</p>
  
  <pre><code>package org.TE1.Client;
  
  public class Client {
      private int id;
      private String name;
      private String phone;
  
      //some getters and setters
  }
  </code></pre>
  
  <p>mybatis-config.xml</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;properties resource='jdbc.properties' /&gt;
      &lt;typeAliases&gt;
          &lt;typeAlias type='org.TE1.Client' alias='Client'&gt;&lt;/typeAlias&gt;
      &lt;/typeAliases&gt;
      &lt;environments default='development'&gt;
          &lt;environment id='development'&gt;
              &lt;transactionManager type='JDBC' /&gt;
              &lt;dataSource type='POOLED'&gt;
                  &lt;property name='driver' value='com.ibm.db2.jcc.DB2Driver' /&gt;
                  &lt;property name='url' value='jdbc:as400://localhost:50000/dir' /&gt;
                  &lt;property name='username' value='root' /&gt;
                  &lt;property name='password' value='admin' /&gt;
              &lt;/dataSource&gt;
          &lt;/environment&gt;
      &lt;/environments&gt;
      &lt;mappers&gt;
          &lt;mapper resource='org/TE1/Mapper/ClientMapper.xml' /&gt;
      &lt;/mappers&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>tester java file.</p>
  
  <pre><code>public class testGetPhone {
      public static void main(String[] args) {
          Reader reader = null;
          try {
              reader = Resources.getResourceAsReader("mybatis-config.xml");
          } catch (IOException e) {
              System.out.println("MyBatis config not found!");
              e.printStackTrace();
          }
          SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
          SqlSession session = sqlSessionFactory.openSession();
  
          int number = session.selectOne("Client.getNumber", "TEST");
          System.out.println("number:" + number);
          session.commit();
          session.close();
      }
  }
  </code></pre>
  
  <p>At first I thought there might be something wrong with how the config searches for the class file but after some tinkering I am pretty sure it does find the class file, but thinks its not the correct class file (not sure about it though). Any help?</p>