Library cannot be resolved - scala

When I package Scala project using SBT, I face the following problem:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025229' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
at scala.sys.package$.error(package.scala:27)
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
And the 5-7 lines code in app.raml like that:
uses:
appContainer: appContainer.raml
artifact: artifact.raml
the directory of app.raml and appContainer.raml is "D:\marathon-master\docs\docs\rest-api\public\api\v2/types/" both. So I change 6 line of app.raml like that:
appContainer: v2/types/appContainer.raml
But when I run "sbt package" again, a warning shows up:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025721' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[warn] File D:\marathon-master\docs\docs\rest-api\public\api\v2\types\v2\types\appContainer.raml does not exist (referenced by
D:\marathon-master\docs\docs\rest-api\public\api\v2\types\app.raml)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved:
D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
why have this warning? Any idea?

Related

PlayFramework - Creating Scala seed template with sbt

I am attempting to create the PlayFramework Scala seed project.
So far I've used sbt new playframework/play-scala-seed.g8 command and it has created the necessary files within my root directory movie-app.
From this point, PlayFramework says to run sbt run, so I tried that, but I get the following error:
[info] Updated file *omitting personal directories*/Movie-App/project/build.properties: set sbt.version to 1.4.7
[info] welcome to sbt 1.4.7 (Ubuntu Java 11.0.10)
[info] loading project definition from *omitting personal directories*/Movie-App/project
[info] set current project to movie-app (in build file:*omitting personal directories*/Movie-App/)
[error] java.lang.RuntimeException: No main class detected.
[error] at scala.sys.package$.error(package.scala:30)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] (Compile / bgRun) No main class detected.
[error] Total time: 0 s, completed Jul 2, 2021, 11:27:33 PM
I haven't found anything helpful online yet.
Do I need to set the current project to "movie-app" like the error says? If so what do I need to write in the build.properties file?
If not, can anyone please explain the issue?
Thanks
$> sbt new playframework/play-scala-seed.g8
This template generates a Play Scala project.
Give it a name when asked. Skip rest by pressing enter.
name [play-scala-seed]: movie-app
$> cd movie-app
$> sbt run

Can't build kie-wb-webapp 6.1.x (JBPM)

I need to modify KIE Workbench source and I have two issues that are stopping me from building with Maven 3.2.5, one on Windows and one on Linux.
On Windows 7, I am getting an error that says
[deletia...]SNAPSHOT\uberfire-backend-api-0.4.0-SNAPSHOT-sources.jar,
com.google.gwt.dev.Compiler,-logLevel, INFO, -style, OBF, -war,
c:\kie-wb-webapp\target\kie-wb-webapp-6.1.1-SNAPSHOT, -localWorkers, 1,
-strict, -XfragmentCount, -1, -deploy, c:\kie-wb-webapp\target\gwt-symbols-deploy, -gen,
c:\kie-wb-webapp\target\.generated, org.kie.workbench.FastCompiledKIEWebapp]:
Error while executing process. Cannot run program "c:\development\software\jdk\jdk1.7.0_71\jre\bin\java":
CreateProcess error=206, The filename or extension is too long.
So I looked it up and apparently, this is well known limitation since gwt-maven-plugin creates a command-line that is longer than 8191 chars and this is forbidden. So I gave it a shot on Ubuntu.
On Ubuntu,
I am getting:
[INFO] --- gwt-maven-plugin:2.5.1:compile (gwt-compile) # kie-wb-webapp [ERROR] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[ERROR] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
[INFO] Compiling module org.kie.workbench.FastCompiledKIEWebapp
[INFO] Validating units:
[INFO] [ERROR] Errors in 'jar:file:/home/rich/.m2/repository/com/google/guava/guava-gwt/14.0.1/guava-gwt-14.0.1.jar!/com/google/common/primitives/Booleans.java'
[INFO] [ERROR] Line 29: The import java.util.BitSet cannot be resolved
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE*
It's really important that I find a workaround to 1 or both of these issues (my guess is that if I clear the command-line issue on Windows, I'll just run into the guava issue again). Also, unless it's absolutely necessary, I can't upgrade to 6.2.x, because this would cause a lot of work for my project.
Has anyone run into this?
If you don't need Java 8 support, you may be able to solve the problem by using an earlier version of the JDK. I believe that you do this by setting JAVA_HOME for your Maven run. You can download a JDK 7 here.
You could also build Guava yourself from HEAD, as the problem has been fixed there but not included in a release. Or you could wait for a 19.0-rc1, which we hope to have out soon.

