0

I'm facing a :

 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)

So looking at those posts : Link 1 and Link 2 I try a proposed solution (2nd link) which is : "Excluding jsr311-api-1.1.1 from my dependencies.

jsr311-api-1.1.1.jar is in my target/WEB-INF/lib/. I ran mvn dependency:tree -Dverbose -Dincludes=jsr311-api-1.1.1 but nothing results from that.

Any idea of how I can remove this .jar ?

Here's my 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>

And if you have an other solution for my problem, don't hesitate.

PS: I'm using Tomcat 8.5 but I don't think it's relevant.

Yeti
  • 1,108
  • 19
  • 28
Gabriel
  • 163
  • 1
  • 1
  • 15

1 Answers1

1

The full mvn dependency:tree | grep jsr311 did the trick.

Edit : And excluding jsr311 from the two dependencies that grep showed me resolved my main error.

Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
Gabriel
  • 163
  • 1
  • 1
  • 15