title: MyBatis Parameter Not Found
body: <p>I'm triying to calling a rest application but I get a 500 error. The problem maybe be on the MyBatis call but still can't fix it.</p>
  
  <p>This is where I call the execution of MyBatis</p>
  
  <pre><code>@Override
  public List&lt;IdentitatBDTO&gt; searchIdentitatsRepresentantsByRelacioIdentitatRepresentat(final String representatIdentificador, final Date dateFi) {
  
      List&lt;Identitat&gt; identitats = myBatisTemplate.execute(RelacioDao.class, new MyBatisDaoCallback&lt;List&lt;Identitat&gt;&gt;() {
          @Override
          public List&lt;Identitat&gt; execute(MyBatisDao dao) {
              return ((RelacioDao) dao).searchIdentitatsRepresentantsByRelacioIdentitatRepresentat(representatIdentificador, dateFi);
          }
      });
  </code></pre>
  
  <p>The error that I'm getting is</p>
  
  <pre><code>{
  "errorUrl": 
   "http://localhost:8080/idjrepresentaciorest/rest/representacio/representants/12340002L",
    "errorMessage": "\r\n### Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'representatIdentificador' not found. Available parameters are [1, 0, param1, param2]\r\n### Cause: org.apache.ibatis.binding.BindingException: Parameter 'representatIdentificador' not found. Available parameters are [1, 0, param1, param2]",
    "errorStackTrace": "org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'representatIdentificador' not found. Available parameters are [1, 0, param1, param2]\r\n### Cause: org.apache.ibatis.binding.BindingException: Parameter 'representatIdentificador' not found. Available parameters are [1, 0, param1, param2]\r\n\tat org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)\r\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)\r\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)\r\n\tat org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)\r\n\tat org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)\r\n\tat org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)\r\n\tat com.sun.proxy.$Proxy85.searchIdentitatsRepresentantsByRelacioIdentitatRepresentat(Unknown Source)\r\n\tat es.bcn.idj.representaciorest.business.impl.RelacioServiceImpl$1.execute(RelacioServiceImpl.java:61)\r\n\tat es.bcn.idj.representaciorest.business.impl.RelacioServiceImpl$1.execute(RelacioServiceImpl.java:1)\r\n\tat net.opentrends.openframe.services.persistence.mybatis.template.impl.MyBatisTemplateImpl.execute(MyBatisTemplateImpl.java:64)\r\n\tat
  </code></pre>
  
  <p>But I debugged and saw that the variable that appears to be the problem is filled correctly so why is MyBatis not founding the variable?</p>