启动例外:JAX RS 2.1和Weblogic 12.2.1.3

时间:2018-10-29 09:51:45

标签: apache-camel weblogic cxf weblogic12c

我在Weblogic 12.2.1.3应用程序服务器上使用cxf 3.2.1和camel 2.20.2。该应用程序正在运行,但是在启动时会引发很多异常(日志警告):

WARNING: HK2 service reification failed for 
[org.apache.cxf.jaxrs.spring.SpringViewResolverProvider] with an exception:
MultiException stack 1 of 2
java.lang.NoSuchMethodException: Could not find a suitable constructor in org.apache.cxf.jaxrs.spring.SpringViewResolverProvider class.
    at org.glassfish.jersey.internal.inject.JerseyClassAnalyzer.getConstructor(JerseyClassAnalyzer.java:192)

MultiException stack 2 of 2
java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
    implementation=org.apache.cxf.jaxrs.spring.SpringViewResolverProvider

我认为这是因为cxf对jax rs 2.1的依赖性以及weblogic使用jax rs 2.0的原因。

提取部署中的libs(300 +):

cxf-core-3.2.1.jar
cxf-rt-bindings-soap-3.2.1.jar
cxf-rt-bindings-xml-3.2.1.jar
cxf-rt-databinding-jaxb-3.2.1.jar
cxf-rt-frontend-jaxrs-3.2.1.jar
cxf-rt-frontend-jaxws-3.2.1.jar
cxf-rt-frontend-simple-3.2.1.jar
cxf-rt-rs-client-3.2.1.jar
cxf-rt-security-3.2.1.jar
cxf-rt-security-saml-3.2.1.jar
cxf-rt-transports-http-3.2.1.jar
cxf-rt-ws-addr-3.2.1.jar
cxf-rt-ws-policy-3.2.1.jar
cxf-rt-ws-security-3.2.1.jar
cxf-rt-wsdl-3.2.1.jar
javax.servlet-api-3.1.0.jar
javax.ws.rs-api-2.1.jar

weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application
    xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application"
    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/javaee_5.xsd http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
    <wls:application-param>
        <wls:param-name>webapp.encoding.default</wls:param-name>
        <wls:param-value>UTF-8</wls:param-value>
    </wls:application-param>
    <wls:prefer-application-packages>
        <wls:package-name>javax.wsdl.*</wls:package-name>
        <wls:package-name>antlr.*</wls:package-name>
        <wls:package-name>javax.faces.*</wls:package-name>
        <wls:package-name>com.sun.mail.*</wls:package-name>
        <wls:package-name>javax.mail.*</wls:package-name>
    </wls:prefer-application-packages>
</wls:weblogic-application>

如何使jax rs 2.1在weblogic 12.2.1.3上工作? 还是可以禁止显示警告消息?

0 个答案:

没有答案