Mybatis-Spring Java Configuration @MapperScan Annotation
<p>I am trying to set up my mybatis-spring like shown in the following examples:</p>

<p>1)Code from a previous answer on stackoverflow, a few answer down
(<a href="https://stackoverflow.com/questions/8999597/mybatis-spring-configuration-cant-autowire-mapper-beans">MyBatis-Spring + @Configuration - Can&#39;t autowire mapper beans</a>)</p>

<pre><code>@Configuration 
@MapperScan("org.mybatis.spring.sample.mapper") 
public class AppConfig 
{   
    @Bean   
    public DataSource dataSource() 
    {     
      return new EmbeddedDatabaseBuilder().addScript("schema.sql").build();   
    }   
   @Bean   
   public DataSourceTransactionManager transactionManager() 
   {     
        return new DataSourceTransactionManager(dataSource());   
   }   
   @Bean   
   public SqlSessionFactory sqlSessionFactory() throws Exception 
   {     
       SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
       sessionFactory.setDataSource(dataSource());    
       return sessionFactory.getObject();   
   } 
}
</code></pre>

<p>2)Code from their documentation (<a href="http://www.mybatis.org/spring/mappers.html" rel="nofollow noreferrer">http://www.mybatis.org/spring/mappers.html</a>)</p>

<p>Usage:</p>

<pre><code>public class FooServiceImpl implements FooService {

  private UserMapper userMapper;

  public void setUserMapper(UserMapper userMapper) {
    this.userMapper = userMapper;
  }

  public User doSomeBusinessStuff(String userId) {
    return this.userMapper.getUser(userId);
  }
}
</code></pre>

<p>Registering Mapper with @MapperScan:</p>

<pre><code>@Configuration
@MapperScan("org.mybatis.spring.sample.mapper")
public class AppConfig {

  @Bean
  public DataSource dataSource() {
    return new EmbeddedDatabaseBuilder().addScript("schema.sql").build()
  }

  @Bean
  public SqlSessionFactory sqlSessionFactory() throws Exception {
    SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
    sessionFactory.setDataSource(dataSource());
    return sessionFactory.getObject();
  }
}
</code></pre>

<p>My code which isn't working is as shown below:</p>

<p>My Application with nested AppConfig:</p>

<pre><code>@SpringBootApplication
@MapperScan(basePackages="com.tjwhalen.game.service.dao")
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    //@MapperScan(basePackages="com.tjwhalen.game.service.dao")
    public class AppConfig {

        @Autowired
        DataSource datasource;

        @Bean
        public DataSourceTransactionManager transactionManager() {
            return new DataSourceTransactionManager(datasource);
        }

        @Bean
        public SqlSessionFactory sqlSessionFactory() throws Exception {
            SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
            sqlSessionFactory.setDataSource(datasource);
            //sqlSessionFactory.setTypeAliasesPackage("com.tjwhalen.game.model");
            return (SqlSessionFactory) sqlSessionFactory.getObject();
        }

        @Bean
        public ItemSummaryDbService itemSummaryDbService() {
            return new ItemSummaryDbServiceImpl();
        }
    }
}
</code></pre>

<p>My service:</p>

<pre><code>public class ItemSummaryDbServiceImpl implements ItemSummaryDbService {

    @Autowired
    private ItemSummaryMapper itemSummaryMapper;

    public void setItemSummaryMapper(ItemSummaryMapper itemSummaryMapper) {
        this.itemSummaryMapper = itemSummaryMapper;
    }

    public void writeItemSummarys(List&lt;ItemSummary&gt; itemSummarys) {

        for(ItemSummary itemSummary : itemSummarys) {
            itemSummaryMapper.insertItemSummary(itemSummary);
        }
    }

    public List&lt;ItemSummary&gt; lookupItemSummarys() {
        return itemSummaryMapper.selectItemSummarys();
    }
}
</code></pre>

<p>My mapper in the package indicated by the @MapperScan annotaion:</p>

<pre><code>package com.tjwhalen.game.service.dao;

import java.util.List;

import com.tjwhalen.game.model.ItemSummary;

