当前位置:网站首页>swagger错误:WARN i.s.m.p.AbstractSerializableParameter - [getExample,421] - Illegal DefaultValue null
swagger错误:WARN i.s.m.p.AbstractSerializableParameter - [getExample,421] - Illegal DefaultValue null
2022-08-11 05:29:00 【zhangkai__】
在项目中引入swagger后,Spring服务器启动后显示错误:java.lang.NumberFormatException: For input string: “”

这是由于maven引入swagger依赖产生的问题:
解决方法有两种:
第一种

第二种 :直接修改pom依赖:同路径长度下,谁先声明谁优先,把1.5.21放在上面,即可排除springfox-swagger2依赖的1.5.20版本。
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>直接配置后,重新maven更新一下,就不会再报错了~~
还有一个小小小问题:在swagger传数据时,出现下面一个错误结果
JSON parse error: Unexpected character (’}’ (code 125)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (’}’ (code 125)): was expecting double-quote to start field name\n at [Source: (PushbackInputStream); line: 4, column: 2]
是因为json语句中最后一行有逗号!!!

删除就好!!!!

参考其他博主链接:十分感谢
关于Java中遇到的“ For input String: "" ”这个问题的解决方案_Melo_FengZhi的博客-CSDN博客_for input string
边栏推荐
- JS this关键字
- Vscode remote connection server terminal zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting
- JS案例练习(pink老师经典案例)
- 深度学习Matlab工具箱代码注释
- The whole process of Tinker access --- Compilation
- 8-byte standard request parsing during USB enumeration
- OpenMLDB Meetup No.2 会议纪要
- JS事件循环机制
- 欧拉法解微分方程
- 智能风控中台设计与落地
猜你喜欢

OpenMLDB v0.5.0 released | Performance, cost, flexibility reach new heights

Vscode远程连接服务器终端zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting

OpenMLDB: Consistent production-level feature computing platform online and offline

Visual studio2019 configuration uses pthread

127.0.0.1 已拒绝连接

JS advanced web page special effects (pink teacher notes)

mk file introduction

heap2 (tcache attack,house of orange)

第四范式OpenMLDB优化创新论文被国际数据库顶会VLDB录用

OpenMLDB v0.5.0 发布 | 性能、成本、灵活性再攀高峰
随机推荐
He Kaiming's new work ViTDET: target detection field, subverting the concept of layered backbone
Getting Started with JNI
系统性能及并发数的一些计算公式
微信小程序云开发项目wx-store代码详解
贡献者任务第三期精彩来袭
2021-09-11 C语言 变量与内存分配
Jetpack之dataBinding
C语言实现简易扫雷(附带源码)
使用c语言实现井字棋(有源码,可以直接运行)
C language implementation guess Numbers (with source code, can be directly run)
[Meetup] OpenMLDBxDolphinScheduler engineering and scheduling link link characteristics, building the end-to-end MLOps workflow
Real-time Feature Computing Platform Architecture Methodology and Practice Based on OpenMLDB
C语言实现猜数字(附带源码,可直接运行)
helm安装
端口的作用
OpenMLDB v0.5.0 released | Performance, cost, flexibility reach new heights
经纬度求距离
Day 77
欧拉法解微分方程
开源机器学习数据库OpenMLDB贡献者计划全面启动