Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
JessevdW
Contributor II
Contributor II

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Talend Log4J competing implementation error

Hey all,

 

I've run into a problem after building a very simple Route that I use for a demo. Some information

on my configurations.

  • I'm running Talend Cloud Real-Time Big Data Platform version 7.2.1
  • I'm using Java SE 8 [1.8.0_151] (but i've also tried 1.8.0_171)
  • The bindings shown in Talend are as follows:

    Starting job PostDataConsumer at 10:47 19/09/2019.

     

    SLF4J: Class path contains multiple SLF4J bindings.

    SLF4J: Found binding in [jar:file:/*/Talend/Talend-Studio-20190620_1446-V7.2.1/configuration/.m2/repository/org/apache/activemq/activemq-all/5.15.9/activemq-all-5.15.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]

    SLF4J: Found binding in [jar:file:/*/Talend/Talend-Studio-20190620_1446-V7.2.1/configuration/.m2/repository/org/talend/libraries/slf4j-log4j12-1.7.5/6.0.0/slf4j-log4j12-1.7.5-6.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]

    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

    [statistics] connecting to socket on port 3715

    [statistics] connected

     

    Job PostDataConsumer ended at 10:47 19/09/2019. [exit code=0]

Whenever i try to run the PostDataConsumer.sh file (made by Talend after I build the route) i get the following error:

 

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from jar:file:/Users/jessevanderwolf/Documents/Projects/School/IntoData/SimpleMicroserviceUseCase/PostDataConsumer/PostDataConsumer_0.1.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.5-6.0.0.jar!/). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:655)
at org.springframework.util.Assert.isInstanceOf(Assert.java:555)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:286)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:102)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:220)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:199)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at microservices.postdataconsumer_0_1.PostDataConsumer.main(PostDataConsumer.java:353)
... 8 more

 

I've already tried the following:

  1. Disable Log4j in compontents via File > Project Settings > Log4j
  2. Make an exclusion like the documentation -> http://www.slf4j.org/codes.html#multiple_bindings suggests
  3. use different Java jdk's [1.8.0_151, 1.8.0_171]

Hope you guys can help me out.

Labels (3)
1 Solution

Accepted Solutions
JessevdW
Contributor II
Contributor II
Author

Seems like downloading the latest patch fixed the issue. The build where i encountered the issue 

was as follows:

 

Version: 7.2.1

Build id: 20190725_0259

 

The latest patch i downloaded via the talend portal, configured and tested the route on

was as follows:

 

Version: 7.2.1

Build id: 20190909_1200_patch

 

You can look up this in information in the studio via Talend Studio > About talend studio.

View solution in original post

5 Replies
Anonymous
Not applicable

Hello,

Could you please post the full error stack trace here? We have a known ESB issue in V 7.2.1.

Are you running your route as MicroService jar?

Best regards

Sabrina

JessevdW
Contributor II
Contributor II
Author

Hey xdshi,

 

I've added the stack trace to the main question.

 

I'm using a Talend route which contains a cMQConnectionfactory component and a cJMS componentent. It also calls a subjob. This is because the standard cHttp component in the route did not work (different issue) so I used a subjob to do a Http request using the tHttpRequest component.

 

I've also added the Talend project in a zipfile.

 

Jesse


SampleProject.zip
Spretorius
Contributor
Contributor

Hi 

Just a follow up also experiencing the same problem on ESB 7.2.1 when exporting as a micro service.jar to docker. What is the current state of the bug and is there any work around that can be used?

Regards,

JessevdW
Contributor II
Contributor II
Author

Seems like downloading the latest patch fixed the issue. The build where i encountered the issue 

was as follows:

 

Version: 7.2.1

Build id: 20190725_0259

 

The latest patch i downloaded via the talend portal, configured and tested the route on

was as follows:

 

Version: 7.2.1

Build id: 20190909_1200_patch

 

You can look up this in information in the studio via Talend Studio > About talend studio.

Auser1635229904
Contributor
Contributor

Spring boot automatically configures the LogBack because of the web starter. According to this documentation, we should remove the default logback module from the project