Weblogic服务器和Jersey servlet问题

时间:2016-01-24 16:41:33

标签: jersey weblogic

我在Eclipse上启动Oracle Weblogic Server 12c R2(12.2.1),它可以同步,但是下面有一些问题。我已经添加了Jersey库1.17,不确定它是不是太老了。但我可以找到最新的正确下载链接。

        一月 24, 2016 11:20:39 上午 weblogic.wsee.runtime.JMSStoreRoutableIDMapper onFailure
        INFO: Destination Failure for weblogic.wsee.BufferedRequestQueue due to exception: While trying to lookup 'weblogic.wsee.BufferedRequestQueue' didn't find subcontext 'wsee'. Resolved 'weblogic'
        一月 24, 2016 11:20:39 上午 weblogic.wsee.runtime.JMSStoreRoutableIDMapper onFailure
        INFO: Destination Failure for weblogic.wsee.BufferedResponseQueue due to exception: While trying to lookup 'weblogic.wsee.BufferedResponseQueue' didn't find subcontext 'wsee'. Resolved 'weblogic'
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192509> <Changing servlet class from com.sun.jersey.spi.container.servlet.ServletContainer (web.xml) to org.glassfish.jersey.servlet.ServletContainer.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.ResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.ApplicationAdapter because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.server.impl.application.DeferredResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.ClassNamesResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.DefaultResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.PackagesResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.servlet.WebAppResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.ClasspathResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.sun.jersey.api.core.ScanningResourceConfig because ApplicationPath annotation is not set on it.> 
        <Jan 24, 2016 11:21:15 AM EST> <Warning> <JAXRSIntegration> <BEA-2192511> <The list of resource packages: org.codehaus.jackson.jaxrs;com.sun.jersey.server.impl.application> 

有人可以帮忙弄清楚如何解决这个问题吗?

Web.xml是:

        <?xml version="1.0" encoding="UTF-8"?>
        <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
          <display-name>com.youtube.rest</display-name>
          <welcome-file-list>
            <welcome-file>readme.html</welcome-file>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
            <welcome-file>default.html</welcome-file>
            <welcome-file>default.htm</welcome-file>
            <welcome-file>default.jsp</welcome-file>
          </welcome-file-list>

          <servlet>
            <servlet-name>Jersey REST Service</servlet-name>
            <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
            <init-param>
              <param-name>com.sun.jersey.config.property.packages</param-name>
              <param-value>com.youtube.rest</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>

readme.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>Read Me</h1>
</body>
</html>

3 个答案:

答案 0 :(得分:0)

将泽西岛版本更改为2.x

答案 1 :(得分:0)

如果你需要保持Jersey 1.X,你必须在weblogic.xml中声明这个

   <wls:prefer-application-packages>
            <wls:package-name>com.sun.jersey</wls:package-name>
    </wls:prefer-application-packages>

答案 2 :(得分:0)

当在部署时将应用程序web.xml中对旧Jersey 1.x组件的引用转换为Jersey 2.x引用时,将发出这些消息。换句话说,虽然支持Jersey 1.1样式的web.xml定义,但实现将升级到Jersey 2.x。

要删除这些消息,路径如下:

  • 升级您的应用程序以使用Jersey 2.21.0(JAX-RS 2.0参考 WLS 12c提供的实施。您可能需要部署 ORACLE_HOME\wlserver\common\deployable-libraries\jax-rs-2.0.war 取决于您的WLS 12c版本。
  • 包装RESTful Web 使用带有javax.ws.rs.core.Application的web.xml的服务应用程序 子类
  • 使用web.xml打包RESTful Web服务应用程序 没有javax.ws.rs.core.Application子类

有关详细说明,请参阅以下文档链接:grok processor