java.lang.NoClassDefFoundError:scala / reflect / internal / Trees

时间:2014-08-04 19:37:02

标签: java scala maven sbt noclassdeffounderror

我最近遇到了无法访问maven repo的问题。这是通过以下方式解决的:

https://issues.sonatype.org/browse/MVNCENTRAL-485

然后,在我删除了〜/ .ivy / cache之后,弹出以下java错误:

java.lang.NoClassDefFoundError: scala/reflect/internal/Trees
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.ClassLoader.defineClass1(Native Method)   
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at xsbt.boot.Pre$.xsbt$boot$Pre$$classMissing$1(Pre.scala:68)
    at xsbt.boot.Pre$$anonfun$getMissing$1.apply(Pre.scala:69)
    at   scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at org.apache.ivy.core.RelativeUrlResolver.filter(RelativeUrlResolver.java:263)
    at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
    at xsbt.boot.Pre$.getMissing$d83f809$3a8a6f87(Pre.scala:69)
    at xsbt.boot.Launch.checkLoader$2accd70c(Launch.scala:131)
    at xsbt.boot.Launch.xsbt$boot$Launch$$provider$1(Launch.scala:189)
    at xsbt.boot.Launch$$anonfun$xsbt$boot$Launch$$getScalaProvider0$2.apply(Launch.scala:192)
    at xsbt.boot.Launch$$anonfun$xsbt$boot$Launch$$getScalaProvider0$2.apply(Launch.scala:191)
    at scala.Option.flatMap(Option.scala:170)
    at xsbt.boot.Launch.xsbt$boot$Launch$$getScalaProvider0(Launch.scala:191)
    at xsbt.boot.Launch$$anon$3.call(Launch.scala:180)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at xsbt.boot.Launch.locked(Launch.scala:178)
    at xsbt.boot.Launch.getScalaProvider(Launch.scala:180)
    at xsbt.boot.Launch$$anonfun$1.apply(Launch.scala:87)
    at xsbt.boot.Cache.newEntry(Cache.scala:17)
    at xsbt.boot.Cache.apply(Cache.scala:12)
    at xsbt.boot.Launch.getScala(Launch.scala:90)
    at xsbt.boot.Launch.getScala(Launch.scala:89)
    at xsbt.boot.Launch.xsbt$boot$Launch$$getAppProvider0(Launch.scala:160)
    at xsbt.boot.Launch$$anon$2.call(Launch.scala:142)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
    at xsbt.boot.Using$.withResource(Using.scala:11)
    at xsbt.boot.Using$.apply(Using.scala:10)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at xsbt.boot.Launch.locked(Launch.scala:178)
    at xsbt.boot.Launch.app(Launch.scala:93)
    at xsbt.boot.Launch.app(Launch.scala:91)
    at xsbt.boot.Launch$.run(Launch.scala:51)
    at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
    at xsbt.boot.Launch$.launch(Launch.scala:65)
    at xsbt.boot.Launch$.apply(Launch.scala:16)
    at xsbt.boot.Boot$.runImpl(Boot.scala:32)
    at xsbt.boot.Boot$.main(Boot.scala:21)
    at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: scala.reflect.internal.Trees
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 69 more

我对scala很新。有没有人对此有任何想法?

1 个答案:

答案 0 :(得分:2)

当依赖关系io.gatling.highcharts和gatling-maven-plugin之间存在依赖性不匹配时,我遇到了这个异常。最简单的解决方案是使用它们中的最新版本。