首页 > 代码库 > WebLogic 12c SpringMVC Jackson 冲突 java.lang.NoSuchMethodError: TypeFactory.constructParametrizedType(Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Class;)

WebLogic 12c SpringMVC Jackson 冲突 java.lang.NoSuchMethodError: TypeFactory.constructParametrizedType(Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Class;)

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
    xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
    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_3_0.xsd   
    http://xmlns.oracle.com/weblogic/weblogic-web-app   
    http://xmlns.oracle.com/weblogic/weblogic-web-app/1.8/weblogic-web-app.xsd">
    <wls:weblogic-version>12.2.1</wls:weblogic-version>
    <wls:context-root>demo</wls:context-root>
    <wls:container-descriptor>
        <!--
        <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
        -->
        <wls:prefer-application-packages>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
        </wls:prefer-application-packages>
        <wls:gzip-compression>
            <wls:enabled>true</wls:enabled>
            <wls:min-content-length>1000</wls:min-content-length>
            <wls:content-type>text/html</wls:content-type>
            <wls:content-type>text/xml</wls:content-type>
            <wls:content-type>text/plain</wls:content-type>
            <wls:content-type>text/css</wls:content-type>
            <wls:content-type>text/javascript</wls:content-type>
            <wls:content-type>application/json</wls:content-type>
            <wls:content-type>application/x-javascript</wls:content-type>
            <wls:content-type>application/xml</wls:content-type>
            <wls:content-type>application/xml+rss</wls:content-type>
        </wls:gzip-compression>
    </wls:container-descriptor>
</wls:weblogic-web-app>

<wls:package-name>com.fasterxml.jackson.*</wls:package-name>:作用是优先从WEB-INF/lib下加载SpringMVC所依赖的Jackson类库.

WebLogic 12c SpringMVC Jackson 冲突 java.lang.NoSuchMethodError: TypeFactory.constructParametrizedType(Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Class;)