IntelliJ IDEA在web.xml中显示Jersey快速启动错误

时间:2018-12-07 21:18:54

标签: servlets intellij-idea jersey jersey-2.0 maven-archetype

我使用泽西2.27快速入门的Maven原型创建了一个Webapp,但是IntelliJ IDEA显示以下错误:

  

错误:(7,24)'org.glassfish.jersey.servlet.ServletContainer'无法分配给'javax.servlet.Servlet'

这是生成的web.xml:

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>com.myaddress</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/webapi/*</url-pattern>
    </servlet-mapping>
</web-app>

我该如何解决?

0 个答案:

没有答案