Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.5.0] java.lang.NoClassDefFoundError: com/typesafe/scalalogging/Logger #69

Closed
ducminhgd opened this issue Oct 10, 2016 · 2 comments
Closed

Comments

@ducminhgd
Copy link

ducminhgd commented Oct 10, 2016

My system information:

  • Scala: 2.11.8
  • SBT: 0.13.8

Import line in code file: import com.typesafe.scalalogging.Logger

Added these 2 lines in build.sbt file:

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0"

Build successfully but when running jar file, I got this

Exception in thread "main" java.lang.NoClassDefFoundError: com/typesafe/scalalogging/Logger
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:720)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:185)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:210)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:124)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: com.typesafe.scalalogging.Logger
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 10 more
@JJ
Copy link

JJ commented Oct 29, 2016

All seems legit. Without more information, it's difficult to say... how are you running the jar file? Where are you running it?

@analytically
Copy link
Collaborator

Basically, if your dependency tree includes the older scala-logging-slf4j artifact you'll see this exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants