Giter Site home page Giter Site logo

java.lang.LinkageError: loader constraint violation: loader 'app' (instance of jdk.internal.loader.ClassLoaders about bridgeservice HOT 4 CLOSED

adobe avatar adobe commented on June 19, 2024
java.lang.LinkageError: loader constraint violation: loader 'app' (instance of jdk.internal.loader.ClassLoaders

from bridgeservice.

Comments (4)

baubakg avatar baubakg commented on June 19, 2024

Problem resolved but not reproduced as unit test.
Adding the package in the IBS.CLASSLOADER.STATIC.INTEGRITY.PACKAGES environment variable solves this.

from bridgeservice.

baubakg avatar baubakg commented on June 19, 2024

Have been able to reproduce issue. Problem related to lazy instantiation of a class which is not loaded in the class loader.

from bridgeservice.

baubakg avatar baubakg commented on June 19, 2024

The issue shows up it seems due to lazy instantiation of classes which are not in the static integrity path. In this case neither of the calls actually accesses Element.

The exact use case definition is, given a call similar to the following:

{
	"timeout": 1200000,
	"callContent": {
		"call1": {
			"class": "com.adobe.campaign.tests.bridge.testdata.issue34.callerpkg.CalledClass1",
			"method": "calledMethod",
			"returnType": "java.lang.String",
			"args": [
			]
		},
		"call2": {
			"class": "com.adobe.campaign.tests.bridge.testdata.issue34.callerpkg.CalledClass2",
			"method": "calledMethod",
			"returnType": "java.lang.String",
			"args": [
			]
		}
	}
}

Here are the circumstances:

  • At least two calls.
  • None of the called methods actually use the class MiddleMan
  • The first call, call1, accesses a class that contains an unused method that "returns" MiddleMan.
  • The second call, call2, accesses a class that has a constant is if the type MiddleMan. The constant is initiated using a factory in a different package.
  • The factory class should be in a different package than the packages for call1 and call2.
  • None of the packages (even in a higher package level) are declared in the bridgeService property : IBS.CLASSLOADER.STATIC.INTEGRITY.PACKAGES

from bridgeservice.

baubakg avatar baubakg commented on June 19, 2024

This is not a regression.

The difference is the dynmic loading of the classes.
Here is the exact problem definition:

We have two classes a.lass1, a.Class2 each calling a.ClassA.
If we include a. in our path, all is well.
If Class2 calls another class b.Class3 which initself calls a.ClassA you will get the LinkageError. This is because b.Class3 will NOT be loaded by our classloader, and it will access a.ClassA.

Two solutions exist:

  1. Our classloader systematically loads anything it can load.
  2. We require users to load their packages.

Option 1 will probably load a lot of data in memory.
Option 2 will be less memory, but requires that users configure the project better.

from bridgeservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.