生成代码报错。

Blade 未结 4 4136
ys
ys 剑童 2019-12-30 21:54

一、该问题的重现步骤是什么?

1. 下载最新版本BladeX-Boot和Sword

2. 使用代码生成器生成代码

3. 代码生成报错org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/generator/config/ITypeConvert


二、你期待的结果是什么?实际看到的又是什么?

期待代码生成到指定文件夹,实际看到报错没有生成文件


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

BladeX-Boot最新版和Sword最新版,在Windows10系统上


四、请提供详细的错误堆栈信息,这很重要。

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png


五、若有更多详细信息,请在下面提供。

image.png

image.png


4条回答
  • 2020-05-07 13:44

    查看BladeX-Boot的pom文件,找到mybatis-plus的依赖

    image.png


    如图,直接下载的项目中scope是未注释掉的,注释掉后,重新加载依赖,重启项目后就可以了,这是idea2017 如果是更高版本的idea,如下图处理即可

    e030a07f8c321bf6d05c1c500513ab9e394.jpg

    1 讨论(0)
  • 2020-01-02 21:40

    看报错提示,像是mybatis-plus-generator没有下载成功,没有加载到类。

    加一下这个依赖,然后点击maven刷新,再试试看

    image.png

    image.png


    0 讨论(0)
  • image.png

    ================  Response Start  ================

    ===Result===  {"code":200,"success":true,"data":null,"msg":"代码生成成功"}

    <=== POST: /blade-develop/code/gen-code (672 ms)

    ================   Response End   ================


    2020-02-27 14:41:03.548  INFO 49503 --- [ XNIO-1 task-29] o.s.core.log.aspect.RequestLogAspect     : 


    ================  Request Start  ================

    ===> GET: /blade-develop/code/list Parameters: {"code":{"current":"1","size":"10"},"query":{"current":1,"size":10,"ascs":null,"descs":null}}

    ===Headers===  sec-fetch-mode: cors

    ===Headers===  referer: http://localhost:8080/

    ===Headers===  sec-fetch-site: same-origin

    ===Headers===  blade-auth: bearer eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyI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eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ1c2VyX2lkIjoiMTEyMzU5ODgyMTczODY3NTIwMSIsInRva2VuX3R5cGUiOiJyZWZyZXNoX3Rva2VuIiwiY2xpZW50X2lkIjoic2FiZXIiLCJleHAiOjE1ODMzOTAzNDAsIm5iZiI6MTU4Mjc4NTU0MH0.GIYVoeR9HHNE9Z45Eig75pIm0yBl_N78aWdbful2pWI

    ===Headers===  accept-language: zh-CN,zh;q=0.9

    ===Headers===  x-forwarded-proto: http

    ===Headers===  x-forwarded-port: 8080

    ===Headers===  x-forwarded-for: 127.0.0.1

    ===Headers===  pragma: no-cache

    ===Headers===  accept: application/json, text/plain, */*

    ===Headers===  authorization: Basic c2FiZXI6c2FiZXJfc2VjcmV0

    ===Headers===  x-forwarded-host: localhost:8080

    ===Headers===  host: localhost:80

    ===Headers===  connection: close

    ===Headers===  cache-control: no-cache

    ===Headers===  accept-encoding: gzip, deflate, br

    ===Headers===  user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36

    ===Headers===  sec-fetch-dest: empty

    ================   Request End   ================


    2020-02-27 14:41:03.558 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : ==>  Preparing: SELECT id,datasource_id,service_name,code_name,table_name,table_prefix,pk_name,base_mode,wrap_mode,package_name,api_path,web_path,is_deleted FROM blade_code WHERE is_deleted=0 

    2020-02-27 14:41:03.560 DEBUG 49503 --- [ XNIO-1 task-29] o.s.core.tenant.BladeTenantSqlParser     : Original SQL: SELECT  id,datasource_id,service_name,code_name,table_name,table_prefix,pk_name,base_mode,wrap_mode,package_name,api_path,web_path,is_deleted  FROM blade_code 

     WHERE  is_deleted=0

    2020-02-27 14:41:03.561 DEBUG 49503 --- [ XNIO-1 task-29] o.s.core.tenant.BladeTenantSqlParser     : parser sql: SELECT id, datasource_id, service_name, code_name, table_name, table_prefix, pk_name, base_mode, wrap_mode, package_name, api_path, web_path, is_deleted FROM blade_code WHERE is_deleted = 0

    2020-02-27 14:41:03.564 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : ==>  Preparing: SELECT COUNT(1) FROM blade_code WHERE is_deleted = 0 

    2020-02-27 14:41:03.565 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : ==> Parameters: 

    2020-02-27 14:41:03.567 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : ==>  Preparing: SELECT id, datasource_id, service_name, code_name, table_name, table_prefix, pk_name, base_mode, wrap_mode, package_name, api_path, web_path, is_deleted FROM blade_code WHERE is_deleted = 0 LIMIT ?,? 

    2020-02-27 14:41:03.576 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : ==> Parameters: 0(Long), 10(Long)

    2020-02-27 14:41:03.577 DEBUG 49503 --- [ XNIO-1 task-29] o.s.m.d.mapper.CodeMapper.selectPage     : <==      Total: 1


    ==============  Sql Start  ==============

    Execute ID  :org.springblade.modules.develop.mapper.CodeMapper.selectPage

    Execute SQL :SELECT id, datasource_id, service_name, code_name, table_name, table_prefix, pk_name, base_mode, wrap_mode, package_name, api_path, web_path, is_deleted FROM blade_code WHERE is_deleted = 0 LIMIT ?,?

    Execute Time:2 ms

    ==============  Sql  End   ==============


    2020-02-27 14:41:03.580  INFO 49503 --- [ XNIO-1 task-29] o.s.core.log.aspect.RequestLogAspect     : 


    ================  Response Start  ================

    ===Result===  {"code":200,"success":true,"data":{"records":[{"id":"1123598812738675201","datasourceId":"1161483357481541634","serviceName":"blade-demo","codeName":"通知公告","tableName":"blade_notice","tablePrefix":"blade_","pkName":"id","baseMode":1,"wrapMode":1,"packageName":"org.springblade.desktop","apiPath":"/Users/zhonghuixiong/Desktop/demo/blade-develop","webPath":"/Users/zhonghuixiong/Desktop/demo/Sword","isDeleted":0}],"total":1,"size":10,"current":1,"orders":[],"hitCount":false,"searchCount":true,"pages":1},"msg":"操作成功"}

    <=== GET: /blade-develop/code/list (31 ms)

    ================   Response End   ================


    应该是你环境问题,我这边跑了本地是成功的。

    0 讨论(0)
  • 2020-03-08 18:46

    同楼主一样的问题,下载全新2.4版本也一样,采用2楼的方法不能解决问题。应该是tool或boot项目配置里缺少其它依赖。测试环境是只加载了boot项目和saber项目,那些测试可以的估计是别的项目带入了需要的包。等待官方答案。

    0 讨论(0)
提交回复