在Jersey 1.18到2.5迁移后,缺少根路径并抛出404

时间:2018-11-23 06:45:40

标签: java jax-ws jersey-2.0

迁移到jersey 2.5后,尝试访问时抛出404错误  http://localhost:7890/IntegratedDataLoadService/resources/downloadTemplate/get  我们正在使用weblogic 12.1.3进行部署。

@Path("/downloadTemplate") 
public class DownloadTemplate {
    @GET
    @Path("/get")
    @Produces(MediaType.APPLICATION_JSON)
    public Response checkService() throws UnknownHostException, IOException {
        return jsonResponseToHttp(generateResponseSchema("", valueOf(true)));
    }
}

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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"
          version="2.5">
  <display-name>IntegratedDataLoadService</display-name>
<servlet>
    <description>Jersey Web Application</description>
    <description>JAX-RS Tools Generated - Do not modify</description>
  <servlet-name>IntegratedDataLoadService</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</param-value>
    </init-param> 

     <init-param>
        <param-name>jersey.config.server.provider.classnames</param-name>
        <param-value>org.glassfish.jersey.media.multipart.MultiPartFeature</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>IntegratedDataLoadService</servlet-name>
    <url-pattern>resources/*</url-pattern>
</servlet-mapping>

</web-app>

使用的罐子清单 enter image description here

请帮助我解决这个问题

0 个答案:

没有答案