z1.项目在本地运行可以,放在服务器上查询可以涉及到修改就会出现这种情况
org.springframework.http.converter.HttpMessageNotReadableException:
JSON parse error: Invalid UTF-8 middle byte 0x3f;
nested exception is com.fasterxml.jackson.databind.JsonMappingException:
Invalid UTF-8 middle byte 0x3f
也看到别人说的修改tomcat,我修改了没有效果。
2.修改pom.xml 在build里面加上
<configuration>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
</configuration>
这个是我的,可以参考下
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
</configuration>
</plugin>
然后打包到服务器
启动命令
java -Dfile.encoding=UTF-8 -jar 项目.jar
最后完美解决,希望能帮到你们。