java.io.IOException when running sbt from ensime? - scala

I have tried ensime/sbt on mac os. First, I open the .scala file in project folder create from using sbt in command-line, then I ran ensime and it still work fine, but whenever I run ensime-sbt (c-c c-v s), I got
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
at xsbt.boot.Locks$.apply0(Locks.scala:34)
at xsbt.boot.Locks$.apply(Locks.scala:27)
at scala.collection.Iterable$class.$init$(Proxy.scala:32)
at xsbt.boot.Launch$ScalaProvider.<init>(Launch.scala:107)
at xsbt.boot.Launch$$anonfun$1.apply(Launch.scala:83)
at org.apache.ivy.plugins.namespace.NamespaceRule.newEntry(Cache.scala:17)
at org.apache.ivy.plugins.namespace.NamespaceRule.apply(Cache.scala:12)
at xsbt.boot.Launch.getScala(Launch.scala:85)
at xsbt.boot.Launch$.run(Launch.scala:49)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.IOException: No such file or directory
Process sbt exited abnormally with code 1
I tried using sbt from command-line and everything works from there (compile/run/console). I'm using sbt 0.10.1 and latest binary ensime on emacs24 (2011/07/24) on mac os.
Any idea that I'm doing it wrong ?

I had this and after applying strace I found the issue. The ensime-sbt.el function searches up from the cwd looking for ./project/build.properties. On finding this dir/file it assumes this is the root directory.
So just create this file and this issue should disappear. Would be nice if ensime created this file by default seeing as it's a required file for the sbt function to work.

I got the same error. This situation seems to be that sbt tried but failed to create ".sbt" and ".ivy" dir at the user's home directory. Maybe, the reason is that OS user doesn't have permission to write at the user's home directory.

It's something related with permission, maybe.
I checked the Locks.scala https://github.com/harrah/xsbt/blob/0.10/launch/Locks.scala source, and guessed "file.getParentFile.mkdirs()" did no work because of permission denial.
I encountered the same problem yesterday, and got it run a minute ago, by adding sudo:
"sudo emacs xxx.scala"

you can change sbt.ivy.home and ivy.home property. So, to augment Joachim's first solution, you would set both system properties:
like this:
java -Dsbt.ivy.home=/tmp/.ivy2/ -Divy.home=/tmp/.ivy2/ -jar dirname $0/sbt-launch.jar "$#"
hope to resolve you problem

This error also occurs when the files in the home directory that sbt tries to access are not owned by the user that tries to run it. run a chmod 777 on the directoris in the home master and the issue will be solved.

Related

Missing sbt/boot/ directory in new play-2.1.1 installation. Playframework installation on Linux Mint 14

I'm trying to install the Play! Framework on a Linux Mint box, but I'm having a hard time getting play going. After the installation, I'm getting folliwing error message when I type play help at the command line:
$ play help
java.io.FileNotFoundException: /home/play-2.1.1/framework/sbt/boot/update.log (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:218)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at java.io.FileWriter.<init>(FileWriter.java:90)
at xsbt.boot.Update.<init>(Checks.java:51)
at xsbt.boot.Launch.update(Launch.scala:275)
at xsbt.boot.Launch$$anonfun$jnaLoader$1.apply(Launch.scala:120)
at scala.Option.getOrElse(Option.scala:108)
at xsbt.boot.Launch.jnaLoader$2f324eef(Launch.scala:115)
at xsbt.boot.Launch.<init>(Launch.scala:94)
at xsbt.boot.Launcher$.apply(Launch.scala:290)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.FileNotFoundException: /home/play-2.1.1/framework/sbt/boot/update.log (No such file or directory)
As can be seen, play is installed in the /home directory. Content of .bashrc file is as follows:
$ cat ~/.bashrc
export PATH=""/home/play-2.1.1:$PATH""
export JAVA_HOME=/usr/local/java/jdk1.7.0_12
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib/dt.jar:.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar
I wonder if I've left out something during the installation process that accounts for the difficulty in getting play up and running. Will appreciate helpfull hints and advise. Many thanks.
Make sure you have write permissions on the Play framework path. You will get this error if you do not.

netbeans cannot open shared library during RUN comm

everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:
dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared
libraries: libcudart.so.5.0: cannot open shared object file: No such
file or directory
RUN FAILED (exit value 127, total time: 191ms)
the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error.
I was able to run it few minutes ago, what might happened?
I have added file my_lib to ld.so.conf.d containing such text:
/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64
can it be a link issue libcudart.so.5.0 -> licudart.so?
there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib)
why it complains about .so.5.0? mayve link like:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
is necessary
it is related to link to shared library I think
root#comp:# echo $LD_LIBRARY_PATH
/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib
isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing.
the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always
add to the Project -> Properties -> Run -> Environment
Name: LD_LIBRARY_PATH
Value:
$LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
Thank you all. I don't know what happened before as it worked just fine.

Error reading manifest file "...datanucleus-core-3.0.0-release.jar!/plugin.xml"

