简体   繁体   English

LinkageError - 加载约束冲突

[英]LinkageError - loading contraint violation

I am facing LinkageError in websphere application server(8.5.5.14).我在 websphere 应用程序服务器(8.5.5.14)中面临 LinkageError。 A similar issue found here LinkageError在这里发现了一个类似的问题LinkageError

Caused by: java.lang.LinkageError: loading constraint violation when resolving method "javax/xml/soap/SOAPElement.getElementQName()Ljavax/xml/namespace/QName;": loader "com/ibm/ws/classloader/CompoundClassLoader@19d4f90e" of class "org/springframework/ws/soap/saaj/SaajSoapElement" and loader "com/ibm/oti/vm/BootstrapClassLoader@ca532309" of class "javax/xml/soap/SOAPElement" have different types for the method signature引起:java.lang.LinkageError:加载约束冲突时解析方法“javax/xml/soap/SOAPElement.getElementQName()Ljavax/xml/namespace/QName;”:加载程序“com/ibm/ws/classloader/CompoundClassLoader@19d4f90e “class”的“org/springframework/ws/soap/saaj/SaajSoapElement”和class“javax/xml/soap/SOAPElement”的加载程序“com/ibm/oti/vm/BootstrapClassLoader@ca532309”有不同的类型

The cause of the issue is the inclusion of an XML API jar containing javax/xml/namespace/QName in your application, and that application being configured to use parent-last class loading. The cause of the issue is the inclusion of an XML API jar containing javax/xml/namespace/QName in your application, and that application being configured to use parent-last class loading. When that happens, you get the following linkage pattern:发生这种情况时,您将获得以下链接模式:

  1. Application class references javax/xml/soap/SOAPElement - this class is loaded from the JDK应用程序 class 引用 javax/xml/soap/SOAPElement - 此 class 是从 JDK 加载的
  2. SOAPElement references javax/xml/namespace/QName - it loads that using its own class loader, so it's also found in the JDK SOAPElement 引用 javax/xml/namespace/QName - 它使用自己的 class 加载器加载它,因此它也可以在 JDK 中找到
  3. Application class references org/springframework/ws/soap/saaj/SaajSoapElement - this class is loaded from the application应用程序 class 引用 org/springframework/ws/soap/saaj/SaajSoapElement - 此 class 是从应用程序加载的
  4. SaajSoapElement references both SOAPElement and QName - SOAPElement is loaded from the JDK (as before), but QName is loaded from the application, because parent-last class loader delegation requires that the class loader search locally before delegating to parents SaajSoapElement 引用 SOAPElement 和 QName - SOAPElement 是从 JDK 加载的(如前所述),但 QName 是从应用程序加载的,因为 parent-last class 加载程序委托要求 class 加载程序在委托给父项之前在本地搜索
  5. SaajSoapElement now can "see" both copies of QName, and Java throws a LinkageError, because that violates loading constraints SaajSoapElement 现在可以“看到”两个 QName 的副本,并且 Java 会抛出 LinkageError,因为这违反了加载约束

You can solve this by removing the XML jar containing the QName class from your application (the API is included in the server's JDK), by adding the SOAP API to the application (so the application "sees" both classes from the same location), or by switching your class loading to parent-first. You can solve this by removing the XML jar containing the QName class from your application (the API is included in the server's JDK), by adding the SOAP API to the application (so the application "sees" both classes from the same location),或通过将 class 加载切换到父优先。 Parent-last class loading is generally vulnerable to issues like this, because it allows for more duplicate loading between class loaders than is typically possible under default settings. Parent-last class 加载通常容易受到此类问题的影响,因为它允许 class 加载器之间的重复加载比默认设置下通常可能的加载更多。 If you don't have a very explicit need for your own XML API version (XML APIs have been included in Java SE for a very long time), I'd strongly recommend either removing the jar or switching to parent-first. If you don't have a very explicit need for your own XML API version (XML APIs have been included in Java SE for a very long time), I'd strongly recommend either removing the jar or switching to parent-first.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 LinkageError:加载违反约束 - LinkageError: loading contraint violation LinkageError:加载程序约束违反: - LinkageError: loader constraint violation: java.lang.LinkageError:加载器约束违规:以前为名称为“javax / mail / Session”的其他类型启动加载 - java.lang.LinkageError: loader constraint violation:previously initiated loading for a different type with name “javax/mail/Session” Spring java.lang.LinkageError:加载器约束违规:加载器之前为名称为X的不同类型启动加载 - Spring java.lang.LinkageError: loader constraint violation: loader previously initiated loading for a different type with name X OneToMany 关系上的唯一约束违反 - Unique contraint violation on OneToMany relationship java.lang.LinkageError:先前已启动加载器约束违规,为名称为“javax / xml / soap / SOAPMessage”的其他类型加载 - java.lang.LinkageError: loader constraint violation previously initiated loading for a different type with name “javax/xml/soap/SOAPMessage” java.lang.LinkageError:违反加载程序约束:加载程序先前已启动名称为“ org / json / JSONObject”的其他类型的加载 - java.lang.LinkageError: loader constraint violation: loader previously initiated loading for a different type with name “org/json/JSONObject” 是否可以在程序中捕获 SQL 约束冲突异常? - Is it ok to catch SQL Contraint violation exceptions in program? Hibernate JPA禁令违规和交易已经激活 - Hibernate JPA contraint violation and Transaction already active java.lang.LinkageError:加载器约束违规 - java.lang.LinkageError: loader constraint violation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM