eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
424 stars 179 forks source link

Java admin client launches on different workspace in Ubuntu (unity) #406

Closed gtnewton closed 6 years ago

gtnewton commented 9 years ago

Launching a jnlp file (icedtea openjdk 7, 64bit Ubuntu 14.04, unity, two monitors) causes the admin client to launch on another workspace (i.e. workspace to the right instead of on the current workspace). Also, no icon is displayed for the running client, making it appear as though the client has crashed. I'm not sure if this is reproducible on a single-monitor machine. To reproduce (from cli): 1) javaws http://exist-db.org/webstart/exist.jnlp 2) splash screen launches on left monitor, followed by warning dialogues being launched on the right monitor. 3) Once all dialogues are gone the screen is blank, and there is no indication that the app is running. 4) If workspaces are turned on, switch to next workspace. Admin client is running happily there.

I notice that other jnlp launchers (NASA World Wind, for example), do not do this. Is this something that can be fixed?

dizzzz commented 9 years ago

No, there is no way in Java webstart to define a specific monitor. I guess you need to find the answer in your OS....=

adamretter commented 9 years ago

Actually I think the problem is that we try to offset the eXist app to a position of x=100,y=100. Depending on your monitor setup and which is defined as the primary monitor, this offset may appear on one or other of the monitors.

I cannot test this as I do not have multiple monitors available right now, but it seems to me that replacing line 2449 in InteractiveClient.java frame.setLocation(100, 100); with frame.setLocationRelativeTo(null);. See here - https://github.com/eXist-db/exist/blob/develop/src/org/exist/client/InteractiveClient.java#L2449

dizzzz commented 9 years ago

Well found :) I am wondering why I did not see the behavior on my multi screen setting (win7)=

gtnewton commented 9 years ago

It seems to be a particularly Ubuntu Unity problem. A colleague running Gnome-Shell doesn't have the problem, and my Mac OS machine with two monitors doesn't have it. Don't get me wrong, I realize that this is a bit of a fringe case, but I thought it was worth reporting. The funny thing is that other apps don't do the same thing - the NASA WorldWind and Oxygen XML editor jnlp launchers, for example.

adamretter commented 9 years ago

@zwobit Could you try my patch and report if it works? It is rumoured you have a Ubuntu with dual screens ;-)

gtnewton commented 9 years ago

I just tried refreshing my tree and rebuilding, but I got 'Fatal: Launch Error: Could not launch JNLP file. The application has not been initialized'. I haven't tried a completely fresh pull/build/test cycle, but can if need be. I could also try against a public-facing machine running a build with your patch.

dizzzz commented 9 years ago

Greg, is there any trace visible? Note that the client requires Java8 since recently....

regards

Dannes

gtnewton commented 9 years ago

That's probably my problem. I'm on Ubuntu 14.04 and OpenJDK 8 is not available in repos. I'll try to work around it and will respond again when I have this aspect sorted out.

dizzzz commented 9 years ago

You can download an rpm from oracle ?

gtnewton commented 9 years ago

OK. I grabbed Oracle's java 8 and ran its javaws against a fresh build of eXist. The effect was the same: the admin client launches on a separate workspace. Question: to test the new patch, do I just do a fresh pull from github and run a build, or is it more complicated?

dizzzz commented 9 years ago

For webstart you also need to sign the jars; http://exist-db.org/exist/apps/doc/building.xml

gtnewton commented 9 years ago

OK, so I did a fresh git clone to a new directory, checked out the develop branch and ran build.sh, then build.sh jnlp-all. Turned on SSL and launched using startup.sh and then ran the oracle java 8 javaws with an htpps URL. Everything works just fine - that is, I do get an admin client. The problem is that it launches on the workspace to the right, as before. There is also no indicator that there is a running application (no icon in the dock).

adamretter commented 9 years ago

The easiest way to get Java 8 on Ubuntu with updates is to use this ppa for Oracle's JDK - http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

On 9 April 2015 at 16:04, Greg Newton notifications@github.com wrote:

That's probably my problem. I'm on Ubuntu 14.04 and OpenJDK 8 is not available in repos. I'll try to work around it and will respond again when I have this aspect sorted out.

— Reply to this email directly or view it on GitHub https://github.com/eXist-db/exist/issues/406#issuecomment-91257011.

Adam Retter

skype: adam.retter tweet: adamretter http://www.adamretter.org.uk

adamretter commented 9 years ago

@gtnewton The patch has not been committed yet, I was just asking @zwobit if he could apply and test it. But... as you are here, you can apply the patch to your local copy by changing the line as described here https://github.com/eXist-db/exist/issues/406#issuecomment-65797807 and then rebuilding eXist and seeing if it works for you. Let me know...

gtnewton commented 9 years ago

OK, I tried changing that line and re-compiled. No joy I'm afraid. Still launches on the workspace to the right.

adamretter commented 9 years ago

@gtnewton Okay thanks for reporting, I will try and test when I am next in the office as there is a second screen there.

adamretter commented 6 years ago

I am not sure we know how to fix this one. So I am closing for now, feel free to re-open if you have a solution.