代码自动生成后运行出错

Blade 未结 0 171
xiaoli
xiaoli 剑童 2024-04-23 15:40
悬赏:5

按照开发手册自动生成了代码,打开网页时调取数据出错,使用psotman对数据库数据进行调用没有问题,但是使用自动生成的代码去调用时出现错误

image.png

下文为部分报错代码


2024-04-23 15:29:26.199 DEBUG 10404 --- [  XNIO-1 task-1] .c.c.v.BladeRequestMappingHandlerMapping : Mapped to org.springblade.demo.controller.BlogController#list(Map, Query)

2024-04-23 15:29:26.206  INFO 10404 --- [  XNIO-1 task-1] o.s.core.boot.logger.RequestLogAspect    : 


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

===> GET: /blog/list Parameters: {"query":{"current":1,"size":10,"ascs":null,"descs":null},"blog":{"current":"1","size":"10"}}

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

===Headers===  referer : http://localhost:1888/

===Headers===  content-length : 0

===Headers===  X-Forwarded-Prefix : /blade-demo

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

===Headers===  blade-auth : bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yIiwidXNlcl9pZCI6IjExMjM1OTg4MjE3Mzg2NzUyMDEiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInVzZXJfbmFtZSI6ImFkbWluIiwib2F1dGhfaWQiOiIiLCJ0b2tlbl90eXBlIjoiYWNjZXNzX3Rva2VuIiwiZGVwdF9pZCI6IjExMjM1OTg4MTM3Mzg2NzUyMDEiLCJhY2NvdW50IjoiYWRtaW4iLCJjbGllbnRfaWQiOiJzYWJlciIsImV4cCI6MTcxMzg2MDk2MywibmJmIjoxNzEzODU3MzYzfQ.WK6KTVGFmRbR-ip-h1cggvZoIxA-6M8F4hoo3ZFkWXk

===Headers===  cookie : saber-access-token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yIiwidXNlcl9pZCI6IjExMjM1OTg4MjE3Mzg2NzUyMDEiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInVzZXJfbmFtZSI6ImFkbWluIiwib2F1dGhfaWQiOiIiLCJ0b2tlbl90eXBlIjoiYWNjZXNzX3Rva2VuIiwiZGVwdF9pZCI6IjExMjM1OTg4MTM3Mzg2NzUyMDEiLCJhY2NvdW50IjoiYWRtaW4iLCJjbGllbnRfaWQiOiJzYWJlciIsImV4cCI6MTcxMzg2MDk2MywibmJmIjoxNzEzODU3MzYzfQ.WK6KTVGFmRbR-ip-h1cggvZoIxA-6M8F4hoo3ZFkWXk; saber-refresh-token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ1c2VyX2lkIjoiMTEyMzU5ODgyMTczODY3NTIwMSIsInRva2VuX3R5cGUiOiJyZWZyZXNoX3Rva2VuIiwiY2xpZW50X2lkIjoic2FiZXIiLCJleHAiOjE3MTQ0NjIxNjMsIm5iZiI6MTcxMzg1NzM2M30.cmlTIIcdFpgA2FHvqR5kLUhpMXWycB3zgkpuEeSvTe8

===Headers===  accept-language : zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6

===Headers===  X-Forwarded-Host : localhost:1888,localhost

===Headers===  X-Forwarded-Proto : http,http

===Headers===  X-Forwarded-Port : 1888,80

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

===Headers===  authorization : Basic c2FiZXI6c2FiZXJfc2VjcmV0

===Headers===  sec-ch-ua : "Microsoft Edge";v="123", "Not:A-Brand";v="8", "Chromium";v="123"

===Headers===  sec-ch-ua-mobile : ?0

===Headers===  sec-ch-ua-platform : "Windows"

===Headers===  host : 192.168.31.152:9101

===Headers===  Forwarded : proto=http;host=localhost;for="127.0.0.1:57686"

===Headers===  X-Forwarded-For : 127.0.0.1,127.0.0.1

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

===Headers===  user-agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0

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

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


2024-04-23 15:29:26.207 DEBUG 10404 --- [  XNIO-1 task-1] o.s.c.b.tenant.BladeTenantInterceptor    : original SQL: SELECT  id,title,category,release_time,content,create_user,create_time,update_user,update_time,status,is_deleted  FROM tb_blog  WHERE is_deleted=0

2024-04-23 15:29:26.208 DEBUG 10404 --- [  XNIO-1 task-1] o.s.c.b.tenant.BladeTenantInterceptor    : SQL to parse, SQL: SELECT  id,title,category,release_time,content,create_user,create_time,update_user,update_time,status,is_deleted  FROM tb_blog  WHERE is_deleted=0

2024-04-23 15:29:26.209 DEBUG 10404 --- [  XNIO-1 task-1] o.s.c.b.tenant.BladeTenantInterceptor    : parse the finished SQL: SELECT id, title, category, release_time, content, create_user, create_time, update_user, update_time, status, is_deleted FROM tb_blog WHERE is_deleted = 0

2024-04-23 15:29:26.277  INFO 10404 --- [  XNIO-1 task-1] o.s.core.boot.logger.RequestLogAspect    : 


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

<=== GET: /blog/list (71 ms)

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


2024-04-23 15:29:26.283 ERROR 10404 --- [  XNIO-1 task-1] o.s.c.l.e.BladeRestExceptionTranslator   : 服务器异常


org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: java.lang.NullPointerException

### Cause: java.lang.NullPointerException

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97) ~[mybatis-spring-2.1.1.jar:2.1.1]

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439) ~[mybatis-spring-2.1.1.jar:2.1.1]

at com.sun.proxy.$Proxy160.selectList(Unknown Source) ~[na:na]

at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.1.1.jar:2.1.1]

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166) ~[mybatis-plus-core-3.5.4.1.jar:3.5.4.1]

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) ~[mybatis-plus-core-3.5.4.1.jar:3.5.4.1]

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152) ~[mybatis-plus-core-3.5.4.1.jar:3.5.4.1]

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.4.1.jar:3.5.4.1]

at com.sun.proxy.$Proxy161.selectList(Unknown Source) ~[na:na]

at com.baomidou.mybatisplus.core.mapper.BaseMapper.selectPage(BaseMapper.java:359) ~[mybatis-plus-core-3.5.4.1.jar:3.5.4.1]


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

1. 

2. 

3.


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


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


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


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

回答
  • 消灭零回复
提交回复