Runnig Twiiter Cassovary Examples in eclipse

I have imported the Twitter Cassovary into Eclipse form Git Hub but not sure how to run the examples.Please advise as I am new to eclipse as well as scala
I imported the project, opened a benchmark (cassovary-benchmarks/src/main/java/GraphGenerationBenchmarks) and used Run as->Scala application.
You can also do this from the command line. Start sbt in the main project directory, choose subproject cassovary-benchmarks and then use run. You will be asked which benchmark to run.
➜ twitter-cassovary git:(master) ✗ ls
README.md cassovary-examples project
cassovary-benchmarks cassovary-server sbt
cassovary-core lib_managed target
➜ twitter-cassovary git:(master) ✗ sbt
Loading /Users/szymon/bin/sbt-launch-lib.bash
[info] Loading global plugins from /Users/szymonmatejczyk/.sbt/0.13/plugins
[info] Loading project definition from /Users/szymon/oss/twitter-cassovary/project
[info] Set current project to cassovary (in build file:/Users/szymon/oss/twitter-cassovary/)
> project cassovary-benchmarks
[info] Set current project to cassovary-benchmarks (in build file:/Users/szymon/oss/twitter-cassovary/)
> run
[info] Compiling 12 Scala sources to /Users/szymon/oss/twitter-cassovary/cassovary-core/target/scala-2.11/classes...
[info] Compiling 56 Scala sources to /Users/szymon/oss/twitter-cassovary/cassovary-core/target/scala-2.11/classes...
[info] Compiling 2 Scala sources to /Users/szymon/oss/twitter-cassovary/cassovary- benchmarks/target/scala-2.11/classes...
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
Multiple main classes detected, select one to run:
[1] com.twitter.cassovary.PerformanceBenchmark
[2] com.twitter.cassovary.SubsetSamplingBenchmarks
[3] com.twitter.cassovary.GraphGenerationBenchmarks
[4] com.twitter.cassovary.utils.FastUtilsWrappingBenchmark
Enter number:

Casbah MongoDB driver compiler error

I'm using the Casbah driver for MongoDB and while I compiled my project, it fails with the following error:
[INFO] Compiling 12 source files to /core/target/classes at 1394903201140
[ERROR] error: bad symbolic reference. A signature in MongoClient.class refers to type MongoClientURI
[INFO] in package com.mongodb which is not available.
[INFO] It may be completely missing from the current classpath, or the version on
[INFO] the classpath might be incompatible with the version used when compiling MongoClient.class.
[ERROR] error: bad symbolic reference. A signature in MongoClient.class refers to type MongoClient
[INFO] in package com.mongodb which is not available.
[INFO] It may be completely missing from the current classpath, or the version on
[INFO] the classpath might be incompatible with the version used when compiling MongoClient.class.
[ERROR] two errors found
I'm having the following setup as my maven dependency:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>casbah_2.10</artifactId>
<version>2.7.0-RC2</version>
</dependency>
Why would it now fail during compilation? Any clues what to look for or what to change? Additionally, I also see the following warnings:
[WARNING] Expected all dependencies to require Scala version: 2.10.3
[WARNING] org.mongodb:casbah_2.10:2.7.0-RC2 requires scala version: 2.10.3
[WARNING] org.mongodb:casbah-commons_2.10:2.7.0-RC2 requires scala version: 2.10.3
[WARNING] com.github.nscala-time:nscala-time_2.10:0.6.0 requires scala version: 2.10.2
Has this got any relation to the compilation failure? Additionally, I ran maven in debug mode and this is what I see in my classpath:
[DEBUG] Classpath: [/../../target/classes
/Softwares/maven-repo/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar
/Softwares/maven-repo/org/mongodb/casbah-commons_2.10/2.7.0-RC2/casbah-commons_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/com/github/nscala-time/nscala-time_2.10/0.6.0/nscala-time_2.10-0.6.0.jar
/Softwares/maven-repo/org/joda/joda-convert/1.2/joda-convert-1.2.jar
/Softwares/maven-repo/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar
/Softwares/maven-repo/org/mongodb/casbah-core_2.10/2.7.0-RC2/casbah-core_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/org/mongodb/casbah-query_2.10/2.7.0-RC2/casbah-query_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/org/mongodb/casbah-gridfs_2.10/2.7.0-RC2/casbah-gridfs_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/com/novus/salat-core_2.9.2/0.0.8/salat-core_2.9.2-0.0.8.jar
/Softwares/maven-repo/com/novus/salat-util_2.9.2/0.0.8/salat-util_2.9.2-0.0.8.jar
/Softwares/maven-repo/org/scala-lang/scalap/2.9.2/scalap-2.9.2.jar
/Softwares/maven-repo/org/scala-lang/scala-compiler/2.9.2/scala-compiler-2.9.2.jar
/Softwares/maven-repo/org/mongodb/mongo-java-driver/2.7.3/mongo-java-driver-2.7.3.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-core_2.9.1/2.1.5-1/casbah-core_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-commons_2.9.1/2.1.5-1/casbah-commons_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/org/scala-tools/time/time_2.9.1/0.5/time_2.9.1-0.5.jar
/Softwares/maven-repo/org/scalaj/scalaj-collection_2.9.1/1.2/scalaj-collection_2.9.1-1.2.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-query_2.9.1/2.1.5-1/casbah-query_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/net/liftweb/lift-json_2.9.1/2.4/lift-json_2.9.1-2.4.jar
/Softwares/maven-repo/com/thoughtworks/paranamer/paranamer/2.3/paranamer-2.3.jar
/Softwares/maven-repo/com/typesafe/config/1.0.2/config-1.0.2.jar
/Softwares/maven-repo/joda-time/joda-time/2.3/joda-time-2.3.jar]
I do not understand from where did the other dependencies especially the ones like casbah-core_2.9.1, casbah-query_2.9.1 make it to my classpath? I do not have them as my maven dependencies in my pom.xml! It is confusing.
I figured out what the problem is. I had an additional dependency to the salat framework that I do not use nut somehow was added during evaluation. It actually was pulling in those additional jar files into the classpath which actually seems to be the reason for this error!

