Forum Stats

  • 3,767,811 Users
  • 2,252,720 Discussions
  • 7,874,334 Comments

Discussions

LinkageError with com.springsource.org.aopalliance_1.0.0.jar on WebLogic

Rod Allen
Rod Allen Member Posts: 9 Blue Ribbon
edited Jan 21, 2018 3:36AM in Java User Groups Discussions

Hi All,

We are having a problem with our software when running on WebLogic 12.2.1.3. Its an Eclipse RAP based war file that works fine when deployed to WebLogic 12.1.3 but when we try to deploy it to WebLogic 12.2.1.3 we are getting a java.lang.LinkageError, specifically

java.lang.LinkageError: loader constraint violation: loader (instance of .....) previously initiated loading for a different type with name "org/aopalliance/aop/Advice"

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:264)

    at com.sun.proxy.$Proxy108.<clinit>(Unknown Source)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

    at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)

    at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)

    at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)

We have narrowed it down to a new jar that was added in WebLogic 12.2.1.2

oracle_common\modules\org.glassfish.hk2.external.aopalliance-repackaged.jar

This appears to be clashing with this file in our war WEB-INF\plugins\com.springsource.org.aopalliance_1.0.0.jar

1) Has anyone seen anything like this when upgrading their applications from Weblogic 12.1.3 to 12.2.1.2/3 ?

2) Does anyone know what this file org.glassfish.hk2.external.aopalliance-repackaged.jar does and why it was added to WebLogic? We tried removing it but WebLogic wont start.

3) Can anyone suggest a workaround to avoid the clash? We have tried using this in weblogic.xml but it had no effect :-

<container-descriptor><br/>  <prefer-web-inf-classes>false</prefer-web-inf-classes><br/>  <prefer-application-packages><br/>  <package-name>org.aopalliance.*</package-name><br/>  </prefer-application-packages><br/></container-descriptor>

Regards

Rod

Comments

  • Rod Allen
    Rod Allen Member Posts: 9 Blue Ribbon
    edited Jan 19, 2018 10:16AM

    well it looks like I have fixed my own problem

    I modified the values of

    osgi.parentClassloader=app

    osgi.contextClassLoaderParent=app

    to


    osgi.parentClassloader=ext
    osgi.contextClassLoaderParent=ext

    in the RAP war file's launch.ini

    this seems to have fixed it although not entirely sure how.

  • karianna
    karianna Member Posts: 205 Blue Ribbon
    edited Jan 21, 2018 3:27AM

    Can a moderator please move this to the Weblogic community?

    @Rod Allen - Only quick suggestion I'd have is to get your apps to have isolated class loaders (in Jboss / Wildfly there's an option to isolate the parent class loader to avoid clashes like this)

  • karianna
    karianna Member Posts: 205 Blue Ribbon
    edited Jan 21, 2018 3:36AM

    Heh, didn't see your answer before - that'll do the trick yes.