Fastjson Error: Error: Cannot create inner bean ‘org.springframework.http.converter.json.MappingJackson2HttpMessageConverter

Error: Cannot create inner bean ‘org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#0

The spring-mvc.xml configuration file is written like this

 <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                 <property name="objectMapper">
                     <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
                         <property name="failOnEmptyBeans" value="false"/>
                     </bean>
                 </property>
             </bean>

reason:

Only the fastjosn dependency is imported, and the following dependency is not imported

 <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
             <version>2.12.4</version>
         </dependency>

These three jar packages are missing from the generated package

jackson-annotations-2.12.4.jar jackson-databind-2.12.4.jar jackson-core-2.12.4.jar

The problem is solved after importing dependencies.

Read More: