Jersey Web.xml Configuration

26 views Asked by At

I'm getting this kind of error in my web.xml file:

'org.glassfish.jersey.servlet.ServletContainer' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.Servlet'

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
    <servlet>
        <servlet-name>Jersey Rest Service</servlet-name>
        <servlet-class> org.glassfish.jersey.servlet.ServletContainer </servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>org.example.resource</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Rest Service</servlet-name>
        <url-pattern>/api/*</url-pattern>
    </servlet-mapping>
</web-app>

I want to solve this problem

0

There are 0 answers