0

Getting below error:

WARN   [08:21:24.175] [dw-397] o.e.j.s.HttpChannel -  //11.136.0.52:9999/devices 
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I    
at com.codahale.metrics.jetty9.InstrumentedHandler.updateResponses(InstrumentedHandler.java:291)
    at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:254)
    at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51)
    at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:459)
    at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:68)
    at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
    at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)

I can see many suggestions are related to conflict in servlet-api jar version (like having 2.3 or having both 2.3 and 3.0 in pom or upgrade to 3.0 version). I checked in my pom having "servlet-api jar" with "3.1.0" only and didn't have any conflicts. Still I am facing this issue.

Please let me know, if any other jar is complicating this issue or may be any jar still need to remove or add.

Added dependency tree:

+- io.dropwizard:dropwizard-core:jar:1.3.7:compile
[INFO] |  +- io.dropwizard:dropwizard-util:jar:1.3.7:compile
[INFO] |  |  \- joda-time:joda-time:jar:2.9.9:compile
[INFO] |  +- io.dropwizard:dropwizard-jackson:jar:1.3.7:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.9.6:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.9.6:compile
[INFO] |  +- io.dropwizard:dropwizard-validation:jar:1.3.7:compile
[INFO] |  |  +- org.hibernate:hibernate-validator:jar:5.4.2.Final:compile
[INFO] |  |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  |  |  \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  |  +- org.glassfish:javax.el:jar:3.0.0:compile
[INFO] |  |  \- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] |  +- io.dropwizard:dropwizard-configuration:jar:1.3.7:compile
[INFO] |  |  \- org.apache.commons:commons-text:jar:1.2:compile
[INFO] |  +- io.dropwizard:dropwizard-logging:jar:1.3.7:compile
[INFO] |  |  +- io.dropwizard.metrics:metrics-logback:jar:4.0.2:compile
[INFO] |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  |  +- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.4.11.v20180605:compile
[INFO] |  +- io.dropwizard:dropwizard-metrics:jar:1.3.7:compile
[INFO] |  +- io.dropwizard:dropwizard-jersey:jar:1.3.7:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-server:jar:2.25.1:compile
[INFO] |  |  |  \- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.25.1:compile
[INFO] |  |  +- org.glassfish.jersey.ext:jersey-metainf-services:jar:2.25.1:compile
[INFO] |  |  +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.25.1:compile
[INFO] |  |  +- io.dropwizard.metrics:metrics-jersey2:jar:4.0.2:compile
[INFO] |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.6:compile
[INFO] |  |  |  \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.6:compile
[INFO] |  |  +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.25.1:compile
[INFO] |  |  |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.25.1:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-server:jar:9.4.11.v20180605:compile
[INFO] |  |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.11.v20180605:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-webapp:jar:9.4.11.v20180605:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-xml:jar:9.4.11.v20180605:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-continuation:jar:9.4.11.v20180605:compile
[INFO] |  +- io.dropwizard:dropwizard-servlets:jar:1.3.7:compile
[INFO] |  |  \- io.dropwizard.metrics:metrics-annotation:jar:4.0.2:compile
[INFO] |  +- io.dropwizard:dropwizard-jetty:jar:1.3.7:compile
[INFO] |  |  +- io.dropwizard.metrics:metrics-jetty9:jar:4.0.2:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.11.v20180605:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-security:jar:9.4.11.v20180605:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-servlets:jar:9.4.11.v20180605:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-http:jar:9.4.11.v20180605:compile
[INFO] |  +- io.dropwizard:dropwizard-lifecycle:jar:1.3.7:compile
[INFO] |  +- io.dropwizard.metrics:metrics-core:jar:4.0.2:compile
[INFO] |  +- io.dropwizard.metrics:metrics-jvm:jar:4.0.2:compile
[INFO] |  +- io.dropwizard.metrics:metrics-jmx:jar:4.0.2:compile
[INFO] |  +- io.dropwizard.metrics:metrics-servlets:jar:4.0.2:compile
[INFO] |  |  +- io.dropwizard.metrics:metrics-json:jar:4.0.2:compile
[INFO] |  |  \- com.papertrail:profiler:jar:1.0.2:compile
[INFO] |  +- io.dropwizard.metrics:metrics-healthchecks:jar:4.0.2:compile
[INFO] |  +- io.dropwizard:dropwizard-request-logging:jar:1.3.7:compile
[INFO] |  |  \- ch.qos.logback:logback-access:jar:1.2.3:compile
[INFO] |  +- net.sourceforge.argparse4j:argparse4j:jar:0.8.1:compile
[INFO] |  \- org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:jar:1.0.3:compile
[INFO] +- io.dropwizard:dropwizard-assets:jar:1.3.7:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.25.1:compile
[INFO] |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:2.25.1:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |  |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.25.1:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |  +- org.glassfish.hk2:hk2-api:jar:2.5.0-b32:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b32:compile
[INFO] |  |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b32:compile
[INFO] |  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b32:compile
[INFO] |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b32:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-multipart:jar:2.25.1:compile
[INFO] |  \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile
[INFO] +- org.jdom:jdom2:jar:2.0.6:compile
[INFO] +- org.apache.sshd:sshd-core:jar:0.13.0:compile
[INFO] +- org.powermock:powermock-module-junit4:jar:1.7.4:test
[INFO] |  \- org.powermock:powermock-module-junit4-common:jar:1.7.4:test
[INFO] |     +- org.powermock:powermock-reflect:jar:1.7.4:test
[INFO] |     \- org.powermock:powermock-core:jar:1.7.4:test
[INFO] +- org.powermock:powermock-api-mockito:jar:1.7.4:test
[INFO] |  \- org.powermock:powermock-api-mockito-common:jar:1.7.4:test
[INFO] |     \- org.powermock:powermock-api-support:jar:1.7.4:test
[INFO] +- xmlunit:xmlunit:jar:1.3:compile
[INFO] +- org.xmlunit:xmlunit-core:jar:2.6.3:test
[INFO] +- org.xmlunit:xmlunit-matchers:jar:2.6.3:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- io.dropwizard:dropwizard-testing:jar:1.3.7:test
[INFO] |  +- org.objenesis:objenesis:jar:2.6:runtime
[INFO] |  +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] |  \- org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory:jar:2.25.1:test
[INFO] |     \- org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.25.1:test
[INFO] +- org.seleniumhq.selenium:selenium-java:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-edge-driver:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-firefox-xpi-driver:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-opera-driver:jar:4.0.0-alpha-1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:4.0.0-alpha-1:test
[INFO] |  \- org.seleniumhq.selenium:selenium-support:jar:4.0.0-alpha-1:test
[INFO] +- org.seleniumhq.selenium:selenium-firefox-driver:jar:4.0.0-alpha-1:test
[INFO] |  \- org.seleniumhq.selenium:selenium-remote-driver:jar:4.0.0-alpha-1:test
[INFO] |     +- net.bytebuddy:byte-buddy:jar:1.9.12:test
[INFO] |     +- org.apache.commons:commons-exec:jar:1.3:test
[INFO] |     \- com.squareup.okhttp3:okhttp:jar:3.14.0:test
[INFO] |        \- com.squareup.okio:okio:jar:1.17.2:test
[INFO] +- org.seleniumhq.selenium:htmlunit-driver:jar:2.33.3:test
[INFO] |  +- org.seleniumhq.selenium:selenium-api:jar:3.141.59:test
[INFO] |  \- net.sourceforge.htmlunit:htmlunit:jar:2.33:test
[INFO] |     +- xalan:xalan:jar:2.7.2:test
[INFO] |     |  \- xalan:serializer:jar:2.7.2:test
[INFO] |     +- org.apache.httpcomponents:httpmime:jar:4.5.6:test
[INFO] |     +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.33:test
[INFO] |     +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.33:test
[INFO] |     |  \- xerces:xercesImpl:jar:2.12.0:test
[INFO] |     +- net.sourceforge.htmlunit:htmlunit-cssparser:jar:1.2.0:test
[INFO] |     +- commons-net:commons-net:jar:3.6:test
[INFO] |     \- org.eclipse.jetty.websocket:websocket-client:jar:9.4.12.v20180830:test
[INFO] |        +- org.eclipse.jetty:jetty-client:jar:9.4.11.v20180605:test
[INFO] |        \- org.eclipse.jetty.websocket:websocket-common:jar:9.4.12.v20180830:test
[INFO] |           \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.12.v20180830:test
[INFO] +- org.apache.commons:commons-lang3:jar:3.9:compile
[INFO] +- org.opendaylight.yangtools:yang-common:jar:2.1.9:compile
[INFO] |  \- org.opendaylight.yangtools:concepts:jar:2.1.9:compile
[INFO] +- org.opendaylight.yangtools:yang-parser-rfc7950:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:yang-parser-reactor:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:yang-parser-spi:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:yang-model-util:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:openconfig-model-api:jar:2.1.9:compile
[INFO] |  \- org.antlr:antlr4-runtime:jar:4.7.1:compile
[INFO] +- org.opendaylight.yangtools:yang-parser-impl:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:odlext-model-api:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:odlext-parser-support:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:openconfig-parser-support:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc6536-model-api:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc6536-parser-support:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc7952-model-api:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc7952-parser-support:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc8040-model-api:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc8040-parser-support:jar:2.1.9:compile
[INFO] |  +- org.opendaylight.yangtools:rfc8528-model-api:jar:2.1.9:compile
[INFO] |  \- org.opendaylight.yangtools:rfc8528-parser-support:jar:2.1.9:compile
[INFO] +- org.opendaylight.yangtools:yang-parser-api:jar:2.1.9:compile
[INFO] +- org.opendaylight.yangtools:yang-model-api:jar:2.1.9:compile
[INFO] |  \- org.opendaylight.yangtools:util:jar:2.1.9:compile
[INFO] |     \- tech.pantheon.triemap:triemap:jar:1.0.4:compile
[INFO] +- com.automation-remarks:video-recorder-junit:jar:1.8:test
[INFO] |  \- com.automation-remarks:video-recorder-core:jar:1.8:test
[INFO] |     +- org.zeroturnaround:zt-exec:jar:1.9:test
[INFO] |     +- org.aeonbits.owner:owner-java8:jar:1.0.9:test
[INFO] |     |  \- org.aeonbits.owner:owner:jar:1.0.9:test
[INFO] |     \- org.awaitility:awaitility:jar:2.0.0:test
[INFO] |        +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |        \- cglib:cglib-nodep:jar:3.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.9:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.11:compile
[INFO] |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO] \- org.apache.httpcomponents:fluent-hc:jar:4.5.9:compile
[INFO]    \- commons-logging:commons-logging:jar:1.2:compile

