Using ubuntu 11.10. When I run jvisualvm from the command line, the output is : "No protocol specified". Then the program exits.
Jayan is right about this looking like a DISPLAY error, which can happen when you're trying to run commands on the same machine as a different user or on a remote machine. Here's a quick way to fix it if you're not worried about security.
Type xhost + on your local machine as the main user (the user who can start programs that bring up windows, such as xterm).
If you're running a command as another user on the same machine, you'll probably be able to do it now. If not, try export DISPLAY=localhost:0.0 as that user.
If you're running a command on a remote machine, but want it to show up on your local machine, try export DISPLAY=YOUR_IP_ADDRESS:0.0 on the remote machine.
I encountered it when trying to run JVisualVM on my local machine as user mapred to analyze some Hadoop jobs. I could imagine having to log into a remote machine to do it when Hadoop is running across a cluster (instead of on my local machine in pseudodistributed mode).
(The comment about security: xhost + will allow anyone on the Internet to pop up windows on your computer if they know your IP address. The effect of xhost resets when you reboot, so it's usually not an issue on a personal computer.)
Did you try running any other application with GUI? If they too fail with similar error, it related to display setting.
One way to get this error is not having correct DISPLAY defined. (Please post the full exception. )
Related
I need to run the following command using java:
"wmic product where description='" + someProgram + "' uninstall"
This CMD works only when running as Administrator.
This program will run in several machines with different passwords, so I can't insert passwords in my program.
How can I run it as Admin, without running the whole program as administrator?
Edit:
This program runs on a local Windows machine (no dealing with remotes)
I believe it is possible in Unix for your Admin to write to write a Shell Script which runs with the priveleges of another User-ID & which members of the Group (or Anyone) may start.
See: Setuid & chmod
If you are looking for a remote solution (where the Java makes say an SSH connection to the remote and then runs the command), then can't you configure the process running on those machines - providing the SSH server - so it runs commands as an appropriately privileged user?
AND/OR find a localgroup that gives the permissions you need?
I'm trying to run my projects in eclipse but whenever i run my project its showing
Address already in use: JVM_Bind Exception.
How to solve this one?
You have another process that uses the same port as your project. Try to identifiy the port and try to find it using netstat -ano | find ":80" cmd line (if you are a windows user). the "80" is port numbe. That's my best hint because you don't share enought details.
On Windows
1. Hit Ctrl-alt-delete and look at open programs. Look for java.exe.
2. From a command window, run netstat -an. Check which ports are in use. You can identify which application is running this way, then close it from the Task Manager.
3. List item
If you intend to run both JIRA and Confluence on the same machine for trial purposes, you will need to change either of the listening port number from the default (8080).
If you are using older versions of JBoss, chances are that MS Office or MS OfficeCommunicator are engaging port 1098 and 1099. If you don't want to shut down these tools then your only option is using a different bind address
I have a java program in a weird condition where it has stopped running a certain thread.
I would like to connect to it using JMX, but I didn't provide the JMX arguments.
I could restart but then I would loss the information of the current condition.
I know that on Windows it can connect with jconsole on localhost without parameters, but my java app is running on a Linux server.
So any ideas on how to still be able to connect even without jmx parameters?
JConsole works on linux also. If the linux server have xhost or some remote displaying capability, I would just run jconsole on the linux server.
If you didn't enable JMX when the java program was started, you would not be able to connect remotely via JMX.
I found out that there is an option to dump the threads:
kill 3
Used it and found the reason.
Thank you.
In windows 2003 using JDK 1.7_21
So I setup Jemeter on my desktop to do an HTTP request to a specific URL and it works fine. But when I try from another machine I get a connect timeout.
The URL works fine in the I.E browser and I can also ping the domain from the command line. But for wahat ever reason the JVM doesn't want to connect.
In fact this is to test a sample HTTPClient I wrote. it's not the code because the code works off the desktop but on the server environment the JVM wont connect, proof JMeter wont either. but the browser and pings works.
I suspect java is getting it's network settings from somewhere different??? Proxy???
Well.. is IE/Windows using a proxy? You can check by going to to Internet Options > Connections > LAN Settings
If it is, you can set some JVM properties so that your Java application uses a proxy, there a couple ways of doing that, one way is through the command line when you execute it, you can use something similar to:
java -Dhttp.proxyHost=your.proxy -Dhttp.proxyPort=your.proxy.port -jar your.jar
or
java -Dhttp.proxyHost=your.proxy -Dhttp.proxyPort=your.proxy.port YourMainClass
My main goal: Collect specific information through the linux server on a windows machine. I want this program to ask the user for information needed and the program will log into the linux server with credentials "hard-coded" in the software and obtain the appropriate specific information the user requested.
My situation: This program will be used with different OSs (Mac, Windows, Linux, etc.). I have written a Perl script that does the task I want, but to run the script, you have to be on the linux server, but I want the user to not have to log into the linux server. I do have PuTTy on my computer which is what I use to log into the linux server. I don't know if that will be useful.
My program steps:
1) Once the user opens the program, a GUI will display different elements that the user interacts with. These elements ask for information that will aid in obtaining the specific information through the linux server.
2) Connect to the linux server. This is the tricky part. If I'm coding in Java, for example, making a normal application with Swing and I'm running on a windows machine, how can I connect straight to a linux server, enter commands, and obtain output information and send it to a text file?
3) Take the information that would have been outputed to the terminal screen and send it to a text file on the linux server and/or locally.
4) Finishing touches.....(closing the terminal, telling the user success or fail, etc.).
Like I said above, I have written a Perl script that you can run and will obtain all the information and send the output to a text file and do every thing I want it to do, but I want this to be more interactive and "user-friendly" and not have to make the user log into the linux server, but simply just open a program and click a few buttons. The program will log into (This login info would be the same username and password every time) to linux server, send the required information to a text file, and do everything for them.
Thanks in advance!!
Plink program from Putty site should be able to do what you want. See http://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter7.html#plink Problem would be with SSH fingerprint, that has to be confirmed first time from putty itself, not from plink.