为了账号安全,请及时绑定邮箱和手机立即绑定

求大神解答 java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactory

说明:Maven Dependencies 已包含 mybatis-spring-1.2.3.jar


Caused by: java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactory

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)

at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)



正在回答

2 回答

打开工程的.classpath文件:

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

    <classpathentry kind="src" path="src/main/java"/>

    <classpathentry kind="src" path="src/main/config"/>

    <classpathentry kind="src"  path="src/test/java"/>

                .......

</classpath

   


  

将output="target/test-classes"加上就好用了


   

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

    <classpathentry kind="src" path="src/main/java"/>

    <classpathentry kind="src" path="src/main/config"/>

    <classpathentry kind="src"  output="target/test-classes" path="src/test/java"/>

   


0 回复 有任何疑惑可以回复我~

已解决,maven clean 之后重新 build 就可以了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

求大神解答 java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactory

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信