-2

Hi I tried multiple combinations of including dependencies of scala logging, however I'm getting runtime error as method init not found.

For detailed code and error I'm getting, please have a look here at my Github repository.

PS: I do know there are exisiting similar threads there but all those solutions seems to be not working in my case, so had to create this seperate thread with detailed code and error message.

Any help will be highly appreciated. Thanks in advance.

beingmanish
  • 1,040
  • 8
  • 21

1 Answers1

3

Your import is wrong. It should be

import com.typesafe.scalalogging.LazyLogging 

and not

import com.typesafe.scalalogging.slf4j.LazyLogging
P3trur0
  • 3,155
  • 1
  • 13
  • 27
  • Error: ` Exception in thread "main" java.lang.NoSuchMethodError: com.typesafe.scalalogging.LazyLogging.$init$(Lcom/typesafe/scalalogging/LazyLogging;)V at com.manish.practice.sbtDependencies.HelloWordlWithScalaLogging$.(HelloWordlWithScalaLogging.scala:10) at com.manish.practice.sbtDependencies.HelloWordlWithScalaLogging$.(HelloWordlWithScalaLogging.scala) at com.manish.practice.sbtDependencies.HelloWordlWithScalaLogging.main(HelloWordlWithScalaLogging.scala ` – beingmanish Sep 02 '17 at 10:40
  • For updated code see [here](https://github.com/manish-tiwari/PracticeScala/pull/2/commits/0ae3441fc3705b7d903de1b594d168ae8a8f8848). – beingmanish Sep 02 '17 at 10:48
  • @beingManish please see that now your sbt dependency definition seems wrong. It should be: `"com.typesafe.scala-logging" %% "scala-logging" % "3.7.2"` However I did a small PR on your repo fixing the problem. Please see [here](https://github.com/manish-tiwari/PracticeScala/pull/3) – P3trur0 Sep 03 '17 at 09:06
  • Hi @beingManish thanks for inviting me to this thread. Looks like your issue has been resolved. For others who need help with setting up sbt dependency for scala-logging, I provide a step-by-step tutorial at [http://allaboutscala.com](http://allaboutscala.com/tutorials/chapter-1-getting-familiar-intellij-ide/getting-started-sbt-import-dependencies-build-sbt/) – Nadim Bahadoor Sep 04 '17 at 20:20