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.

SBT > 1.0 NullPointerException in JavaNetAuthenticator

See original GitHub issue

steps

Populating ~/.sbt/repositories file with

[repositories]
  local
  artifactory-libs-release: http://example.com/artifactory/libs-release
  artifactory-libs-snapshot: http://example.com/artifactory/libs-snapshot
  artifactory-plugin-release: http://example.com/artifactory/plugin-release
  artifactory-plugin-snapshot: http://example.com/artifactory/plugin-snapshot
  artifactory-libs-release-ivy: http://example.com/artifactory/libs-release , [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]

Populating ~/.sbt/0.13/plugins/credentials.sbt and ~/.sbt/1.0/plugins/credentials.sbt with:

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

Exporting

export SBT_OPTS=-Dsbt.override.build.repos=true
export SBT_CREDENTIALS=$HOME/.sbt/.credentials

Running

sbt clean test +publish

On a project with

  scalaVersion := "2.11.11",
  crossScalaVersions := Seq("2.11.11", "2.12.3")

build.properties

sbt.version=1.0.1

problem

The build fails with the following message:

build 12-Sep-2017 11:43:14 [error] unresolved dependency: io.netty#netty;3.7.0.Final: java.lang.NullPointerException at okhttp3.JavaNetAuthenticator.authenticate(JavaNetAuthenticator.java:37)

The project also relies on a plugin that has been cross-built to 0.13.16 and 1.0.0

expectation

The build to pass. Changing the sbt.version in build.properties to 0.13.16 works fine.

notes

sbt version: 1.0 and 1.0.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:15
  • Comments:23 (8 by maintainers)

github_iconTop GitHub Comments

6reactions
francisdbcommented, May 17, 2018

Pretty crazy that this has not been fixed yet after more than a half year, anything we can do to get this going?

5reactions
eed3si9ncommented, Sep 12, 2017

Thanks for the report.

Could you try the following as a workaround please:

updateOptions := updateOptions.value.withGigahorse(false)
Read more comments on GitHub >

github_iconTop Results From Across the Web

scala - SBT hangs waiting for orphaned subprocess to complete
Try daemonising the background process like so (run_subprocess >/dev/null 2>&1 &). The issue could be output from run_subprocess still going ...
Read more >
sbt Reference Manual — sbt 1.0.x releases
This is a hotfix release for sbt 1.0.x series. ... Gigahorse to workaround NPE in JavaNetAuthenticator when used in conjunction with repositories override....
Read more >
Could not run test java.lang.NullPointerException
I am encountering this same stack trace, though reproducible 100% of the time when running my tests via test:test through sbt. On the...
Read more >
Scalac throws a NullPointerException (Possible BUG) - Question
Scala compiler throws a NullPointerException when it tries to infer a ... [info] Loading global plugins from /home/angelcc/.sbt/1.0/plugins ...
Read more >
NullPointerException (Java SE 12 & JDK 12 )
Class NullPointerException. java.lang.Object ... public class NullPointerException extends RuntimeException ... Since: 1.0; See Also: Serialized Form ...
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