I am trying to run the test sbt task using my IDE but I am getting the following error:
Compiling 12 Scala sources to
/home/user/newPrs/projectname/processing/target/scala-2.11/test-classes...
[trace] Stack trace suppressed: run last test:copyResources for the full output.
[error] (test:copyResources) java.io.FileNotFoundException: /home/user/newPrs/projectname/processing/target/scala-2.11/test-classes/rawData/data.parquet (Permission denied)
Any idea how to fix this please?
Thanks a lot
Related
I am trying to run the gatling test on MacOS.
Java version: openjdk version "1.8.0_275"
scala version: 2.12.12
sbt version :1.4.4
I am unable to run my tests because of this error. I have tried changing the java versions(recommended one) and tried reinstalling the sbt as well.
The error log is as follows:
Unrecognized VM option 'AggressiveOpts'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[error] Could not accept connection from test agent: class java.net.SocketException: Socket closed
[error] java.net.SocketException: Socket closed
[error] at java.base/sun.nio.ch.NioSocketImpl.endAccept(NioSocketImpl.java:689)
[error] at java.base/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:762)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:684)
[error] at java.base/java.net.ServerSocket.platformImplAccept(ServerSocket.java:650)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:626)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:583)
[error] at java.base/java.net.ServerSocket.accept(ServerSocket.java:540)
[error] at sbt.ForkTests$Acceptor$1$.run(ForkTests.scala:71)
[error] at java.base/java.lang.Thread.run(Thread.java:832)
I would appreciate your feedback on this. Thank you.
There's no way you're using Java 8 as indicated, as your stacktrace clearly shows Jigsaw modules (java.base/). You're using Java 9 or older.
What happens is that the test forked JVM crashes on boot because it's being passed the AggressiveOpts option that was dropped after Java 8.
This option was removed in recent versions of Gatling's sbt plugin, meaning that you're using an older version.
In short: update your sbt plugin version.
After I upgrade play framework from version 2.3 to 2.4, the build finished without errors but after accessing the SBT shell and compile the project, I got the following error:
[trace] Stack trace suppressed: run last project-app-server/compile:playRoutes for the full output.
[error] (project-app-server/compile:playRoutes) java.lang.NoSuchMethodError: play.routes.compiler.static.twirl.forwardsRouter_Scope0$forwardsRouter._display_(Ljava/lang/Object;Lscala/reflect/Manifest;)Lplay/twirl/api/Appendable;
I'm trying to work with Excel in my project, so I added few additional jar's to it:
MyBuildPath
When I'm trying to run my project, I'm getting such exceptions:
:compileJavaC:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:12: error: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:13: error: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
.......
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:116: error: cannot find symbol
public static String getCellText(Cell cell) {
^
symbol: class Cell
location: class SearchOrders
13 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I searched a lot through the internet, but I still can't understand how to solve this problem.
I assume you are excuting your code commandline, and not using eclipse.
In that case, You will have to add dependency jars in class path when you run the code.
java -cp <jar files> is the possible way.
Are you able to execute in eclipse ?
Regards,
~KD
I'm trying to cross publish a library for scala 2.12/2.11 using sbt-release, and getting a java.lang.IllegalStateException: Ivy file not found in cache exception in the 2.11 part (things continue for 2.12 and go all the way to being uploaded to sonatype)
[trace] Stack trace suppressed: run last monadic-rxJS/*:deliver for the full output.
java.lang.IllegalStateException: Ivy file not found in cache for in.nvilla#monadic-rx-cats_sjs0.6_2.11;0.2.0!
Here is the complete sbt output, and this is the current state of the build.sbt.
When starting scalaConsole from gradlew, the main Scala runner is not found on the classpath:
05:21:45/kafka-0.8.1-src:43 $./gradlew scalaConsole
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
Building project 'core' with Scala version 2.8.0
Building project 'perf' with Scala version 2.8.0
:core:compileJava UP-TO-DATE
:core:compileScala UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:scalaConsole
Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
:core:scalaConsole FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:scalaConsole'.
> Process 'command '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
From http://sethrylan.org/2013/07/02/scala-gradle-scalaconsole.html, try adding the compiler to your runtime dependencies.
dependencies {
runtime "org.scala-lang:scala-compiler:2.10.4"
compile "org.scala-lang:scala-library:2.10.4"
}
The same article suggests starting it with Gradle's -q option:
$ gradle scalaConsole -q
Note that I don't think this is a very good solution since you really don't want to make your code dependent on the compiler, but at least it's a workaround.