title: MyBatis cannot find mybatis-config.xml
body: <p>I'm some trouble getting MyBatis (3.4.6) working.</p>
  
  <p>I have placed my <strong>mybatis-config.xml</strong> file in the <strong>src/main/resources</strong> folder of my project but when I run a unit test I get the following error.</p>
  
  <pre><code>&gt; java.io.IOException: Could not find resource mybatis-config.xml   at
  &gt; org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:114)
  </code></pre>
  
  <p>This is the code I am using to read the XML file.</p>
  
  <pre><code>String resource = "mybatis-config.xml";
  try 
  {
      InputStream inputStream = Resources.getResourceAsStream(resource);
      sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
  
  } catch (IOException ex) {
  
      ex.printStackTrace();
  }
  </code></pre>
  
  <p>Anyone got any ideas?</p>