question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException during resolution

See original GitHub issue

Hi.

I’m using the sbt coursier plugin 1.0.0-M14-8 and sometimes when I’m trying to run sbt task I get this:

$ sbt stage              
[info] Loading global plugins from /home/claudio/.sbt/0.13/plugins
[info] Loading project definition from /home/claudio/src/search/project
[info] Updating search-build
[info] Resolved search-build dependencies
[info] Fetching artifacts of search-build
[info] Fetched artifacts of search-build
[info] Compiling 1 Scala source to /home/claudio/src/search/project/target/scala-2.10/sbt-0.13/classes...
[warn] /home/claudio/src/search/project/Build.scala:4: trait Build in package sbt is deprecated: Use .sbt format instead
[warn] object Build extends SbtBuild {
[warn]                      ^
[warn] one warning found
[info] Set current project to my-search (in build file:/home/claudio/src/search/)
[info] Packaging /home/claudio/src/search/target/scala-2.11/my-search_2.11-1.7.1-tests-sources.jar ...
[info] Packaging /home/claudio/src/search/target/scala-2.11/my-search_2.11-1.7.1-sources.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Updating search
[info] Resolved search dependencies
coursier.ResolutionException: Exception during resolution
Caused by: java.lang.NullPointerException
	at coursier.Cache$$anonfun$validateChecksum$1.<init>(Cache.scala:797)
	at coursier.Cache$.validateChecksum(Cache.scala:797)
	at coursier.Cache$$anonfun$file$1.apply(Cache.scala:885)
	at coursier.Cache$$anonfun$file$1.apply(Cache.scala:882)
	at scalaz.EitherT$$anonfun$flatMap$1$$anonfun$apply$4.apply(EitherT.scala:93)
	at scalaz.$bslash$div.fold(Either.scala:58)
	at scalaz.EitherT$$anonfun$flatMap$1.apply(EitherT.scala:93)
	at scalaz.EitherT$$anonfun$flatMap$1.apply(EitherT.scala:93)
	at scalaz.concurrent.Task$$anonfun$flatMap$1$$anonfun$1.apply(Task.scala:35)
	at scalaz.concurrent.Task$$anonfun$flatMap$1$$anonfun$1.apply(Task.scala:35)
	at scalaz.concurrent.Task$.Try(Task.scala:457)
	at scalaz.concurrent.Task$$anonfun$flatMap$1.apply(Task.scala:35)
	at scalaz.concurrent.Task$$anonfun$flatMap$1.apply(Task.scala:33)
	at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:55)
	at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:55)
	at scalaz.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:58)
	at scalaz.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:58)
	at scalaz.concurrent.Future.step(Future.scala:118)
	at scalaz.concurrent.Future.unsafePerformListen(Future.scala:75)
	at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79)
	at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79)
	at scalaz.Free$$anonfun$map$1.apply(Free.scala:91)
	at scalaz.Free$$anonfun$map$1.apply(Free.scala:91)
	at scalaz.Free.resume(Free.scala:109)
	at scalaz.Free.go2$1(Free.scala:153)
	at scalaz.Free.go(Free.scala:157)
	at scalaz.Free.run(Free.scala:263)
	at scalaz.concurrent.Future.unsafePerformListen(Future.scala:76)
	at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79)
	at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79)
	at scalaz.Free$$anonfun$map$1.apply(Free.scala:91)
	at scalaz.Free$$anonfun$map$1.apply(Free.scala:91)
	at scalaz.Free.resume(Free.scala:109)
	at scalaz.Free.go2$1(Free.scala:153)
	at scalaz.Free.go(Free.scala:157)
	at scalaz.Free.run(Free.scala:263)
	at scalaz.concurrent.Future$$anonfun$apply$15$$anon$3.call(Future.scala:432)
	at scalaz.concurrent.Future$$anonfun$apply$15$$anon$3.call(Future.scala:432)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
[error] (*:coursierResolution) coursier.ResolutionException: Exception during resolution

Usually, if I try the same command again, it works OK. So probably some kind of race condition?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
eed3si9ncommented, Dec 17, 2019

@tarun29061990 I don’t see how this stack trace relates to Coursier.

1reaction
tarun29061990commented, Dec 17, 2019

Facing the same on osx catalina while running ./activator compile

[info] Loading global plugins from /Users/tarun/.sbt/0.13/plugins
[info] Updating {file:/Users/tarun/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
java.lang.NullPointerException
	at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
	at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
	at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
	at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
	at java.base/java.util.regex.Pattern.split(Pattern.java:1261)
	at java.base/java.util.regex.Pattern.split(Pattern.java:1334)
	at sbt.IO$.pathSplit(IO.scala:744)
	at sbt.IO$.parseClasspath(IO.scala:859)
	at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:62)
	at sbt.compiler.AggressiveCompile.withBootclasspath(AggressiveCompile.scala:50)
	at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:83)
	at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
	at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
	at sbt.Compiler$.apply(Compiler.scala:74)
	at sbt.Compiler$.apply(Compiler.scala:65)
	at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:789)
	at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:781)
	at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:781)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:235)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:835)
[error] (compile:compile) java.lang.NullPointerException
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
java - What is a NullPointerException, and how do I fix it?
A null pointer exception is thrown when an application attempts to use null in a case where an object is required.
Read more >
How to Resolve the java.lang.NullPointerException? - STechies
The error is raised when the code tries to access a reference variable that points to a null value. It can be resolved...
Read more >
How to resolve a NullPointerException in Java? - Tutorialspoint
A NullPointerException is a runtime exception thrown by the JVM when our application code, other referenced API or the middleware encounters ...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException is a runtime exception, so we don't need to catch it in the program. NullPointerException is raised in an application when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found