Rupert Anderson's Blog

Mainly SoapUI, API, Open Source stuff and Elite Dangerous!

Issue/Fix: SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”


This probably a minor issue for most, but the error message isn’t great and it inhibits (sometimes helpful) log messages in certain situations e.g. when running SoapUI from the shell, testrunner scripts and Maven.


You run SoapUI from the shell / terminal and you see something like:

tests-MacBook-Pro:app test$ ./bin/ 
= SOAPUI_HOME = /Applications/
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
Configuring log4j from [/Applications/]


The error just means that no suitable slf4j logger implementation can be found, as per – the slf4j-api-1.6.1.jar is there in <SoapUI Home>/app/java/lib already. If no suitable logger implementation is added, then the documentation explains that as of version 1.6, the nop logger implementation will be used – but this doesn’t log anything and you get the warning every time.

There are two main options here depending on how you install/use SoapUI. Taking either option should result in no error and potentially extra logging:

tests-MacBook-Pro:app test$ ./bin/
= SOAPUI_HOME = /Applications/
Configuring log4j from [/Applications/]

Option 1 – SoapUI Was Installed Using The Installer

  1. Pick an slf4j logger implementation from  e.g. download slf4j-simple-1.6.1.jar
  2. Add it to <SoapUI Home>/java/app/lib
  3. Try to run SoapUI again and the error message should be gone and logging may be seen.

Option 2 – SoapUI Built & Run From Source Code (Using Maven)

When building and running SoapUI from source code using maven just add the dependency for the chosen logger implementation (see option 1 – step 1) to the pom.xml for the SoapUI project soapui-project/soapui/pom.xml – for example:

<!-- Logging -->
<!-- In-app analytics -->

SoapUI Google Analytics NullPointerException On Ubuntu


This is just a quick post to consolidate my findings when investigating why a Null Pointer Exception occurs in SoapUI when running on Ubuntu. The error occurs in the analytics code when it tries to obtain the machine’s MAC address. For now, I have hopefully found a quick work around explained below.

I tested this when running SoapUI 5.2.1 (built & run from source code) on a clean install of Ubuntu 14.04.4, Java 1.7u79 and running on VirtualBox.

Problem Description

When starting you may see:


Aside from, a similar error can also be seen in when using different areas of functionality.

Looking at either of those classes where the NPE occurs we can see route cause is the same piece of code:

NetworkInterface network = NetworkInterface.getByInetAddress(InetAddress.getLocalHost());
byte mac[] = network.getHardwareAddress();
MessageDigest hasher = MessageDigest.getInstance("SHA-1");
return createHexBinary(hasher.digest(mac));

You can probably see that network is coming back as null.


To understand why, and work around the problem, try running a snippet of the same code with logging added e.g. something like:



public class Main {

   public static void main(String[] args) {

      try {
         NetworkInterface network = NetworkInterface.getByInetAddress(InetAddress.getLocalHost());
         System.out.println("Machine Name="+ InetAddress.getLocalHost());
         System.out.println("Network Interface="+network);
         byte mac[] = network.getHardwareAddress();
         System.out.println("Mac Address="+mac);
         MessageDigest hasher = MessageDigest.getInstance("SHA-1");
         System.out.println("Hashed Mac"+hasher.digest(mac));
      catch(Exception e){
         System.out.println("Error generating Analytics session ID - returning empty String"+ e);

Depending on how your hosts file / network settings are, you may see something like:

Machine Name=ubuntutest-VirtualBox/
Network Interface=null
Error generating Analytics session ID - returning empty Stringjava.lang.NullPointerException

The Machine Name will vary on your machine, but the Network Interface can be seen as null and a NullPointerException is caught. The problem seems to be that NetworkInterface.getByInetAddress cannot match the Machine Name to any of the Network Interface values. Running ifconfg shows that there is indeed no match available:

ubuntutest@ubuntutest-VirtualBox:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 07:07:27:79:d2:07
inet addr: Bcast: Mask:
inet6 addr: fe80::a00:27ff:fe79:d101/64 Scope:Link
RX packets:21 errors:0 dropped:0 overruns:0 frame:0
TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3086 (3.0 KB) TX bytes:10810 (10.8 KB)

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:46 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3559 (3.5 KB) TX bytes:3559 (3.5 KB)


So without fixing the code, one quick solution is to change the /etc/hosts entry for your machine name to use the same IP address as eth0. So in my case, I did something like:

sudo nano /etc/hosts

And added: &nbsp; &nbsp; &nbsp;ubuntutest-VirtualBox

Running the above snippet should then show the Network Interface correctly matched and the Mac Address found e.g.

Machine Name=ubuntutest-VirtualBox/
Network Interface=name:eth0 (eth0)
Mac Address=[B@520b368f
Hashed Mac[B@4a5e88f7

Note – adding a host entry pointing to lo ( solves the first problem of matching the Network Interface, but then fails when the code tries to obtain the MAC address with network.getHardwareAddress() – unlike eth0, the interface lo doesn’t have one!

Starting up SoapUI should now occur without the Analytics NPE.

Code Fix

Aside from having / changing your network settings to help the code work, it would probably be better to fix the code in SoapUI to iterate over the possible Network Interfaces until it finds one with a MAC address. I’ll maybe take more of a look at this later.


There are probably more or even better options for solving this problem, but I just wanted to get some options down in response to various SoapUI Community posts featuring this error for users running on Ubuntu. Hopefully this will help somewhat, please come in with any suggestions / corrections / comments!