activator eclipse command shows sbt.ResolveException - scala

I have created a new project by using activator new simple play-scala command.simple is my project name.I would like to import this project into my eclipse(ScalaIDE),so I used activator eclipse command but It showed the below Exception
[error] Not a valid command: eclipse (similar: help, alias)
[error] Not a valid project ID: eclipse
[error] Expected ':' [error] Not a valid key: eclipse (similar: deliver, licenses, clean)
[error] eclipse [error]
for this error I added addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0") https://www.playframework.com/documentation/2.4.x/IDE command in simple/project/plugins.sbt It resolved the above mentioned error but It shows the error
[warn] +- default:simple_test-build:0.1-SNAPSHOT (scalaVersion=2.10,
sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-
plugin;4.0.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:291)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:188)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:165)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRet
ries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:
97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
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 sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
at sbt.IvySbt.withIvy(Ivy.scala:127)
at sbt.IvySbt.withIvy(Ivy.scala:124)
at sbt.IvySbt$Module.withModule(Ivy.scala:155)
at sbt.IvyActions$.updateEither(IvyActions.scala:165)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala
:1369)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala
:1365)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1
399)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1
397)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1402)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1396)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1419)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1348)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1310)
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:22
6)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:22
6)
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(ConcurrentRestric
tions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
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] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbt
eclipse#sbteclipse-plugin;4.0.0: not found
sbt version: =0.13.8
scalaVersion: =2.11.6
I tried with addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0") this too It built the eclipse project succeesfully but It showed the error
Applications.scala
object index is not a member of package views.html
index.scala.html,main.scala.html
Multiple annotations found at this line:
- type Html is not a member of package play.api.templates
- type Html is not a member of package play.api.templates
- type Html is not a member of package play.api.templates
- object HtmlFormat is not a member of package
play.api.templates

First of all, ScalaIDE is still under development and not yet as stable as Eclipse JDT. As far as I know, especially the Play support still has some problems. However, with activator/sbt you can compile, test, and run your Play code without any problems.
But lets look at your error messages. I assume that you want to get rid of them. ;)
use addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0"). 4.0.0 is not final/available yet.
object index is not a member of package views.html.
Look at the answers of this question. There exists no general solution yet. However, for me it worked to include two more source folders in the project's build path:
target/scala-2.11/routes/main
target/scala-2.11/twirl/main
type Html is not a member of package play.api.templates etc. I have no idea how this can be fixed. But if you close the html file after making your changed and then do a clean build all error messages will be gone.
Update: there is a discussion in the Scala IDE User group regarding issue 3. However, no solution yet.

I have the same issue.
Setting the sbteclipse plugin version to an earlier version does not work, as sbt steadfastly refuses it, and discards it for version 4.0, which is not available.
Sbt is a pain...even their website has no documentation about this issue, which by the looks of it, is at least one year old?

Related

scala project does not work in intellij

I am getting the following error log when setting up a scala project in intellij:
Error:Error while importing SBT project:<br/>...<br/><pre>[error] at
sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:107)
[error] at sbt.io.Using.apply(Using.scala:22)
[error] at sbt.MainLoop$.runWithNewLog(MainLoop.scala:101)
[error] at sbt.MainLoop$.runAndClearLast(MainLoop.scala:57)
[error] at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:42)
[error] at sbt.MainLoop$.runLogged(MainLoop.scala:34)
[error] at sbt.StandardMain$.runManaged(Main.scala:113)
[error] at sbt.xMain.run(Main.scala:76)
[error] at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error] at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error] at xsbt.boot.Launch$.run(Launch.scala:109)
[error] at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error] at xsbt.boot.Launch$.launch(Launch.scala:117)
[error] at xsbt.boot.Launch$.apply(Launch.scala:18)
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error] at xsbt.boot.Boot$.main(Boot.scala:17)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.CreateTasks$
[error] Use 'last' for the full log.
[info] shutting down server</pre><br/>See complete log in file:/home/xxxx/.IdeaIC2017.2/system/log/sbt.last.log
My build.sbt looks as follows:
name := "someProjectName"
version := "0.1"
scalaVersion := "2.12.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
Please also note that my "old" projects still work, i.e. this issue occurcs only when doing a new project. Further, I noticed that when I click on SBT projects on the very right, it opens an empty window "SBT projects", for my other projects that window is non-empty.
Any idea what I am doing wrong here?
Many thanks
c
In case you don't want the hassle of upgrading Intellij, you can downgrade the sbt version in sbt.properties file from 1.1.0 (the project default) to, for instance, 1.0.3.
I have been experiencing this problem myself, and solved it by upgrading to intellij version: 2017.3.2 build #IU-173.4127.27.
I think this may have to do with sbt 1.X series no longer being available on the typesafe bintray repository, as I was also having a problem performing some Docker builds.
I had the same problem, so I could not create any Scala class in my project. Found a workaround, by creating a scala module in my project:
Select your project folder, go to File menu, File->New->Module.
In module select Scala and setup your Scala SDK there.
Then you can create scala classes in this module.
downgrade the sbt version in sbt.properties and remove target folder from project and project/project