POM.xml:

    <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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
    <artifactId>backend</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <httpclient.version>4.5.9</httpclient.version>
        <xmlunit-matchers.version>2.6.3</xmlunit-matchers.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <version>2.7.8</version>
        </dependency>
        <dependency>
            <groupId>net.sf.supercsv</groupId>
            <artifactId>super-csv</artifactId>
            <version>2.2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
            <version>${dropwizard.version}</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-assets</artifactId>
            <version>${dropwizard.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom2</artifactId>
            <version>2.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.sshd</groupId>
            <artifactId>sshd-core</artifactId>
            <version>0.13.0</version>
        </dependency>
        <!-- test-scoped dependencies -->
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xmlunit</groupId>
            <artifactId>xmlunit</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <version>${xmlunit-matchers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-matchers</artifactId>
            <version>${xmlunit-matchers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-testing</artifactId>
            <version>${dropwizard.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <!-- exclude commons-io because it is not only used in test -->
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>htmlunit-driver</artifactId>
            <version>${selenium-htmlunit-driver.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <!-- exclude commons-io because it is not only used in test -->
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.9</version>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-common</artifactId>
            <version>${yangtools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-parser-rfc7950</artifactId>
            <version>${yangtools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-parser-impl</artifactId>
            <version>${yangtools.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-parser-api</artifactId>
            <version>${yangtools.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-model-api</artifactId>
            <version>${yangtools.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>com.automation-remarks</groupId>
            <artifactId>video-recorder-junit</artifactId>
            <version>1.8</version>
            <scope>test</scope>
            <exclusions>
             <exclusion>
        <!-- excluded log4j because it is using 1.2.17 version which is vulnerability-->
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
       </exclusion>
    </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>fluent-hc</artifactId>
            <version>${httpclient.version}</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.version}</version>
                <configuration>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <workingDirectory>../</workingDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>${frontend-maven-plugin.nodeVersion}</nodeVersion>
                            <npmVersion>${frontend-maven-plugin.npmVersion}</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <!-- This plugin does not inject noproxy settings from settings.xml into npm, which seems to be a bug.
                                 When this is resolved, https://github.com/eirslett/frontend-maven-plugin/issues/887
                                 we can remove this workaround. Until then,
                                 to workaround this issue, we add a no_proxy environment variable to this command so
                                 we don't use the proxies for the registry-->
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        
        <profile>
            <id>karma-windows</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.kelveden</groupId>
                        <artifactId>maven-karma-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <karmaExecutable>${project.parent.basedir}/node/node ${project.parent.basedir}/node_modules/karma/bin/karma</karmaExecutable>
                            <configFile>../karma.conf.js</configFile>
                            <browsers>PhantomJS</browsers>
                            <autoWatch>false</autoWatch>
                            <singleRun>true</singleRun>
                            <colors>true</colors>
                            <skipKarma>false</skipKarma>
                            <skipTests>false</skipTests>
                            <karmaFailureIgnore>false</karmaFailureIgnore>
                            <reporters>mocha,coverage,junit</reporters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>karma-linux</id>
            <activation>
                <os>
                    <family>Linux</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.kelveden</groupId>
                        <artifactId>maven-karma-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <karmaExecutable>${project.parent.basedir}/node/node ../node_modules/.bin/karma</karmaExecutable>
                            <configFile>../karma.conf.js</configFile>
                            <browsers>PhantomJS</browsers>
                            <autoWatch>false</autoWatch>
                            <singleRun>true</singleRun>
                            <colors>true</colors>
                            <skipKarma>true</skipKarma>
                            <skipTests>true</skipTests>
                            <karmaFailureIgnore>false</karmaFailureIgnore>
                            <reporters>mocha,coverage,junit</reporters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${failsafe.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>${build-helper-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>add-test-source</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                    <goal>add-resource</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/it/java</source>
                                    </sources>
                                    <resources>
                                        <resource>
                                            <directory>src/it/resources</directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>stability-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${failsafe.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <argLine>-Xmx2048m</argLine>
                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
                            <includes>
                                <include>**/BaseStabilityTest.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>${build-helper-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>add-test-source</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/it/java</source>
                                        <source>src/stability/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Thanks in advance !!!!

5
  • 1
    Please include mvn dependency:tree result in your post Commented Mar 9, 2022 at 13:38
  • added dependency tree Commented Mar 16, 2022 at 6:39
  • Can't reproduce your problem with same dropwizard version with jdk 1.8. Please provide more details(pom, jdk, how you trigger the error), or a Minimal, Reproducible Example Commented Mar 17, 2022 at 13:59
  • We are using standalone application with java1.8 version, while running like Run as java application we are getting above error "Jetty Server". Attached POM.xml for reference. Commented Mar 22, 2022 at 6:16
  • Still cannot see your error using pom provided. Another suggestion is adding vm option -verbose:class when you run the application, then find the line in console started with: [Loaded javax.servlet.http.HttpServletResponse from to see where does HttpServletResponse come from. Commented Mar 22, 2022 at 16:13

1 Answer 1

1

I shall venture to say that the above error is looking like a classical jar shadowing problem. I am not sure when you are getting this, as you have not mentioned it, is it during compilation, testing or WAR deployment (my guess would be compilation/test).

The problem most likely stems from jersey-container-servlet-core getting included transitively. It declares a provided dependency on servlet API 2.4 which does not have the 'getStatus()' method defined (Refer: this post).

If 2.4 is on classpath, this will shadow (come before in path search) other jars containing javax.servlet package and it does not have the method required.

Also refer aspects of Maven dependency scope. Refer this post, as to why this might not be turning up on the 'dependency:tree'.

One way out is to force use of the servlet jar above 2.4 (like 3.0, 3.01, ...) with a 'dependencyManagement' element in your pom and mention the version required.

Added this section wrt the comments

Try adding a 'dependencyManagement' element to force the version:

<project>
    <dependencyManagement>
       <dependencies>
           <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>3.0.1</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
           </dependency>
       </dependencies>
   </dependencyManagement>
   <dependencies><!-- Your current dependencies --></dependencies>
</project>
Sign up to request clarification or add additional context in comments.

8 Comments

We are not using 2.4 servlet-api version in any of the transitive dependency, we see in our code servlet-api version 3.1.0 is transitive dependency as part of dropwizard-core. check once below transitive dependency hierarchy : Dropwizard-core : 1.3.7[compile] --> dropwizard-jersey :1.3.7 [compile] ---> jetty-server : 9.4.11.v20180605[compile] --> javax.servlet-api : 3.1.0 [compile]. This error is occurring in local env while running standalone application right click --> Run as -> Java application.
You have dependency on jersey-container-servlet, which has compile dependency on jersey-container-servlet-core which has provided dependency on javax.servlet 2.4, refer (mvnrepository.com/artifact/org.glassfish.jersey.containers/… and mvnrepository.com/artifact/org.glassfish.jersey.containers/…). For you jersey-servlet is compile, for jersey-servlet jersey-servlet-core is compile, for jersey-servlet-core javax.servlet is provided, therefore javax.servlet is provided which will be there on classpath for compilation
Hi ironluca, I just added scope as provided for dropwizard-core dependency as below:<dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-core</artifactId> <version>${dropwizard.version}</version> <scope>provided</scope> </dependency> In dropwizard-core the transitive dependencies jersey-container-servlet and jersey-container-servlet-core both scope are provided now. jersey-container-servlet : 2.25.1[provided] --> jersey-container-servlet-core:2.25.1[provided]. But still facing the same error, Please correct me if I am wrong.
@Bhavitha, refer additions to my answer.
tried 'DependencyManagement' element, But still getting same error.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.