编程知识 cdmana.com

Mybatis plus error java.lang.NoClassDefFoundError : org

Use mybatis-plus When automatically generating files , Report the following mistakes :

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)





Environmental Science :mybatis-plus 3.2.0

reason 1: It's a lack of dependence , The solution is as follows :

pom.xml Add... To the document velocity Dependence

    <!--  template engine  -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.0</version>
        </dependency>

reason 2: The version is too high , The solution is as follows : take version Try the lower or higher version , I use the latest version of 2.2 The results indicate that the above error , Set it to a lower version ok

pom.xml Add... To the document velocity Dependence

    <!--  template engine  -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.0</version>
        </dependency>       

版权声明
本文为[osc_h008x2zb]所创,转载请带上原文链接,感谢

Scroll to Top