0

I am developing a simple application using Spring Boot, this is my pom

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>2.3.4.RELEASE</version>
    </dependency>
</dependencies>

When I run the application I get

***************************
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.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1318)

The following method did not exist:

    'java.lang.String javax.servlet.ServletContext.getVirtualServerName()'

The calling method's class, org.apache.catalina.authenticator.AuthenticatorBase, was loaded from the following location:

    jar:file:/Users/19904760/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.58/tomcat-embed-core-9.0.58.jar!/org/apache/catalina/authenticator/AuthenticatorBase.class

The called method's class, javax.servlet.ServletContext, is available from the following locations:

    jar:file:/Users/19904760/Desktop/prm-service-middleware/lib/javax.servlet.jar!/javax/servlet/ServletContext.class
    jar:file:/Users/19904760/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.58/tomcat-embed-core-9.0.58.jar!/javax/servlet/ServletContext.class

The called method's class hierarchy was loaded from the following locations:

    javax.servlet.ServletContext: file:/Users/19904760/Desktop/prm-service-middleware/lib/javax.servlet.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.apache.catalina.authenticator.AuthenticatorBase and javax.servlet.ServletContext


Process finished with exit code 1

How is this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Олег
  • 1
  • 2
  • 1
    Does this answer your question? [Getting NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName()](https://stackoverflow.com/questions/34950164/getting-nosuchmethoderrorjavax-servlet-servletcontext-getvirtualservername) – pringi Oct 13 '22 at 15:06
  • Eyah, it is solove my problem – Олег Oct 15 '22 at 00:34

0 Answers0