2017-10-11 1 views
1

안녕하세요. weblogic 12.2.1.2 이전에 배포되고있는 하나의 restfull webservice를 갖고 있는데, weblogic 12.2.1.2에 배포되지 않습니다. 내가 web.xmlversion 속성을 시도했지만 작동하지 않았다weblogic 12.2.1.2에 restFull webservice webapp를 배포하고 있습니다. 실패했습니다.

<Oct 11, 2017, 8:16:22,462 PM IST> <Warning> <Munger> <BEA-2156203> <A version attribute was not found in element "web-app" in the deployment descriptor /u01/xxx/xxxx/webapps/xx/WEB-INF/web.xml. A version attribute is required, but this version of the WebLogic Server will assume that the latest version is used. Future versions of WebLogic Server will reject descriptors that do not specify the Java EE version. To eliminate this warning, add an appropriate "version=" to element "web-app" in the deployment descriptor.> 
<Oct 11, 2017, 8:16:22,620 PM IST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class com.xxx.xx.xx.xxx.JerseyConfig because ApplicationPath annotation is not set on it.> 
<Oct 11, 2017, 8:16:22,621 PM IST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class org.glassfish.jersey.server.ResourceConfig because ApplicationPath annotation is not set on it.> 
<Oct 11, 2017, 8:16:22,624 PM IST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig because ApplicationPath annotation is not set on it.> 
<Oct 11, 2017, 8:16:22,624 PM IST> <Warning> <JAXRSIntegration> <BEA-2192510> <Cannot add Jersey servlet for application class org.glassfish.jersey.server.ResourceConfig$RuntimeConfig because ApplicationPath annotation is not set on it.> 
<Oct 11, 2017, 8:21:37,36 PM IST> <Error> <org.glassfish.jersey.server.spring.SpringComponentProvider> <BEA-000000> <[failed to localize] none.or.multiple.beans.available(class com.xxx.xx.xx.JerseyConfig)> 

: 그리고 아래의 오류가 발생합니다. 같은 오류가 발생했습니다.

Env. 세부 : 어떤 도움을 주시면 감사하겠습니다

Java-1.7 & 1.8 
weblogic-12.2.1.2 
Servlet-api-2.4 

..

업데이트 :이 저지 예제 예제의 web.xml이 가리키는 초기화 매개 변수가 주목된다

<?xml version="1.0" encoding="UTF-8"?> 
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 


    <display-name>xxx</display-name> 
    <context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>WEB-INF/applicationContext.xml 
      WEB-INF/classes/configs/*.xml 
     </param-value> 
    </context-param> 
    <!--<context-param> 
     <param-name>contextClass</param-name> 
     <param-value>com.javaetmoi.core.spring.JBoss5XmlWebApplicationContext</param-value> 
    </context-param>--> 
    <listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener 
     </listener-class> 
    </listener> 
    <servlet> 
     <servlet-name>jerseyServlet</servlet-name> 
     <servlet-class>org.glassfish.jersey.servlet.ServletContainer 
     </servlet-class> 
     <init-param> 
      <param-name>javax.ws.rs.Application</param-name> 
      <param-value>com.xx.xx.xx.JerseyConfig</param-value> 
     </init-param> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>jerseyServlet</servlet-name> 
     <url-pattern>/*</url-pattern> 
    </servlet-mapping> 

    <context-param> 
     <param-name>localFilesBasePath</param-name> 
     <param-value>configs</param-value> 
    </context-param> 
    <context-param> 
     <param-name>resteasy.scan</param-name> 
     <param-value>false</param-value> 
    </context-param> 
    <context-param> 
     <param-name>resteasy.scan.providers</param-name> 
     <param-value>false</param-value> 
    </context-param> 
    <context-param> 
     <param-name>resteasy.scan.resources</param-name> 
     <param-value>false</param-value> 
    </context-param> 
    <resource-ref> 
     <res-ref-name>jdbc/xxx</res-ref-name> 
     <res-type>javax.sql.DataSource</res-type> 
     <res-auth>Container</res-auth> 
    </resource-ref> 

    <resource-ref> 
     <res-ref-name>jdbc/xxx</res-ref-name> 
     <res-type>javax.sql.DataSource</res-type> 
     <res-auth>Container</res-auth> 
    </resource-ref> 

</web-app> 
+0

는 예를 들어, web.xml의 버전 속성을 누락 것 같은데 ... = "2.4" 의 xmlns = "HTTP'''<웹 응용 프로그램 ID ="WebApp_ID "버전 : //java.sun. com/xml/ns/j2ee " xmlns : xsi ="http://www.w3.org/2001/XMLSchema-instance " xsi : schemaLocation ="http://java.sun.com/xml/ns/ j2ee \t http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">''' –

+0

또한 버전 속성을 사용해 보았지만 그 후에는 다른 오류가 발생했습니다. 작동하지 않음 –

+0

또한 클래스에서 @ApplicationPath (/ "your_path")'''를 설정하거나 web.xml 파일에서 Jersey 서블릿을 구성해야합니다. –

답변

0

저지 신청 클래스

<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"> 

    <filter> 
     <filter-name>org.glassfish.jersey.examples.bookstore.webapp.MyApplication</filter-name> 
     <filter-class>org.glassfish.jersey.servlet.ServletContainer</filter-class> 
     <init-param> 
      <param-name>javax.ws.rs.Application</param-name> 
      <param-value>org.glassfish.jersey.examples.bookstore.webapp.MyApplication</param-value> 
     </init-param> 
     <!-- pass to next filter if Jersey/App returns 404 --> 
     <init-param> 
      <param-name>jersey.config.servlet.filter.forwardOn404</param-name> 
      <param-value>true</param-value> 
     </init-param> 
    </filter> 
    <filter-mapping> 
     <filter-name>org.glassfish.jersey.examples.bookstore.webapp.MyApplication</filter-name> 
     <url-pattern>/*</url-pattern> 
    </filter-mapping> 
</web-app> 

이것은 응용 프로그램 클래스입니다 :

public class MyApplication extends ResourceConfig { 
    public MyApplication() { 
     // Resources. 
     packages(Bookstore.class.getPackage().getName()); 

     // MVC. 
     register(JspMvcFeature.class); 

     // Logging. 
     register(LoggingFilter.class); 

     // Tracing support. 
     property(ServerProperties.TRACING, TracingConfig.ON_DEMAND.name()); 
    } 
} 
관련 문제