barzan / dbseer

DBSeer
Apache License 2.0
117 stars 27 forks source link

Error while opening dbseer GUI #6

Open arunmarathe opened 6 years ago

arunmarathe commented 6 years ago

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.

dongyoungy commented 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.

arunmarathe commented 6 years ago

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.

arunmarathe commented 6 years ago

Hi,

Please refer to my comment above. Can you please help me? Thanks.

dongyoungy commented 6 years ago

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.

arunmarathe commented 6 years ago

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.(OctaveExec.java:61) at eu.simuline.octave.OctaveEngine.(OctaveEngine.java:91) at eu.simuline.octave.OctaveEngineFactory.getScriptEngine(OctaveEngineFactory.java:172) at main.main(main.java:11) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 4 more

Process finished with exit code 1

dongyoungy commented 6 years ago

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.

arunmarathe commented 6 years ago

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.(OctaveExec.java:149) at eu.simuline.octave.OctaveEngine.(OctaveEngine.java:91) at eu.simuline.octave.OctaveEngineFactory.getScriptEngine(OctaveEngineFactory.java:172) at main.main(main.java:11) Caused by: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at eu.simuline.octave.exec.OctaveExec.(OctaveExec.java:145) ... 3 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 5 more

Process finished with exit code 1

dongyoungy commented 6 years ago

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.

arunmarathe commented 6 years ago

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?

dongyoungy commented 6 years ago

This link shows how to set path variables in IntelliJ IDEA.

arunmarathe commented 6 years ago

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.(OctaveExec.java:149) at eu.simuline.octave.OctaveEngine.(OctaveEngine.java:91) at eu.simuline.octave.OctaveEngineFactory.getScriptEngine(OctaveEngineFactory.java:172) at main.main(main.java:11) Caused by: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at eu.simuline.octave.exec.OctaveExec.(OctaveExec.java:145) ... 3 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 5 more

Process finished with exit code 1

arunmarathe commented 6 years ago

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.

dongyoungy commented 6 years ago

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.

arunmarathe commented 6 years ago

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.(OctaveExec.java:149) at eu.simuline.octave.OctaveEngine.(OctaveEngine.java:91) at eu.simuline.octave.OctaveEngineFactory.getScriptEngine(OctaveEngineFactory.java:172) at main.main(main.java:11) Caused by: java.io.IOException: Cannot run program "octave": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at eu.simuline.octave.exec.OctaveExec.(OctaveExec.java:145) ... 3 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 5 more

Process finished with exit code 1

arunmarathe commented 6 years ago

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.

dongyoungy commented 6 years ago

Julia is required by DBSeer. Please take a look at the installation document.

arunmarathe commented 6 years ago

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.