How to solve java.lang.LinkageError: loader constraint violation

Hi I'm new to jasperreport I added its plugin to my eclipse IDE but when i come to create a new report i get the folloiwng error
java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.spi.MDCAdapter org.slf4j.MDC.getMDCAdapter()' the class loader @133a8a9f of the current class, ch/qos/logback/classic/spi/LoggingEvent, and the class loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2478dbba for the method's defining class, org/slf4j/MDC, have different Class objects for the type org/slf4j/spi/MDCAdapter used in the signature (ch.qos.logback.classic.spi.LoggingEvent is in unnamed module of loader @133a8a9f, parent loader org.eclipse.osgi.internal.framework.ContextFinder @6192a5d5; org.slf4j.MDC is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2478dbba, parent loader 'platform')
    at ch.qos.logback.classic.spi.LoggingEvent.getMDCPropertyMap(
    at ch.qos.logback.classic.spi.LoggingEvent.prepareForDeferredProcessing(
    at ch.qos.logback.core.OutputStreamAppender.subAppend(
    at ch.qos.logback.core.OutputStreamAppender.append(
    at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(
    at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(
    at ch.qos.logback.classic.Logger.appendLoopOnAppenders(
    at ch.qos.logback.classic.Logger.callAppenders(
    at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(
    at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(
    at ch.qos.logback.classic.Logger.log(
    at org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog.debug(
    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(
    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(
    at org.eclipse.ui.internal.EditorReference.initialize(
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(
anyhelp I'll be thankfull

sabrine.baameur's picture
Joined: Mar 8 2023 - 12:58pm
Last seen: 3 days 9 hours ago

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit for direct access to our technical support teams offering guaranteed response times.

arai_4 - 4 months 2 weeks ago

Thank you waiting forward for your help

sabrine.baameur - 4 months 2 weeks ago

@aria_4 any news?

sabrine.baameur - 4 months 1 week ago
show 3 more...

im also facing the same issue , need help on this 

charuseelan - 4 months 1 week ago

Thank you for your patience, we need a little more time with our team of experts to come up with a solution. We will respond back as soon as we have an answer to your question.

arai_4 - 4 months 3 days ago

Still facing the same issue except that sometimes instead of the previous message error i get the following:

Description Resource Path Location Type
Class net.sf.jasperreports.engine.xml.JRReportSaxParserFactory should be compatible with net.sf.jasperreports.engine.xml.JRSaxParserFactory
Any updates i'll be thankfull

sabrine.baameur - 3 months 1 week ago

2 Answers:

This issue can occur with conflicting library versions.

As per the error it seems there are conflicting versions of the SLF4J (Simple Logging Facade for Java) library in the classpath. The error message suggests that the LoggingEvent class, is attempting to access the a method, but the class loaders for class (org.slf4j.MDC) and the class trying to access it have different Class objects for the org.slf4j.spi.MDCAdapter type.

It seems that the conflict is there with the SLF4J logging library with JasperReports. To resolve the issue, check SLF4J versions you have, remove any conflicting/duplicate libraries, and ensuring compatibility with JasperReports and other plugins you already have.

jmand's picture
Joined: Feb 8 2023 - 11:19am
Last seen: 1 hour 42 min ago


any updates cause i'm still facing the same problem and what i noticed is that just before the problem mentioned before raises i get this error:
net.sf.jasperreports.engine.JRRuntimeException: Class net.sf.jasperreports.engine.xml.JRReportSaxParserFactory should be compatible with net.sf.jasperreports.engine.xml.JRSaxParserFactory.
    at net.sf.jasperreports.engine.xml.BaseSaxParserFactory.getFactory(
    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(
    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(
    at net.sf.jasperreports.eclipse.util.ReportLoader.loadReport(
    at net.sf.jasperreports.eclipse.ui.ReportPreviewUtil$
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
    at org.eclipse.swt.widgets.Display.runAsyncMessages(
    at org.eclipse.swt.widgets.Display.readAndDispatch(
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
    at org.eclipse.ui.internal.Workbench.lambda$3(
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.base/java.lang.reflect.Method.invoke(
    at org.eclipse.equinox.launcher.Main.invokeFramework(
    at org.eclipse.equinox.launcher.Main.basicRun(
    at org.eclipse.equinox.launcher.Main.main(
I don't know if it has a connection with the other error or not
any siggetions i'll be thankful

sabrine.baameur's picture
Joined: Mar 8 2023 - 12:58pm
Last seen: 3 days 9 hours ago