I am new to Mybatis and trying to implement mybatis using Spring, but I get the following runtime error when starting tomcat.
Here is my pom.xml
<dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.0.0</version> </dependency>
and application context:
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="uactivityDS"/> <property name="configLocation" value="classpath:mybatis-config.xml"/> </bean>
Error:
the resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory
The file mybatis-spring-1.0.0.jar
exists in war/web-inf/lib
.
Any idea what is going on in this scenario?
source share