Tag Archives: java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

[Solved] java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

Report an error

java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

or

java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactoryBean

 

Obviously, it is because the class cannot be found: the SqlSession class or SqlSessionFactoryBean cannot be found

 

Solution:

Forget to add mybatis dependency and mybatis-spring when integrating ssm

 

<dependency> 
  <groupId>org.mybatis</groupId> 
  <artifactId>mybatis-spring</artifactId> 
  <version>${mybatis-spring.version}</version> 
</dependency>
<dependency> 
  <groupId>org.mybatis</groupId> 
  <artifactId>mybatis</artifactId> 
  <version>${mybatis.version}</version> 
</dependency>The 

version used is:

<mybatis.version>3.4.1</mybatis.version> 
<mybatis-spring.version>1.3.0</mybatis-spring.version>