How do I resolve this Weblogic intermittent java.lang.LinkageError? What are the steps to understanding what it means and fix it?

前端 未结 2 405
囚心锁ツ
囚心锁ツ 2021-01-15 02:50

I have an intermittent linkage error thrown: (That\'s basically all the information I have)

java.lang.LinkageError loader constraint violation: 
  when resol         


        
相关标签:
2条回答
  • 2021-01-15 03:20

    Does this mean that I have 2 versions of java.xml.rpc.Service loaded? Is that so?

    Yes.

    How can that happen?

    It happens when you have two classloaders both loading the same class. In your case, the classloaders are instances of different ClassLoader classes:

        java.net.FactoryURLClassLoader
    

    and

        weblogic.utils.classloaders.ChangeAwareClassLoader
    

    what is the way to resolve it?

    I'm not a Weblogic user, but the theoretical solution is to put the JAR file containing the classes in question into the classpath of an common ancestor classloader of the two above.

    0 讨论(0)
  • 2021-01-15 03:29

    The solution was eventually to update the weblogic-application.xml file of the deployed app

    The application used an old jaxrpc-api.jar that we could not remove for various reason,

    The solution we used to prefer the internal jar was this (Is there a better way?)

    <wls:prefer-application-packages>
      ...
      <wls:package-name>java.xml.rpc.*</wls:package-name>
    </wls:prefer-application-packages>
    
    0 讨论(0)
提交回复
热议问题