public interface ItemSummaryMapper {

    public void insertItemSummary(ItemSummary itemSummary);
    public List&lt;ItemSummary&gt; selectItemSummarys();
}
</code></pre>

<p>My usage:</p>

<pre><code>public class LoadItems implements CommandLineRunner {

    private final static Logger logger = LoggerFactory.getLogger(LoadItems.class);

    @Autowired
    private ItemSummaryDbService service;

    public void run(String... arg0) throws Exception {
        logger.info("LoadItems is running");

        ArrayList&lt;ItemSummary&gt; list = new ArrayList&lt;ItemSummary&gt;();
        list.add(new ItemSummary(1, "one", 1));
        service.writeItemSummarys(list);

    }
}
</code></pre>

<p>My stacktrace:</p>

<pre><code>java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransactionFactory.newTransaction(Ljava/sql/Connection;Z)Lorg/apache/ibatis/transaction/Transaction;
    at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:77) ~[ibatis-core-3.0.jar:na]
    at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:40) ~[ibatis-core-3.0.jar:na]
    at org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:102) ~[mybatis-spring-1.3.0.jar:1.3.0]
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:429) ~[mybatis-spring-1.3.0.jar:1.3.0]
    at com.sun.proxy.$Proxy41.insert(Unknown Source) ~[na:na]
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279) ~[mybatis-spring-1.3.0.jar:1.3.0]
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:54) ~[ibatis-core-3.0.jar:na]
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35) ~[ibatis-core-3.0.jar:na]
    at com.sun.proxy.$Proxy42.insertItemSummary(Unknown Source) ~[na:na]
    at com.tjwhalen.game.service.impl.ItemSummaryDbServiceImpl.writeItemSummarys(ItemSummaryDbServiceImpl.java:32) ~[classes/:na]
    at com.tjwhalen.game.loader.LoadItems.run(LoadItems.java:28) ~[classes/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:782) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:769) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    at com.tjwhalen.game.Application.main(Application.java:37) [classes/:na]
</code></pre>

<p>And finally my pom.xml:</p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
     &lt;groupId&gt;com.tjwhalen.game&lt;/groupId&gt;
     &lt;artifactId&gt;Runescape-App&lt;/artifactId&gt;
     &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;


    &lt;properties&gt;
        &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;/properties&gt;

    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;1.4.0.RELEASE&lt;/version&gt;
    &lt;/parent&gt;

    &lt;dependencies&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.springframework/spring-web --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
        &lt;/dependency&gt;

        &lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
            &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/postgresql/postgresql --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;postgresql&lt;/groupId&gt;
            &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
            &lt;version&gt;8.4-702.jdbc4&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
            &lt;artifactId&gt;mybatis-spring&lt;/artifactId&gt;
            &lt;version&gt;1.3.0&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.apache.ibatis/ibatis-core --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.ibatis&lt;/groupId&gt;
            &lt;artifactId&gt;ibatis-core&lt;/artifactId&gt;
            &lt;version&gt;3.0&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.springframework/spring-test --&gt;
        &lt;!-- &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
            &lt;version&gt;4.3.2.RELEASE&lt;/version&gt;
        &lt;/dependency&gt; --&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;!-- https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
            &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
        &lt;/dependency&gt;

        &lt;!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
            &lt;artifactId&gt;mybatis&lt;/artifactId&gt;
            &lt;version&gt;3.4.0&lt;/version&gt;
        &lt;/dependency&gt;

&lt;!-- https://mvnrepository.com/artifact/org.springframework.batch/spring-batch-infrastructure --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
    &lt;artifactId&gt;spring-batch-infrastructure&lt;/artifactId&gt;
&lt;/dependency&gt;




    &lt;/dependencies&gt;



    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt; 



&lt;/project&gt;
</code></pre>

<p>I've had a lot of problems in the past regarding incorrect pom.xml, so I looked at each dependency involving database access and made sure the project had the correct provided dependencies. I also checked that the versions were the same as mentioned in the provided dependencies.
What does the error message <code>AbstractMethodError</code> indicate?</p>

<p>Feel free to ask any clarifying questions</p>