ClassNotFoundException - Multi Project build
See original GitHub issueHi there -
Ran into an odd issue when I was leveraging this in a multi-project build with scalafmtOnCompile := true. If I ran:
sbt "project someProject" clean reload compile
I would receive an exception (noted below).
However, if I ran:
sbt clean
and then sbt "project someProject" reload compile
Things worked as intended. Not sure exactly what’s going on here.
[error] java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException: com.lucidchart.scalafmt.impl.ScalafmtFactory [error] at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:502) [error] at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:461) [error] at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:83) [error] at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:142) [error] at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2453) [error] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2417) [error] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) [error] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) [error] at com.google.common.cache.LocalCache.get(LocalCache.java:4147) [error] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) [error] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$.$anonfun$buildSettings$4(ScalafmtCorePlugin.scala:234) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$.$anonfun$scalafmtCoreSettings$26(ScalafmtCorePlugin.scala:154) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42) [error] at sbt.std.Transform$$anon$4.work(System.scala:64) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:266) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) [error] Caused by: java.lang.ClassNotFoundException: com.lucidchart.scalafmt.impl.ScalafmtFactory [error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [error] at com.lucidchart.sbt.scalafmt.BridgeClassLoader.findClass(BridgeClassLoader.scala:11) [error] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [error] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$$anon$1.load(ScalafmtCorePlugin.scala:230) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$$anon$1.load(ScalafmtCorePlugin.scala:227) [error] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708) [error] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416) [error] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) [error] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) [error] at com.google.common.cache.LocalCache.get(LocalCache.java:4147) [error] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) [error] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$.$anonfun$buildSettings$4(ScalafmtCorePlugin.scala:234) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$.$anonfun$scalafmtCoreSettings$26(ScalafmtCorePlugin.scala:154) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42) [error] at sbt.std.Transform$$anon$4.work(System.scala:64) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:266) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) [error] java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException: com.lucidchart.scalafmt.impl.ScalafmtFactory [error] at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:502) [error] at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:481) [error] at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:83) [error] at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:142) [error] at com.google.common.cache.LocalCache$LoadingValueReference.waitForValue(LocalCache.java:3755) [error] at com.google.common.cache.LocalCache$Segment.waitForLoadingValue(LocalCache.java:2319) [error] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2306) [error] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) [error] at com.google.common.cache.LocalCache.get(LocalCache.java:4147) [error] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) [error] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$.$anonfun$buildSettings$4(ScalafmtCorePlugin.scala:234) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$.$anonfun$scalafmtCoreSettings$26(ScalafmtCorePlugin.scala:154) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42) [error] at sbt.std.Transform$$anon$4.work(System.scala:64) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:266) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) [error] Caused by: java.lang.ClassNotFoundException: com.lucidchart.scalafmt.impl.ScalafmtFactory [error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [error] at com.lucidchart.sbt.scalafmt.BridgeClassLoader.findClass(BridgeClassLoader.scala:11) [error] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [error] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$$anon$1.load(ScalafmtCorePlugin.scala:230) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$$anon$1.load(ScalafmtCorePlugin.scala:227) [error] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708) [error] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416) [error] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) [error] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) [error] at com.google.common.cache.LocalCache.get(LocalCache.java:4147) [error] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) [error] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$.$anonfun$buildSettings$4(ScalafmtCorePlugin.scala:234) [error] at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$.$anonfun$scalafmtCoreSettings$26(ScalafmtCorePlugin.scala:154) [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42) [error] at sbt.std.Transform$$anon$4.work(System.scala:64) [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:266) [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167) [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:8
Top GitHub Comments
I ran into the same issue. In my case, the cause was
libraryDependencies :=
instead oflibraryDependencies ++=
. Hope it may help some of you 😉Same here. Error still persists.
1.2.3
1.15
0.1.0