我正面临着:
org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:330)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:339)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:362)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
因此,查看这些帖子:Link 1和Link 2我尝试了一个建议的解决方案(第二个链接):“从我的依赖项中排除jsr311-api-1.1.1。
jsr311-api-1.1.1.jar位于我的target / WEB-INF / lib /中。我运行了mvn依赖项:tree -Dverbose -Dincludes = jsr311-api-1.1.1,但是没有结果。
关于如何删除此.jar的任何想法?
这是我的pom.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myGroupId</groupId>
<artifactId>myArtifactId</artifactId>
<version>1.5.0_RC10-SNAPSHOT</version>
<properties>
<esd.common.version>1.5.0_RC9-SNAPSHOT</esd.common.version>
<eGuichet.version>1.0.0_RC3</eGuichet.version>
<axis2.version>1.6.3</axis2.version>
<java.version>1.8</java.version>
<maven.plugin.war.version>2.6</maven.plugin.war.version>
</properties>
<packaging>war</packaging>
<scm>
<connection>something</connection>
</scm>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Jersey for Rest service -->
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.18</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.2.Final</version>
</dependency>
<!-- Start Axis 2 -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>${axis2.version}</version>
<exclusions>
<exclusion>
<artifactId>httpcore</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<!-- End Axis -->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<filters>
<filter>${basedir}/src/profiles/${build.profile.id}/conf.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<!-- <pluginManagement> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<tagBase>something</tagBase>
<!-- skip the Javadoc generation as Java 8 is strict when it comes to
Javadoc and most devs don't comply to all rules -->
<arguments>-Dmaven.javadoc.skip</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
<connectionType>connection</connectionType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<verbose>true</verbose>
</configuration>
</plugin>
<!-- Tomcat 7 for easy debugging -->
<!-- mvn -P eclipse clean package tomcat7:run-war -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8081</port>
<path>/PortalServer</path>
<systemProperties>
<log4j.configuration>file:${basedir}/src/test/resources/log4j.properties</log4j.configuration>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
something
</repository>
<snapshotRepository>
something
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>something.internal</id>
<name>internal</name>
<url>something</url>
</repository>
</repositories>
</project>
如果您还有其他解决方案,请不要犹豫。
PS:我正在使用Tomcat 8.5,但我认为这无关紧要。
最佳答案
完整的mvn dependency:tree | grep jsr311
起到了作用。
编辑:并从grep显示给我的两个依赖项中排除了jsr311,这解决了我的主要错误。