Unresolved dependency with xgboost library in scala [duplicate]

This question already has answers here:
sbt build failed for spark scala with xgboost
(2 answers)
Closed 5 years ago.
I've added my xgboost jar files in the library and modules in my project structure. (I built the jar files from source successfully as mentioned in the documentation). I can't seem to be able to resolve the dependency for it. I've tried to run it with the dependency included in the build sbt file and with it taken out (since the jars are already included in the library and dependencies via the project structure). Both seem to be failing. Is this some sort of a compatibility issue? I am running scala 2.11.8 and spark 2.1.0. My dependencies are included in a sequence as follows:
"ml.dmlc" %% "xgboost4j" % "0.7", "ml.dmlc" %% "xgboost4j-spark" % "0.7"
I seem to be missing something but I am not sure what. Any ideas?
I tried to publish the jar as suggested but I get the following error:
sbt.ResolveException: unresolved dependency: ml.dmlc#xgboost4j_2.11;0.7: not found
unresolved dependency: ml.dmlc#xgboost4j-spark_2.11;0.7: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
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 sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
at sbt.IvySbt.withIvy(Ivy.scala:128)
at sbt.IvySbt.withIvy(Ivy.scala:125)
at sbt.IvySbt$Module.withModule(Ivy.scala:156)
at sbt.IvyActions$.updateEither(IvyActions.scala:168)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1439)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1435)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1470)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1468)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1473)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1467)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1490)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1417)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1369)
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:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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] (*:update) sbt.ResolveException: unresolved dependency: ml.dmlc#xgboost4j_2.11;0.7: not found
[error] unresolved dependency: ml.dmlc#xgboost4j-spark_2.11;0.7: not found
[error] Total time: 24 s, completed Aug 15, 2017 12:40:52 PM
The dependency should only have one % there.
"ml.dmlc" % "xgboost4j" % "0.7", "ml.dmlc" % "xgboost4j-spark" % "0.7"

impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3

