0

I have

compile 'org.slf4j:slf4j-jdk14:1.0'

in my dependencies, still getting

Caused by: java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder

when running

gradle clean tomcatRun

what is wrong with this tomcat class loader?

Maladec VampaYa
  • 351
  • 3
  • 21

2 Answers2

0

Has your tomcatRun task got a classpath from compile?

configurations{
    tomcatRun 
}

dependecies{
     compile 'org.slf4j:slf4j-jdk14:1.0'
     tomcatRun configurations.compile
}

tomcatRun{
    classpath = configurations.tomcatRun 
}
CyberAleks
  • 1,545
  • 1
  • 14
  • 17
0

I don't know if it will work for you with tomcatRun, but for tomcastJasper, I added dependencies to the tomcat configuration where you set the tomcat version information:

dependencies {
   def tomcatVersion = '8.0.42'
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
           "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}",
           "javax.servlet:jstl:1.2"
}