Previously, when using springboot to develop the system, the @Resouse annotation was used. There was no exception during the idea runtime, but the jar package conflict was reported when the deployment was packaged.
09:07:51.234 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] -
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.<init>(CommonAnnotationBeanPostProcessor.java:664)
The following method did not exist:
'java.lang.String javax.annotation.Resource.lookup()'
The method's class, javax.annotation.Resource, is available from the following locations:
jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jsr250-api-1.0.jar!/javax/annotation/Resource.class
jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jakarta.annotation-api-1.3.5.jar!/javax/annotation/Resource.class
The class hierarchy was loaded from the following locations:
javax.annotation.Resource: jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jsr250-api-1.0.jar!/
Action:
Correct the classpath of your application so that it contains a single, compatible version of javax.annotation.Resource
Reason:
jsr250-api-1.0.jar and jakarta.annotation-api-1.3.5.jar are duplicated
Solution:
Import the following dependency in the pom of Maven. the codes is as below:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
The purpose of this is to make the system automatically import the latest jar package
Read More:
- Project Startup Error: It was loaded from the following location
- Springboot Project: How to Introduces Local Jar Package
- Springboot controls the startup of rabbitmq through configuration files
- [Solved] SpringBoot Startup Error: Description:Web server failed to start. Port 9090 was already in use.(win10)
- Springboot startup error “No bean named’org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available”
- [Solved] Springboot Project Startup Error: Unable to Identify bootstrap.yml Configuration
- [Solved] Springboot Project Start Error: An attempt was made to call the method com.google.common.collect.Multimaps.asMap
- Failed to scan osdt_cert.jar & osdt_core.jar [How to Solve]
- [Solved] Spring Boot Startup Error: Failed to load property source from location ‘classpath:/application-dev.yml‘
- [Solved] SpringBoot Startup Error: org.springframework.beans.factory.UnsatisfiedDependencyException Error creating
- The MapReduce program generates a jar package and runs with an error classnotfoundexception
- [Solved] SpringBoot Error: Property ‘mapperLocations‘ was not specified.
- [Solved] docker Start jar package and Set JVM parameter Error
- Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type
- Solve the problem that some jar packages failed to download when Maven was packaged
- Springboot error about swagger startup [How to Solve]
- [Solved] Maven Package Error: Error assembling JAR
- Springboot startup error: err config is disabled command (Redis Disables Config command)
- [Solved] SpringBoot Startup Error: Unable to start LiveReload server
- springboot jsp: There was an unexpected error (type=Not Found, status=404). No message available