You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by Alejandro Fernandez <af...@hortonworks.com> on 2017/06/14 18:42:34 UTC

Compile error due to older jar

Hi all, if you run into this issue compiling ambari, please remove older sl4j jars from your maven repo.

https://www.slf4j.org/codes.html
java.lang.NoClassDefFoundError: org/slf4j/event/LoggingEvent

Logback-classic version 1.1.4 and later require slf4j-api version 1.7.15 or later.

With an earlier slf4j-api.jar in the classpath, attempting introspection of a Logger instance returned by logback version 1.1.4 or later will result in a NoClassDefFoundError similar to that shown below.

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/event/LoggingEvent
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
        at java.lang.Class.privateGetPublicMethods(Class.java:2571)
        at java.lang.Class.getMethods(Class.java:1429)
        at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1261)
        at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1122)
        at java.beans.Introspector.getBeanInfo(Introspector.java:414)
        at java.beans.Introspector.getBeanInfo(Introspector.java:161)


Placing slf4j-api.jar version 1.7.15 or later in the classpath should solve the issue.

Note that this problem only occurs with logback version 1.1.4 and later, other bindings such as slf4j-log4j, slf4j-jdk14 and slf4j-simple are unaffected.

Thanks,
Alejandro

From: Tim Thorpe <tt...@ca.ibm.com>>
Date: Tuesday, June 13, 2017 at 3:15 PM
To: Jaimin Jetly <ja...@hortonworks.com>>
Cc: Alejandro Fernandez <af...@hortonworks.com>>
Subject: Re: Please fix and recommit ambari tasks (AMBARI-20122 and AMBARI-21202)

Hi Jaimin,

I have been trying to get a cluster working with the latest trunk code and it is failing to start ambari-server.  I end up getting this in the log:

Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
        at org.slf4j.impl.JDK14LoggerAdapter.info(JDK14LoggerAdapter.java:303)
        at org.apache.ambari.server.controller.ControllerModule.getPersistenceProperties(ControllerModule.java:221)
        at org.apache.ambari.server.controller.ControllerModule.buildJpaPersistModule(ControllerModule.java:416)
        at org.apache.ambari.server.controller.ControllerModule.configure(ControllerModule.java:343)
        at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)

Not sure if this is due to the changes Alejandro put in.

I ended up reverting some of the jars to the previous version:
-rw-r--r--  1 root root    4952 Jun 13 12:29 jul-to-slf4j-1.7.2.jar
-rw-r--r--  1 root root   26083 Jun 13 12:26 slf4j-api-1.7.2.jar
-rw-r--r--  1 root root    8819 Jun 13 12:26 slf4j-log4j12-1.7.2.jar

It still failed after reverting those jars, then I removed these:
-rw-r--r--  1 root root    8815 Jun 13 11:01 slf4j-jdk14-1.5.6.jar
-rw-r--r--  1 root root    5201 Jun 13 11:01 slf4j-nop-1.5.3.jar

After that ambari-server was able to start successfully.

I haven't played around to figure out whether reverting the jars was necessary or not.
__________________________________________
Tim Thorpe
IBM Information Management - Ottawa Lab
Email: tthorpe@ca.ibm.com<ma...@ca.ibm.com>




From:        Jaimin Jetly <ja...@hortonworks.com>>
To:        "tthorpe@ca.ibm.com<ma...@ca.ibm.com>" <tt...@ca.ibm.com>>
Date:        06/12/2017 07:02 PM
Subject:        Please fix and recommit ambari tasks
________________________________



Hi Tim,

I had to revert following two commits as it was blocking folks from deploying clusters with selective services:

commit 0b6d0dcef10ec60c83ad055567b487104573ae62
Author: Tim Thorpe <tt...@apache.org>>
Date:   Thu Jun 8 08:51:30 2017 -0700

   AMBARI-20122 - Stack advisor needs to recommend dependency forslaves and masters

commit 7dc91c5a8e75966f642a4890ed7a5750687b5928
Author: Tim Thorpe <tt...@apache.org>>
Date:   Thu Jun 8 08:49:32 2017 -0700

   AMBARI-21202 - YARN service advisor has spelling error in yarn-site


I have reopened the respective Jiras. Please recommit them with the scenario of deploying selective services fixed.

-- Thanks
​    Jaimin