Plugin development, package conflict issues

Source: Internet
Author: User

Recently encountered a package conflict problem in development, in the development of plug-in C relies on the Org.json package. However, the following error has been reported in use:

Java.lang.LinkageError:loader constraint Violation:when Resolving interface method "Package.class.method (jlpackage/ class;) Ljava/lang/object; "The class loader (instance of Org/eclipse/osgi/internal/baseadaptor/defaultclassloader) of The current class, Package/class, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/  Defaultclassloader) for resolved class, Package/class, with different class objects for the type Package/class used in the Signature
Loader constraint Violation:loader (instance of Org/eclipse/osgi/internal/baseadaptor/defaultclassloader) previously Initiated loading for a different type with name

In the online search, reference http://blog.csdn.net/zhuzhenlong998/article/details/7744953 This article , the article said

A relies on b,b to reference third-party packages,

Then if C is dependent on a, and the third party package is referenced, C's ClassLoader loads the third-party package, and B's ClassLoader also loads the third-party package, and a packet conflict occurs.

But A/b is provided by other departments of the existing plug-ins, I do not know which plug-in reference Org.json, it is not possible to change their plug-ins, try to put their own plug-in Org.json dependency removed.

OK, plugin code error, because missing Org.json reference.

Then, add Org.json in imported packages, the plugin code error disappears.

Run the program, normal operation!

Plugin development, package conflict issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.