When I used sbt assembly in the root dir of Spark-1.5.1 to build Spark source code on windows, after a long time,I got an error.
[error] (hive/*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3
Spark version 1.5.1
sbt version I installed 0.13.9
Anyone can help me?
logs(the second time execute sbt assembly)
[warn] Strategy 'first' was applied to 247 files
[info] Assembly up to date: D:\dev\spark-1.5.1\assembly\target\scala-2.10\spark-assembly-1.5.1-hadoop2.6.0.jar
java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3
at org.apache.ivy.core.resolve.IvyNode.getArtifacts(IvyNode.java:809)
at org.apache.ivy.core.resolve.IvyNode.getSelectedArtifacts(IvyNode.java:786)
at org.apache.ivy.core.report.ResolveReport.setDependencies(ResolveReport.java:235)
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:235)
at org.apache.ivy.Ivy.resolve(Ivy.java:517)
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:266)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:175)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:157)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:128)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
at sbt.IvySbt$$anon$4.call(Ivy.scala:64)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
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 sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
at sbt.IvySbt.withIvy(Ivy.scala:123)
at sbt.IvySbt.withIvy(Ivy.scala:120)
at sbt.IvySbt$Module.withModule(Ivy.scala:151)
at sbt.IvyActions$.updateEither(IvyActions.scala:157)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1318)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1315)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1345)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1343)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1348)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1342)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1360)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1300)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1275)
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.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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] (hive/*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3
[error] Total time: 200 s, completed 2016-1-25 10:49:27
I was receiving this error with sbt version 0.13.8
The fix that worked for me is to edit project/build.properties to use sbt.version = 0.13.9
I'm getting the same error with a different project, and according to this link, "It seems like it's related to transitive dependencies and manually added exclude introducing some kind of inconsistency."
Manually adding the dependency fixed it for me.
I've had similar error while running ivy and I used ivy-2.0.0.jar in ant/lib. By upgrading ivy.jar to ivy-2.4.0 my problem resolved.
Here is error I caught while running my ivy task:
java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = junit#junit;4.4

Unresolved dependencies errors when trying to build self-contained application with Scala + Spark

I am trying to follow the Self-Contained Applications Tutorial and trying to build using sbt and scala, but I run into the following errors when calling sbt package from C:\Users\00926133\test:
[info] Set current project to Simple Project (in build file:/C:/Users/00926133/test/)
[info] Updating {file:/C:/Users/00926133/test/}test...
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[error] Unable to find credentials for [ # XXXX].
[info] Resolving org.apache.spark#spark-core_2.10;1.4.0 ...
[info] Resolving org.apache.spark#spark-core_2.10;1.4.0 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.4 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.10.4: java.util.NoSuchElementException
[warn] :: org.apache.spark#spark-core_2.10;1.4.0: java.util.NoSuchElementException
[warn] :: org.scala-lang#scala-compiler;2.10.4: java.util.NoSuchElementException
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.scala-lang:scala-library:2.10.4 ((sbt.Classpaths) Defaults.scala#L1203)
[warn] +- simple-project:simple-project_2.10:1.0
[warn] org.apache.spark:spark-core_2.10:1.4.0 (C:\Users\00926133\test\simple.sbt#L7-8)
[warn] +- simple-project:simple-project_2.10:1.0
[warn] org.scala-lang:scala-compiler:2.10.4
[warn] +- simple-project:simple-project_2.10:1.0
sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10.4: java.util.NoSuchElementException
unresolved dependency: org.apache.spark#spark-core_2.10;1.4.0: java.util.NoSuchElementException
unresolved dependency: org.scala-lang#scala-compiler;2.10.4: java.util.NoSuchElementException
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:291)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:188)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:165)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
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 sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
at sbt.IvySbt.withIvy(Ivy.scala:127)
at sbt.IvySbt.withIvy(Ivy.scala:124)
at sbt.IvySbt$Module.withModule(Ivy.scala:155)
at sbt.IvyActions$.updateEither(IvyActions.scala:165)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1369)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1365)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1399)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$87.apply(Defaults.scala:1397)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1402)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1396)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1419)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1348)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1310)
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.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10.4: java.util.NoSuchElementException
[error] unresolved dependency: org.apache.spark#spark-core_2.10;1.4.0: java.util.NoSuchElementException
[error] unresolved dependency: org.scala-lang#scala-compiler;2.10.4: java.util.NoSuchElementException
[error] Total time: 1 s, completed Jun 26, 2015 9:13:40 AM
I have been successful in running spark-shell and scala, as well as the spark examples for python and R. I have also tried removing the .ivy folder.
My simple.sbt file:
name := "Simple Project"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" % "spark-core_2.10" % "1.4.0"
Other Information
scala -version == 2.10.4
sbt sbt-version == 0.13.8
My simple.sbt file is located at C:\Users\00926133\test
SimpleApp.scala is located at C:\Users\00926133\test\src\main\scala
Spark is residing at C:\Users\00926133\spark-1.4.0-bin-hadoop2.6
I have looked through several Stack Overflow posts, but none of the solutions shown there seem to get me any traction.
UPDATE
I was able to confirm this is a proxy related issue. However, I am still unable to build behind my proxy. This is on Windows and I have the following:
Environment Variables
SBT_OPTS = -Dhttp.proxyHost=<myhost> -Dhttp.proxyPort=<myport> -Dhttp.proxyUser=<myuser> -Dhttp.proxyPassword=<mypassword> -Dhttps.proxyHost=<myhost> -Dhttps.proxyPort=<myport> -Dhttps.proxyUser=<myuser> -Dhttps.proxyPassword=<mypassword>
JAVA_OPTS = -Dhttp.proxyHost=<myhost> -Dhttp.proxyPort=<myport> -Dhttp.proxyUser=<myuser> -Dhttp.proxyPassword=<mypassword> -Dhttps.proxyHost=<myhost> -Dhttps.proxyPort=<myport> -Dhttps.proxyUser=<myuser> -Dhttps.proxyPassword=<mypassword>
I also add the following lines to my sbtconfig.txt located under ..\sbt\conf:
-Dhttp.proxyHost=<myhost>
-Dhttp.proxyPort=<myport>
-Dhttp.proxyUser=<myuser>
-Dhttp.proxyPassword=<mypassword>
-Dhttps.proxyHost=<myhost>
-Dhttps.proxyPort=<myport>
-Dhttps.proxyUser=<myuser>
-Dhttps.proxyPassword=<mypassword>
Bonus points for anyone who can (a) explain in layman's terms what sbt package is doing, (b) how to interpret the simple.sbt file, and/or (c) figure out how to resolve [error] Unable to find credentials for [ # XXXX ] -- XXXX is my work's proxy-server.
I found the source code to your first error (chronologically) in the SBT source code accompanied with the comment "We're guaranteed to only get here if Ivy's authentication fails". Since the remaining errors are an inability to find dependencies, it looks like the proxy is causing the problem.
Did you see the question How to use sbt from behind proxy? Did you try those steps?
Ivy is used by SBT to cache dependencies locally, so that once you've fetched a particular version of a particular dependency you won't have to go to the Internet to fetch it again. In Windows, you can see the contents of your Ivy cache at C:\Users\<User Name>\.ivy2
It looks like SBT's inability to get through your company's proxy is causing it to be unable to fetch third party dependencies, thus causing the build to fail. If you haven't already tried that, try setting the proxy configuration on the SBT command line or in environment variables. Since you're using Windows, just add -Dhttp.proxyHost=yourserver -Dhttp.proxyPort=port ... to the SBT command line. Make sure you add all of the required parameters, depending on what the proxy requires. (Does it require a username/password?)
SBT is Scala's "Simple Build Tool." SBT files are written in Scala. The classes in SBT have operators defined that cause the build actions you request based on your build file. When you run sbt package you're asking the build tool to build and package the current project.
The Spark quick start explains the simple.sbt file at a high level. Generally, the SBT build file gives a project name and version, defines the required Scala version, lists third party dependencies, and generally speaking defines everything needed for the entire build and packaging process.

Intellij 13 with sbt 13.1 unable to resolve global-plugins where no global plugins exist

I have an scala project built with sbt that I am attempting to import into IntelliJ13.
Scala 2.10.3 with sbt 13.1, scala plugin installed and up to date. Running on Fedora20 w/Oracle JDK7. Project builds and runs without issue from the command line. However, when I attempt to import the project into IntelliJ the import fails since plugin default#global-plugins;0.0 cannot be resolved.
I have no actual global plugins installed under ~/.sbt/0.13.
The entire project has no reference in the config or otherwise to the word global.
I am new to both Scala and sbt so forgive if I have left out necessary details. However, as I said there is no reference anywhere to a plugin named anything even close to "global" and there are no global plugins configured. The resulting error from the logs is as follows:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: default#global-plugins;0.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] default:global-plugins:0.0 (sbtVersion=0.13, scalaVersion=2.10)
[warn]
sbt.ResolveException: unresolved dependency: default#global-plugins;0.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:213)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:104)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:51)
at sbt.IvySbt$$anon$3.call(Ivy.scala:60)
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 sbt.IvySbt.withDefaultLogger(Ivy.scala:60)
at sbt.IvySbt.withIvy(Ivy.scala:101)
at sbt.IvySbt.withIvy(Ivy.scala:97)
at sbt.IvySbt$Module.withModule(Ivy.scala:116)
at sbt.IvyActions$.update(IvyActions.scala:121)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1144)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1142)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$73.apply(Defaults.scala:1165)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$73.apply(Defaults.scala:1163)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1167)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1162)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1170)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1135)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1113)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: default#global-plugins;0.0: not found
at org.jetbrains.sbt.project.SbtProjectResolver.resolveProjectInfo(SbtProjectResolver.scala:31)
at org.jetbrains.sbt.project.SbtProjectResolver.resolveProjectInfo(SbtProjectResolver.scala:19)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
... 21 more
I have searched about and have not found anyone encountering this exact fail to resolve error - has anyone else encountered this or have any idea as to why it might be happening? Thank you.
I just encountered this error but at the command line rather than in IntelliJ. I was eventually able to resolve it by doing an rm -rf on the following directories
target
project/target
project/project/target
~/.sbt/
~/.ivy2/
I had other complicating factors,
I'd just upgraded to the latest https://github.com/paulp/sbt-extras
I also tried upgrading to 0.13.1 to 0.13.2 in my project/build.properties
We block all access to external repos and push everything through our internal Artifactory (I was also able to make the problem go away by turning this off - so your problems could also be network related.)
I found adding an empty folder at ~/.sbt/0.13/plugins worked.
Edit: This didn't work for me when I hit the issue again. My way around this this time was to download the zip directly and aliased sbt to point to the executable (putting it on my PATH left me with the same error!!)
This would indicate there is some other config somewhere that sbt isn't happy with but I decided not to go down the rabbit hole of finding out where that lives :)