BeanCreationException: Error creating bean with name 'fastJsonpResponseBodyAdvice'

2334 ワード


Spring bootプロジェクトの起動エラー:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fastJsonpResponseBodyAdvice'
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: At least one query param name is required     at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]     at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:300) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]     ... 19 common frames omitted Caused by: java.lang.IllegalArgumentException: At least one query param name is required     at org.springframework.util.Assert.isTrue(Assert.java:118) ~[spring-core-5.1.8.RELEASE.jar:5.1.8.RELEASE]     at com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice.(FastJsonpResponseBodyAdvice.java:37) ~[fastjson-1.2.28.jar:na]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_161]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_161]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_161]     at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_161]     at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]     ... 21 common frames omitted  
fastjson依存問題であり、バージョンを変更して問題を解決します.
エラーバージョン:
  
            com.alibaba
            fastjson
            1.2.28
    

正常に起動されたバージョンを変更:
 
            com.alibaba
            fastjson
            1.2.47