How do I get 'cake repl' working on OSX? (I'm getting 'Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main')

I'm trying to get clojure/emacs/swank/cake all working together. According to assembla I need 'cake repl' to launch a repl, but I keep getting a NoClassDefFoundError. Any idea how to fix that?
Here's what I get in the command line:
$ cake ps
7876 main -Dcake.project=/Users/bmaddy/.cake -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
$ echo $CLASSPATH
$ java -version
java version "1.5.0_26"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_26-b03-376-9M3263)
Java HotSpot(TM) Client VM (build 1.5.0_26-156, mixed mode, sharing)
$ ruby -v
ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
$ cake repl
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
[cake] connection to bake jvm is taking a long time...
[cake] you can use ^C to abort and use 'cake kill' or 'cake kill -9' to force the jvm to restart
^C/Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:509:in `sleep': Interrupt
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:509:in `with_socket'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:431:in `repl'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:430:in `loop'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:430:in `repl'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:822:in `send'
from /Users/bmaddy/.gem/ruby/1.8/gems/cake-0.5.8/bin/cake:822
from /Users/bmaddy/.gem/ruby/1.8/bin/cake:19:in `load'
from /Users/bmaddy/.gem/ruby/1.8/bin/cake:19
$ cake ps
7876 main -Dcake.project=/Users/bmaddy/.cake -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
12539 main -Dcake.project=/Users/bmaddy/Documents/books/SICP -Xms16M -Xmx64M -Djava.library.path=lib/dev/native
More info:
$ cake deps force
[deps] Fetching dependencies...
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojure
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojure-snapshots
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from clojars
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from maven
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojure at http://build.clojure.org/releases
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojure (http://build.clojure.org/releases)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojure-snapshots at http://build.clojure.org/snapshots
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojure-snapshots (http://build.clojure.org/snapshots)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository clojars at http://clojars.org/repo
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository clojars (http://clojars.org/repo)
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from repository maven at http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.2.0-master-SNAPSHOT' in repository maven (http://repo1.maven.org/maven2)
[deps] Copying 3 files to /Users/bmaddy/Documents/books/SICP/build/lib
[deps] Deleting directory /Users/bmaddy/Documents/books/SICP/lib
[deps] Attempting to rename dir: /Users/bmaddy/Documents/books/SICP/build/lib to /Users/bmaddy/Documents/books/SICP/lib
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/clean
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/default
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/deps
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/help
[clean] Deleting /Users/bmaddy/Documents/books/SICP/.cake/run/pom
[deps] Restarting project jvm
Turns out this was a problem with Clojure and Java 1.5. The fix on OS X was to use /Applications/Utilities/Java Preferences.app to switch to Java 1.6.
Looks like your default cake project doesn't have the clojure jar. Try running cake deps force.