mybatis-plus 错误java.lang.NoClassDefFoundError: org
使用mybatis-plus自動生成文件的時候,報下面的錯誤:
Disconnected from the target VM, address: ‘127.0.0.1:57082’, transport: ‘socket’
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:96)
at com.spek.common.generator.TestMybatisPlus.main(TestMybatisPlus.java:81)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.Context
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
環境:mybatis-plus 3.2.0
原因1:是缺少了依賴,解決方案如下:
pom.xml文件當中加入velocity的依賴
<!-- 模板引擎 --><dependency><groupId>org.apache.velocity</groupId><artifactId>velocity-engine-core</artifactId><version>2.0</version></dependency>總結
以上是生活随笔為你收集整理的mybatis-plus 错误java.lang.NoClassDefFoundError: org的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Dubbo和SpringCloud的区别
- 下一篇: mybatis-plus自动生成文件