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