当前位置:网站首页>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
边栏推荐
猜你喜欢

OpenMLDB Pulsar Connector:高效打通实时数据到特征工程

JVM调优整理

mk file introduction

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

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

He Kaiming's new work ViTDET: target detection field, subverting the concept of layered backbone

JVM tuning and finishing

JS事件循环机制

Intelligent risk control China design and fall to the ground

Interpretation of the paper: Cross-Modality Fusion Transformer for Multispectral Object Detection
随机推荐
ARM 汇编指令 ADR 与 LDR 使用
gerrit configure SSH Key and account, email information
Dark Horse Event Project
The whole process of Tinker access --- configuration
The Summer of Open Source 2022 is coming | Welcome to sign up for the OpenMLDB community project~
自己动手写RISC-V的C编译器-00环境配置
Vscode远程连接服务器终端zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting
PAT乙级刷题之路
杀死进程-查看防火墙状态
系统性能及并发数的一些计算公式
127.0.0.1 已拒绝连接
微信小程序云开发项目wx-store代码详解
Day 80
JS进阶网页特效(pink老师笔记)
欧拉法解微分方程
Byte (byte) and bit (bit)
[Meetup Preview] OpenMLDB+OneFlow: Link feature engineering to model training to accelerate machine learning model development
Promise.race学习(判断多个promise对象执行最快的一个)
端口的作用
Jetpack之dataBinding