Error running embedded tomcat with gradle – NoClassDef found for org.slf4j.spi.LoggerFactoryBinder

Problem

trying to run an embedded tomcat with the gradle tomcat plugin (https://github.com/bmuschko/gradle-tomcat-plugin)

gradle tomcatRun

but getting the following error:

Caused by: java.lang.ClassNotFoundException: org.slf4j.spi.LoggerFactoryBinder

Solution

likely your gradle is too new.

To resolve the issue, run with an older version of gradle using gradle wrapper.

generate gradle wrapper for your project

gradle wrapper --gradle-version 2.3

then run with

gradlew tomcatRun

 

Tested with

  • installed gradle 2.11
  • gradle wrapper 2.3
  • tomcat 7.0.11
  • windows
Advertisements

Exposing docker container ports in Windows

You might want to map a running docker container to your localhost’s port, but you can’t. For example, you run your image with

docker run -p 8080:8080 myImage

and expect to hit the docker container at http://localhost:8080 … but that doesn’t work.

In Windows, because Docker runs as a VM, it’s localhost refers to the VM’s localhost.

To find out the VM’s ipaddress, run this command

docker-machine ip default

sample output: 192.168.99.100

then you can access the image at http://192.168.99.100:8080