The Spring boot app can run on the online server. Now, we want to replicate the same app at the local machine but the Spring boot jar file failed to run and had the below error.
I read Compilation error on List.getFirst(): cannot find symbol?
The answer stated the issue caused by the different java version of the online server and the local machine. But I checked they both used java 21.
Error message
JSONWebMvcConfigurer.java:
java: cannot find symbol
symbol: method addFirst(com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter)
location: variable converters of type java.util.List<org.springframework.http.converter.HttpMessageConverter<?>>
Controller.java:
java: cannot find symbol
symbol: method getFirst()
location: variable generalAnswers of type java.util.List<com.alibaba.fastjson2.JSONObject>
EntityUtils.java:
java: cannot find symbol
symbol: method getFirst()
location: variable questionList of type java.util.List<com.alibaba.fastjson2.JSONObject>
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.0</version>
<relativePath/>
</parent>
<properties>
<java.version>21</java.version>
</properties>
The Spring Boot app should be able to run at the local machine, same as that running on the online server.
3