2016-07-15 6 views
0

내가 웹 로직 12.2.1.x에서 실행하는 매우 간단한 저지 웹 서비스를 얻기 위해 노력하고 있어요하지만 난 비참 나는 다음과 같은 한 내 web.xml에서뉴저지 1.13 웹 서비스는

실패하고 12.2.1.x

<?xml version="1.0" encoding="UTF-8"?> 
<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"> 
    <display-name>jersey1test</display-name> 
    <servlet> 
     <servlet-name>ServletAdaptor</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.jersey1test</param-value> 
     </init-param> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>ServletAdaptor</servlet-name> 
     <url-pattern>/srv/*</url-pattern> 
    </servlet-mapping> 
    <session-config> 
     <session-timeout>30</session-timeout> 
    </session-config> 
    <welcome-file-list> 
     <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 
</web-app> 

그리고 웹 서비스 자원 자체

import javax.ws.rs.GET; 
import javax.ws.rs.Path; 
import javax.ws.rs.Produces; 
import javax.ws.rs.core.MediaType; 
import javax.ws.rs.core.Response; 

@Path("jersey1test") 
public class Jersey1Resource 
{ 

    @Path("hello") 
    @GET 
    @Produces(MediaType.APPLICATION_JSON) 
    public Response helloJersey() 
    { 
     return Response.status(Response.Status.OK).entity("Hello from Jersey 1").build(); 
    } 

} 

매우 간단합니다 그리고 난 내 치어에서만 저지 1.13 dependecies이

<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-server</artifactId> 
    <version>1.13</version> 
</dependency> 
<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-servlet</artifactId> 
    <version>1.13</version> 
</dependency> 
<dependency> 
    <groupId>com.sun.jersey.contribs</groupId> 
    <artifactId>jersey-multipart</artifactId> 
    <version>1.13</version> 
</dependency> 
<dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>servlet-api</artifactId> 
    <version>2.5</version> 
</dependency> 

그리고이 oracle page에 제안 나는 내 weblogic.xml의에 다음과 나의 전쟁

<wls:container-descriptor> 
    <wls:prefer-application-packages> 
     <!— jersey-bundle-*.jar-> 
     <wls:package-name>com.sun.jersey.*</wls:package-name> 
     <wls:package-name>com.sun.research.ws.wadl.*</wls:package-name> 
     <wls:package-name>com.sun.ws.rs.ext.*</package-name> 

     <!— Jackson-*.jar -> 
     <wls:package-name>org.codehaus.jackson.*</wls:package-name> 

     <!— jettison-*.jar -> 
     <wls:package-name>org.codehaus.jettison.*</wls:package-name> 

     <!— jsr311*.jar -> 
     <wls:package-name>javax.ws.rs.*</wls:package-name> 

     <!— asm.jar -> 
     <wls:package-name>org.objectweb.asm.*</wls:package-name> 
    </wls:prefer-application-packages> 
</wls:container-descriptor> 

전쟁은 미세 배포와 함께 배포했지만 웹 서비스에 액세스하려고 할 때 난 그냥없는 응답을받을나는 내가 (나는 예외를 볼 수 없습니다)

서버 로그에서 다음을 참조입니다 나타났습니다

한 것 (이것은 12.1.3 또는 글래스 피시 3/4을 웹 로직을 배포 할 때 동일한 URI는 BTW 작동)

<15-Jul-2016 08:39:55 o'clock BST> <Warning> <JAXRSIntegration> <BEA-2192509> <Changing servlet class from com.sun.jersey.spi.container.servlet.ServletContainer (web.xml) to org.glassfish.jersey.servlet.ServletContainer.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 
<15-Jul-2016 08:39:55 o'clock BST> <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.> 

weblogic.xml에 설정 한 내용을 무시하는 것이 좋습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? weblogic 12.2.1.x에서 저지 1 웹 서비스를 사용할 수 있습니까?

답변

1

12.2.1.x와의 호환성 문제가있는 것 같습니다.

당신은 뉴저지 2에 웹 로직의 버전 또는 업그레이드를 다운 그레이드 할 수있는 옵션이 (왜이 방법에 의해 저지 2를 사용하지 않는?)를

https://community.oracle.com/thread/3923266?start=0&tstart=0

+0

예 내가 '년후 해당 게시물을 보았다 그것이 공인되지 않은 공식 성명인지 아닌지 확실하지 않습니다. Jersey 1이 몇 년 전에 개발 된 웹 서비스 인 이유는 위의 내용이 실제 문제와 동일한 문제를 일으키는 간단한 예일뿐입니다. – PDStat