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.

errors found in build.sbt are reported with no position (java.lang.ArrayIndexOutOfBoundsException: -1)

See original GitHub issue

This build.sbt:

lazy val bob = scala.Console println

Will crash sbt with no indication whatsoever what happened, where or why. (My real one is more than one line.) The expression is valid scala.

[info] Loading project definition from /Users/paulp/scratch/2014-03-12_sbt_1/project
java.lang.ArrayIndexOutOfBoundsException: -1
    at scala.reflect.internal.util.OffsetPosition.column(Position.scala:249)
    at scala.reflect.internal.util.Position$.formatMessage(Position.scala:33)
    at scala.tools.nsc.reporters.ConsoleReporter.printMessage(ConsoleReporter.scala:49)
    at scala.tools.nsc.reporters.ConsoleReporter.print(ConsoleReporter.scala:52)
    at scala.tools.nsc.reporters.ConsoleReporter.display(ConsoleReporter.scala:78)
    at scala.tools.nsc.reporters.AbstractReporter.info0(AbstractReporter.scala:49)
    at scala.tools.nsc.reporters.Reporter$$anonfun$error$1.apply$mcV$sp(Reporter.scala:70)
    at scala.tools.nsc.reporters.Reporter$$anonfun$error$1.apply(Reporter.scala:70)
    at scala.tools.nsc.reporters.Reporter$$anonfun$error$1.apply(Reporter.scala:70)

The “full log”, or at least it is so implied:

[error] java.lang.ArrayIndexOutOfBoundsException: -1
[error] Use 'last' for the full log.
[debug] > load-failed
[debug] > last
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

If the implied empty param list is given, it compiles.

lazy val bob = scala.Console println ()

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
paulpcommented, Apr 16, 2014

Your implied crash repro golf challenge does not go unnoticed. 4 chars.

run+
0reactions
stillyetanothergithubusercommented, Oct 14, 2014

Just ran across this error after I accidentally added an “s” after one of 17 dependencies in a 50+ line build.sbt while tabbing through files in my IDE. (So dependency became:, “org.scalaz” %% “scalaz-core” % "7.1.0"s)

It’s not too hard to figure out error is caused by some kind of error in project configuration and back our recent changes to troubleshoot or something like that, but this message seems insanely/aggressively un-userfriendly. If the stack trace could even just include the line that triggered the exception somewhere, it would be far more helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apache spark - sbt-assembly - throwing java.lang ...
Problem Details: In my SBT project, I am using the dependency "org.apache.cassandra" % "cassandra-all" % "3.0.27".
Read more >
3 Tips to solve and Avoid java.lang ... - Javarevisited
The error ArrayIndexOutOfBoundsException: 1 means index 1 is invalid and it's out of bounding i.e. more than the length of the array. Since...
Read more >
IntelliJ IDEA - Troubleshoot common Scala issues - JetBrains
In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Press...
Read more >
sbt Reference Manual — Combined Pages
There are not that many concepts, but sbt is not exactly like other build systems ... reports about SSL error using Ubuntu: Server...
Read more >
How to Fix javax.net.ssl.SSLHandshakeException - Java67
SSLHandshakeException: unable to find valid certification path to requested target in Java. Hello guys, this is one of the common errors in a...
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