Weblogic 10.3.5 Overriding Spring Version

后端 未结 3 1344
感动是毒
感动是毒 2020-11-30 11:57

I am developing a web application using Oracle\'s OEPE distribution, including Weblogic server 10.3.5. WLS includes its own version of Spring, which appears to be 2.5.6.SEC0

3条回答
  •  时光说笑
    2020-11-30 12:13

    If you are using Spring Framework, you'll most likely deploy your Spring beans in a WAR and not an EAR, even in case of a Spring Integration project. Up to 12c (incl. 12.2.1) without any specific configuration you'll be stuck at Spring framework 3.0.5 and Spring Integration 2.2.6 at best. Any attempt to use a higher Spring Version will likely yield at deployment:

    weblogic.application.ModuleException: java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getNestedParameterType()Ljava/lang/Class;
    

    because the Oracle-JRF-embedded Spring Framework is picked by the class loader.

    In a multi-server Domain, not deploying JRF to a given server instance will not solve the issue but a whole Domain without JRF will do.

    The trick instead is to use the prefer-web-inf-classes parameter in a WEB-INF/weblogic.xml deployment descriptor, as follows:

    
    
        
            true
        
    
    

    and you can enjoy the benefits of Spring Framework 4.2 in a WebLogic Domain with JRF instrumentation. Do not forget, of course, to include Spring core 4.2 and related dependencies into the WAR file assembly (i.e. check the built .war to contain WEB-INF/lib/spring*.jar).

提交回复
热议问题