I am trying to run the 'TableauSDKSample' java program on an Amazon EMR machine running Linux (64 bit) using my own custom jar. When I try to run my program, I get the following error:
A fatal error occurred while creating the extract:
Hyper Server did not call back on the callback port: process = 30320
Printing stack trace now:
com.tableausoftware.TableauException: Hyper Server did not call back on
the callback port: process = 30320
at com.tableausoftware.hyperextract.Extract.<init>(Unknown Source)
at com.samsung.tabluea.TableauSDKSample.createOrOpenExtract(TableauSDKSample.j
ava:119)
at com.samsung.tabluea.TableauSDKSample.main(TableauSDKSample.java:234)
Exiting now.
Here's what I did:
I downloaded the Extract API for C/C++/Java (64-bit) (.tar.gz file)
I untarred the above file in install-dir using tar -xvzf
extractapi-linux-x86_64-10-5-0.tar.gz
I created a jar using maven
for my very simple custom project having only one file
TableauSDKSample.java
To install the shared libraries, I copied all
the files from
install-dir/hyperextractapi-cpp-linux-gcc-x86_64-release-2017.4.0.127.r9c0f968e/lib64/tableausdk/
to /lib64/. By doing this, I avoid setting LD_LIBRARY_PATH
explicitly. See this for details: https://software.intel.com/en-us/articles/install-a-unix-including-linux-shared-library
Then I tried to run my program using
the following command:
sudo java -cp install-dir/hyperextractapi-cpp-linux-gcc-x86_64-release-2017.4.0.127.r9c0f968e/lib64/tableausdk/:install-dir/hyperextractapi-cpp-linux-gcc-x86_64-release-2017.4.0.127.r9c0f968e/lib64/tableausdk/Java/:/path/to/my/custom-jar.jar fully.qualified.MainClass
(where my main class is TableauSDKSample)
There is definitely no issue with the code as it is running on my local system where I use Eclipse IDE to run it. What am I doing wrong?
Related
I want to do remote code debugging. So I ran below command in my remote machine:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -jar myapp.jar.
Then I created debug config in eclipse. But I am getting a error in remote machine stating:
Could not find or load main method
I have set the buildpath of eclipse correctly. The jar has the manifest which states the correct main method in jar. Still I am facing this issue. So what am I doing wrong?
Thanks.
First, does the program by itself run correctly?
I mean, in the remote machine: java -jar myapp.jar
Second, the parameters you have used are typical for JRE1.4.
For a more advance Java version, take a look here:
Remote debugging a Java application
I downloaded the Carrot2 Document clustering server build 3.15.0 for Mac. The read me file says:
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
Mac OS Sierra doesn't make it easy, but I got 1.8.0_112 installed.
The problem is that I don't know how to execute the 'dcs' script.
There are .cmd, .sh, .war, and .jar files. I wasn't sure which of those to work with. I thought .jar looked promising, so I followed some of this thread and tried this in a terminal window:
java -jar invoker.jar
I cd-ed to the correct directory, but it just says Provide main class, but I'm not sure what or where that is.
Can anybody provide instructions or a link to how to do this?
Use the dcs.sh (on Linux/Mac) and dcs.cmd (on Windows) to start the server. The scripts will set some extra options for the JVM and then start the DCS. In case of any problems, append the -v option to see diagnostic output.
I've made my first clojure app and I've built it with leiningen by running lein ring uberjar. I can run this on my dev machine (fedora 23) and I can run this on my ubuntu production machine java -jar tomahawk.jar. I've followed the digital ocean tutorial here that describes how to set up the environment. My supervisor conf is the following:
[program:tomahawk]
environment=TOMAHAWK_DB=$TOMAHAWK_DB
command=/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -jar tomahawk.jar
logfile=/tmp/supervisord.log
directory=/var/www/tomahawk/app
user=www-data
autostart=true
autorestart=true
startretries=3
redirect_stderr=true
stdout_logfile=/var/www/logs/tomahawk.app.log
However, when using this through nginx, i get the error
2016-03-19 23:34:08.594:WARN:oejs.AbstractHttpConnection:/
java.sql.SQLException: No suitable driver found for jdbc:sqlserver:$
at java.sql.DriverManager.getConnection(DriverManager.java:596)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:255)
This comes from the com.microsoft.sqldbc4.jar file. However, I can run this standalone jar file, as well as I can run sudo -u www-data env TOMAHAWK_DB=$TOMAHAWK_DB java -jar tomahawk.jar just fine. Also, while this is running, I can hit it through the nginx reverse proxy.
I've searched around and found an unanswered email on the supervisor mailing list from 2011. Why can I only sometimes see the missing jar file?
I've tried putting it inside of the /usr/lib/jvm/.../lib/ext location for my jvm, bundled inside of the jar file, running from Tomcat, etc. I've made an upstart script as well with identical results as well. I am not sure what other paths I can try and was wondering if anyone had any insights.
I have a runnable jar file produced from clojure code that I am running on an embedded system (udoo - http://www.udoo.org/), which is running a version of Ubuntu for its OS (udoobuntu - http://www.udoo.org/udoobuntu-the-official-udoo-linux-operating-system/).
The jar file contains a clojure library I wrote, that includes a some Java swing stuff.
Running the jar manually via the command line using:
sudo java -jar myjar.jar
works fine. The sudo is needed for certain usb device permissions.
My problem arises when I try to start the jar using an upstart script called testjob. The relevant part of /etc/init/testjob.conf looks like:
start on (desktop-session-start)
expect fork
script
exec ./home/ubuntu/start > /home/ubuntu/boot-jar.log 2>&1 &
end script
Where /home/ubuntu/start is the following shell script:
#!/bin/sh
sudo java -jar /home/ubuntu/myjar.jar
exit 0
When this runs, either manually via:
sudo start testjob
or automatically by rebooting the system, I get the following output to the log file:
Exception in thread "main" java.lang.ExceptionInInitializerError
... <bunch of meaningless classloading stuff>
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at sun.awt.HeadlessToolkit.getMenuShortcutKeyMask(HeadlessToolkit.java:236)
at seesaw.keystroke$preprocess_descriptor.invoke(keystroke.clj:25)
at seesaw.keystroke$keystroke.invoke(keystroke.clj:50)
at seesaw.keystroke$keystroke.invoke(keystroke.clj:49)
at seesaw.keymap$map_key.doInvoke(keymap.clj:107)
at clojure.lang.RestFn.invoke(RestFn.java:445)
at seesaw.widgets.log_window$log_window.doInvoke(log_window.clj:88)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at physicloud.utils__init.load(Unknown Source)
at physicloud.utils__init.<clinit>(Unknown Source)
... 52 more
I don't actually make any UI calls, but the run fails on classloading of the library. I know that a simple fix would be to remove the Java Swing code from the library, but the library is generalized to allow ui output to capable machines, and therefore I am looking for a workaround. It doesn't make sense to me why the jar will run via java -jar but not in the script.
I tried different cases for the upstart script's "start on" condition, all of which produced the same result.
I tried setting the $DISPLAY environment variable in the upstart script before executing the jar, but to no avail.
I also tried scheduling the start script using crontab #reboot, but the error was the same.
Anyone have suggestions?
You can pass -Djava.awt.headless=true to java to allow running non-GUI applications that happen to depend on some UI libraries.
For example,
java -Djava.awt.headless=true -jar something.jar
I would like to be able to run a sencha compilation without a full java installation on my machine. I.e. I want to just include the java binaries in a tools folder. The only part of the compilation that doesn't work currently is the final part which compresses the js files. I'm getting the following error:
uncaught exception: Stream:"Could not open the pipe" (exec://java -jar
"C:\projects\Tools\SenchaSDKTools-1.2.3\jsbuilder\ycompressor\ycompressor.jar"
--type js -o "C:\inetpub\wwwroot\ext\WebApp\app-all.js" "C:\inetpub\wwwroot\ext\WebApp\app-all.jstemp-1098294810303.0708")
To try this out I created a simple js file which does only the failing step:
var cmd = 'java -jar "C:\\projects\\tools\\SenchaSDKTools-1.2.3\\jsbuilder\\ycompressor\\ycompressor.jar" --type js -o "C:\\inetpub\\wwwroot\\ext\\WebApp\\app-all.js" "C:\\inetpub\\wwwroot\\ext\\WebApp\\app-all.js-temp-1098294810303.0708"';
var stream = new Stream('exec://' + cmd);
stream.close();
then ran the simple js file using jsdb from a command line:
jsdb simple.js
When java is fully installed the above code works fine, when I uninstall java the above line fails with the error message above.
I'm guessing it's something todo with the java alias. I have little to no knowledge of this framework/language, so I'm hoping it's going to be very obvious to some experts out there as to how to fix this without a full java install. I.e. making the java alias know the location of the java binaries.
Oh dear... thanks to Jacob for helping me on this..
Add the java locations to the path environment variables and it work.
E.g.
C:\JavaLocation\jre6;C:\JavaLocation\jre6\bin