Open arunmarathe opened 6 years ago
I believe that you need to set PATH
environmental variable to contain the directory where Octave.exe (or something similar) is located for the library that we use in DBSeer to invoke Octave correctly.
I think this SO thread discusses the similar issue.
Thanks. I added the following to the Path system variable on Windows: C:\Octave\Octave-4.4.1\bin
Then I did:
ant -f dbseer_front_end.xml
and then
$ java -Xmx2048M -jar ./out/artifacts/dbseer_front_end_jar/dbseer_front_end.jar ./dbseer.ini
I still get the same error.
Hi,
Please refer to my comment above. Can you please help me? Thanks.
DBSeer relies on a previous version of javaoctave to connect with Octave.
It seems to me that the error is caused by javaoctave not being able to find octave
binary.
Unfortunately, I do not personally have Windows machines to replicate this issue at the moment.
It would be great if you could write a simple Java program like following with most up-to-date javaoctave library (it seems someone else recently picked up the project again after it had been abandoned for a while):
OctaveEngineFactory oef = new OctaveEngineFactory();
oef.setArgsArray(new String[] {"--silent", "--no-init-file"})
OctaveEngine oe = oef.getScriptEngine();
If you can verify that it works on your environment, I can update the current source accordingly (or you can update it and create a pull request if it is so urgent).
Another alternative solution is to simply use MATLAB instead if it is available to you.
Hello,
I use the following jar version: javaoctave-0.7.1-20180728.005754-8.jar Available at: https://oss.sonatype.org/content/repositories/snapshots/eu/simuline/octave/javaoctave/0.7.1-SNAPSHOT/
(Sorry I am not a java expert, so please bear with me.)
The last line of your program produces an error. If I comment out the last line, everything works fine.
Here is my program:
import eu.simuline.octave.OctaveEngineFactory; import eu.simuline.octave.OctaveEngine;
public class main { public static void main(String[] args) { // Prints "Hello, World" in the terminal window. System.out.println("Hello, World");
OctaveEngineFactory oef = new OctaveEngineFactory();
oef.setArgsArray(new String[] {"--silent", "--no-init-file"});
OctaveEngine oe = oef.getScriptEngine();
}
}
And here is the error:
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=60569:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\src\JavaOctave\out\production\JavaOctave;C:\Users\a00476658\Downloads\javaoctave-0.7.1-20180728.005754-8.jar" main
Hello, World
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at eu.simuline.octave.exec.OctaveExec.
Process finished with exit code 1
I think that is a different error from your original error. This one seems to be caused by not having apache commons logging package. Please add the library and retry.
Thanks. Now I get a different error. Again it's the getScriptEngine() line that's causing the problem. If that line is commented out everything is fine.
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=60868:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\src\JavaOctave\out\production\JavaOctave;C:\Users\a00476658\Downloads\javaoctave-0.7.1-20180728.005754-8.jar;C:\Users\a00476658\Downloads\commons-logging-1.2-bin\commons-logging-1.2\commons-logging-1.2.jar" main
Hello, World
Exception in thread "main" eu.simuline.octave.exception.OctaveIOException: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified
at eu.simuline.octave.exec.OctaveExec.
Process finished with exit code 1
I think you just replicated the original error there.
The system cannot find the file specified
meaning it cannot find octave.exe somehow.
I advise you to make sure PATH is correctly set so that you can run octave from the directory where you run your simple java application.
OK, so we have a simple repro. That's good.
The system Path variable is set correctly. Just FYI, it is (prefix deleted): ... C:\apache-ant-1.10.5\bin;C:\Octave\Octave-4.4.1\bin
I have one doubt. Do I have to set the Path variable inside IntelliJ? If so, how?
This link shows how to set path variables in IntelliJ IDEA.
Set a PATH variable in IntelliJ IDEA. Still get the error:
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=61396:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\src\JavaOctave\out\production\JavaOctave;C:\Users\a00476658\Downloads\javaoctave-0.7.1-20180728.005754-8.jar;C:\Users\a00476658\Downloads\commons-logging-1.2-bin\commons-logging-1.2\commons-logging-1.2.jar" main
Hello, World
Exception in thread "main" eu.simuline.octave.exception.OctaveIOException: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified
at eu.simuline.octave.exec.OctaveExec.
Process finished with exit code 1
Here is an observation that might be interesting.
C:\Users\arunm>where date C:\Octave\Octave-4.4.1\bin\date.exe
C:\Users\arunm>where Octave C:\Octave\Octave-4.4.1\bin\octave.bat
So it's finding octave.bat, and not an EXE as one might expect.
Maybe you can try renaming octave.bat to something else temporarily? At this point, I am sorry that I do not have much more to suggest.
With octave.bat temporarily renamed:
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=61846:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\src\JavaOctave\out\production\JavaOctave;C:\Users\a00476658\Downloads\javaoctave-0.7.1-20180728.005754-8.jar;C:\Users\a00476658\Downloads\commons-logging-1.2-bin\commons-logging-1.2\commons-logging-1.2.jar" main
Hello, World
Exception in thread "main" eu.simuline.octave.exception.OctaveIOException: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified
at eu.simuline.octave.exec.OctaveExec.
Process finished with exit code 1
I think I have solved the "octave not found" error. Here is what I did:
$ cp ./Octave-4.4.1/bin/octave-cli.exe ./Octave-4.4.1/bin/octave.exe
I assume dbseer would like to have octave-cli running. I also assume in the prior version, the EXE was simplyl called "octave.exe".
Now I got a different error while trying to run UI:
Cannot run program "julia". CreateProcess: error = 2. The system cannot find the file specified
I solved that by adding julia's EXE location (the one that ends with \Julia-1.0.1\bin) to the system path.
Julia is required by DBSeer. Please take a look at the installation document.
Thanks. Now I need some suggestions on how to build middleware (which I assume will run on Linux). Should I start a different thread for that? There might be some issues during building middleware too.
I tried to run the dbseer GUI from within windows as follows:
$ java -Xmx2048M -jar ./out/artifacts/dbseer_front_end_jar/dbseer_front_end.jar ./dbseer.ini
And got an error window that displays: The binary 'octave' for Octave not found. Program will be terminated.
The dbseer.ini file contains a line:
stat_package=octave
And I have downloaded octave (and other required sub-packages) on Windows.