使用generatorConfig.xml 报错

来源:-

大虾丶米

2018-03-13 09:52

java.lang.RuntimeException: Cannot instantiate object of type tk.mybatis.mapper.generator.MapperPlugin
    at org.mybatis.generator.internal.ObjectFactory.createInternalObject(ObjectFactory.java:184)
    at org.mybatis.generator.internal.ObjectFactory.createPlugin(ObjectFactory.java:221)
    at org.mybatis.generator.config.Context.generateFiles(Context.java:491)
    at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:234)
    at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:133)
    at com.imooc.utils.GeneratorDisplay.generator(GeneratorDisplay.java:25)
    at com.imooc.utils.GeneratorDisplay.main(GeneratorDisplay.java:32)
Caused by: java.lang.ClassNotFoundException: tk.mybatis.mapper.generator.MapperPlugin
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.mybatis.generator.internal.ObjectFactory.internalClassForName(ObjectFactory.java:150)
    at org.mybatis.generator.internal.ObjectFactory.createInternalObject(ObjectFactory.java:180)
    ... 6 more


写回答 关注

1回答

  • 风间影月
    2018-03-15 22:37:30

    更新一下插件版本,试试这个:

    <!--mybatis--><dependency>
       <groupId>org.mybatis.spring.boot</groupId>
       <artifactId>mybatis-spring-boot-starter</artifactId>
       <version>1.3.1</version>
    </dependency><!--mapper--><dependency>
       <groupId>tk.mybatis</groupId>
       <artifactId>mapper-spring-boot-starter</artifactId>
       <version>1.2.4</version>
    </dependency><!--pagehelper--><dependency>
       <groupId>com.github.pagehelper</groupId>
       <artifactId>pagehelper-spring-boot-starter</artifactId>
       <version>1.2.3</version>
    </dependency>

SpringBoot开发常用技术整合

SpringBoot 极简开发的框架整合利器

102171 学习 · 508 问题

查看课程

相似问题