Springfox-Swagger到2.9.2 报错java.lang.NumberFormatException: For input string

很多朋友在升级Springfox-Swagger到2.9.2版本后会碰见NumberFormatException异常java.lang.NumberFormatException: For input string: ""

异常信息如下:

  1. java.lang.NumberFormatException: For input string: ""
  2. at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_111]
  3. at java.lang.Long.parseLong(Long.java:601) ~[na:1.8.0_111]
  4. at java.lang.Long.valueOf(Long.java:803) ~[na:1.8.0_111]
  5. at
  6. //more....

解决办法是在pom.xml中排除Springfox-Swagger的Swagger-Models的jar包,重新引入,如下:

 
  1. io.springfox
  2. springfox-swagger2
  3. 2.9.2
  4. io.swagger
  5. swagger-models
  6.  
  7. io.swagger
  8. swagger-models
  9. 1.5.21

你可能感兴趣的:(spring,boot)