I got a very strange error. This what I've done:
I create a project (with Netbeans) which include datanucleuse-core-3.0.0-release.jar. The project can be built successfully. It also ran smoothly when I tried to run it with Netbeans or running 'java -jar <.jar bundle>' in dist folder via command prompt.
The problem is, when I copy that dist folder into another location and tried to run it again with command prompt, it gave these errors:
Exception in thread "main" Error reading manifest file
"jar:file:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml"
org.datanucleus.exceptions.NucleusException: Error reading manifest
file "jar:fi
le:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml"
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:481)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(No
nManagedPluginRegistry.java:219)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoin
ts(NonManagedPluginRegistry.java:160)
at org.datanucleus.plugin.PluginManager.(PluginManager.java:62)
at org.datanucleus.NucleusContext.(NucleusContext.java:211)
at org.datanucleus.NucleusContext.(NucleusContext.java:166)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.(JDOPersis
tenceManagerFactory.java:360)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenc
eManagerFactory(JDOPersistenceManagerFactory.java:290)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceMa
nagerFactory(JDOPersistenceManagerFactory.java:191)
at com.ncr.server.Server.(Server.java:68)
at com.ncr.server.Server.main(Server.java:91) Caused by: java.io.FileNotFoundException: E:\ (The system cannot find the path s
pecified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.jar.JarFile.(JarFile.java:135)
at java.util.jar.JarFile.(JarFile.java:99)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:390)
... 10 more Nested Throwables StackTrace: java.io.FileNotFoundException: E:\ (The system cannot find the path
specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.jar.JarFile.(JarFile.java:135)
at java.util.jar.JarFile.(JarFile.java:99)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:390)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(No
nManagedPluginRegistry.java:219)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoin
ts(NonManagedPluginRegistry.java:160)
at org.datanucleus.plugin.PluginManager.(PluginManager.java:62)
at org.datanucleus.NucleusContext.(NucleusContext.java:211)
at org.datanucleus.NucleusContext.(NucleusContext.java:166)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.(JDOPersis
tenceManagerFactory.java:360)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenc
eManagerFactory(JDOPersistenceManagerFactory.java:290)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceMa
nagerFactory(JDOPersistenceManagerFactory.java:191)
at com.ncr.server.Server.(Server.java:68)
at com.ncr.server.Server.main(Server.java:91)
Anybody got clue ?
I am really sorry for everyone, especially for datanucleus members in StackOverflow.
Apparently the problem is me, not the netbeans, datanucleus API, nor anyone.
As you can see from "jar:file:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml", I put the "dist" folder from Netbeans in "E:/!new" folder. I don't know why but the "!new" folder seems to cause the extra exclamation mark(!) in "release.jar!".
I move the dist folder into D:/ and it worked !!
So, if anyone ever experience this problem (precedence a folder's name with exclamation mark and accidentally put a project with datanucleus-core-3.0.0-release.jar inside it), that's the solution.
Thank you.

Compiling android native app calling ndk-build from eclipse, on ubuntu

On ubuntu 11.10 I installed eclipse from repositories, installed adt and cdt plugins. I am able to compile the hello-jni example using command line, but i would like to use eclipse for the task.
I followed the guide here: http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/ and defined a PATH variable in eclipse preferences (window->preferences->c/c++->environment), pointing to the ndk-r7b folder. But the project won't buid. I get this error:
(Cannot run program "ndk-build"
(in directory "/home/athos/android/ndk-r7b/samples/hello-jni"):
java.io.IOException:
error=2, File o directory non esistente)
(last line should be "no such file or directory" in english)
If I specify "${PATH}/ndk-build" or "/home/athos/android/ndk-r7b/ndk-build" as the build command. i get this:
/home/lavoro/android/ndk-r7b/ndk-build
ERROR: Cannot find 'make' program. Please install Cygwin make package
/home/lavoro/android/ndk-r7b/ndk-build: 40: dirname: not found
or define the GNUMAKE variable to point to it.
If I define the GNUMAKE variable in window->preferences->c/c++->environment i get this:
ERROR: Your GNUMAKE variable is defined to an invalid name: /usr/bin/make
Please fix it to point to a valid make executable (e.g. /usr/bin/make)
Which is funny, since It suggests the exact same directory I indicated. Make is installed and present at the indicated location.
What am I missing?
It's a bit ugly, but you can always put
/fully/qualified/path/to/ndk-build
In your build command.

Error running ensime-source-buffer-loaded-hook - OSX with ENSIME and Emacs

I get the following error when trying to start ENSIME on OSX through Emacs
Error running ensime-source-buffer-loaded-hook
I am following the instructions from the github source page
Scala Mode is Working
ENSIME Server appears to be installed, is there any way to verify this?
The sbt plugin is installed and I have a .ensime config file generated
Starting Emacs gives me the above error. When I manually try M-x ensime I get the following:
Failed to connect to Swank: server process exited.
Okay, here's how I solved it:
Locate the ensime folder and run bin/server /tmp/ensime.port.
I got the error:
java -classpath ... org.ensime.server.Server ./port
Unrecognized VM option '+DoEscapeAnalysis'
Could not create the Java virtual machine.
I have no idea what DoEscapeAnalysis is for, but I tried deleting it from bin/server and now everything seems to work.
See here: https://gist.github.com/2300737
For my case on Windows 7, with the same error message, but the root cause was the original setting for the maximum heap size -Xmx1512M was too large, I had to change to -Xmx768M to get over the error message.
I had also removed the byte compiled elisp code, and restart to avoid another error of
"call time out".
I also had this error on linux with emacs 24.3.1 and resolved it by specifying the full path to java in bin/server.