Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

loader constraint violation

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

25-10-2018

Hello Team,

I am facing a unique issue with JSON Exporter on my local machine.

Whenever I try running a JSON Exporter service I receive below error in the log file.

org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

java.lang.LinkageError: loader constraint violation: when resolving method "com.fasterxml.jackson.core.JsonFactory.setCharacterEscapes(Lcom/fasterxml/jackson/core/io/CharacterEscapes;)Lcom/fasterxml/jackson/core/JsonFactory;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, org/apache/sling/models/jacksonexporter/impl/JacksonExporter, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for the method's defining class, com/fasterxml/jackson/core/JsonFactory, have different Class objects for the type com/fasterxml/jackson/core/io/CharacterEscapes used in the signature

Below is the POM definition for Jackson Jar's.

              <dependency>

                <groupId>com.fasterxml.jackson.core</groupId>

                <artifactId>jackson-core</artifactId>

                <version>2.3.2</version>

                <scope>provided</scope>

            </dependency>

            <dependency>

                <groupId>com.fasterxml.jackson.core</groupId>

                <artifactId>jackson-databind</artifactId>

                <version>2.3.2</version>

                <scope>provided</scope>

            </dependency>

            <dependency>

                <groupId>com.fasterxml.jackson.core</groupId>

                <artifactId>jackson-annotations</artifactId>

                <version>2.3.2</version>

                <scope>provided</scope>

            </dependency>

Strange enough the same code works fine on another server, but fails on my machine.. have tried all possible options.

Any ideas/suggestions directions would really help.

Thank you..

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

137 likes

Total Posts

541 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

137 likes

Total Posts

541 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

25-10-2018

Dear Atul,

You shouldn't need to define versions or these 3 dependencies in your code base.

They should be coming form the Uber-Jar. The only caveat is that Uber-Jar version needs to be the same version as your AEM instance.

Regards,

Peter

Answers (4)

Answers (4)

Avatar

Avatar
Boost 1
Level 1
mayanks84410489
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
mayanks84410489
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
mayanks84410489
Level 1

29-01-2020

Restart the causing server from felix console and try again.

Regards,

Mayank Saxena

Cognizant

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,090 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,090 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

26-10-2018

Hi,

That's a classloader issue. Which bundle is exporting the package "com.fasterxml.jackson.core"? Maybe it's exported by the System Bundle (and then it's taken from the JRE itself) and also exported by a bundle which embeds a copy of the jackson library?

Jörg

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

26-10-2018

Sure, Thank you for this suggestion PuzanovsP  I'll try removing it.

I am working on AEM 6.2 SP1 CFP16 system. So the uber jar 6.2 is in use. I'll de-compile 6.2 uber-jar and see if I figure out the root cause.

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

25-10-2018

Strange enough, I bumped up the the versions of jackson-core, jackson-annotations, & jackson-databind to near high version (2.6.0)

And the issue seems to be resolved.

I am still not clear the exact root cause for the loader constraint voilation with version (2.3.2) which failed only on my local machine.