java—更正应用程序的类路径,使其包含javax.annotation.resource的单个兼容版本

3okqufwl  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(629)

我收到这个错误

2021-03-10 11:20:55.145 ERROR --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************

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:628)

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:/repos/project/lib/jboss-jaxws.jar!/javax/annotation/Resource.class
    jar:file:/C:/Users/username/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.3.2/934c04d3cfef185a8008e7bf34331b79730a9d43/javax.annotation-api-1.3.2.jar!/javax/annotation/Resource.class
    jar:file:/C:/Users/username/.gradle/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-annotations-api/9.0.39/53d0991b26632c4eaa6c67bfba1a15ca7d929e11/tomcat-annotations-api-9.0.39.jar!/javax/annotation/Resource.class

It was loaded from the following location:

    file:/C:/repos/project/lib/jboss-jaxws.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.annotation.Resource

当我选中时,annotation.resource中的jboss-jaxws.jar中没有lookup()方法
但是它可以在这两个资源类中使用:javax.annotation/javax.annotation-api资源类org.apache.tomcat/tomcat-annotations-api资源类
如何添加crrect类路径以使其包含正确的resource.class
我正在gradle构建中使用->grails4.0.8
p、 如果有帮助的话,我正在将grails从2.4.x升级到4.0.8

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题