Home » Eclipse Projects » Rich Client Platform (RCP) » RCP + Java Web Start, Application doesn't launch
RCP + Java Web Start, Application doesn't launch [message #457433] |
Tue, 31 October 2006 17:33 |
Eclipse User |
|
|
|
Originally posted by: pi.trash-mail.de
Hi,
I want to deploy a RCP Application via Web Start. I read the exlipse help about that subject, but I don't get it to work. I created a wrapper feature for the RCP application, exported the feature as jar files and signed them. Then I created the JNLP start file.
When I open the JNLP file in a browser, Java Web Start finds all the jars and downloads them and asks for the permission to start the application. But after that nothing happens. I consulted the Web Start Log files but they are empty. I have no idea if the startup.jar is even executed?
I don't know where I should start to look, to solve this problem. If anyone has had the same problems and solved them, or has an idea where I should start to look for the cause of this problem, I would be very thankful for suggestions. Also if you know some good resources to get started with RCP and Web Start I would appreciate if you would post the links.
I programmed a little hello world swing jframe app and started it via Web Start, it worked without problems. I also tried to start the RCP mail template application with Web Start, but that didn't work.
Pyoeter
|
|
| | | | | |
Re: RCP + Java Web Start, Application doesn't launch [message #457453 is a reply to message #457451] |
Tue, 31 October 2006 22:29 |
Peter Rutsch Messages: 19 Registered: July 2009 |
Junior Member |
|
|
First, yes I think Java Web Start downloads everything correctly. I looked into the /myhome/.java/deployment/cache/... directory and all the jars and jnlp files are downloaded into the right location. All with a "DM" prefix.
If I understand my JNLP files right, then the "MAIN" JNLP file addresses the wrapper feature which is located in file:///home/prutsch/bin/features/com.XXXX.XXXX.feature_1.0. 0.jnlp
The JNLP file for the wrapper feature (which is the JNLP file of feature 1), then points to the second feature, the rcp feature which is located in file:///home/prutsch/bin/features/org.eclipse.rcp_3.2.0.v200 60609m-SVDNgVrNoh-MeGG.jnlp"
So if the address always starts with the code base and then adds the address that is written in the extension href"...", it should find everything.
Strange is also, that in the cache directory, no configuration directory is created when I start the application via Web Start. If I do it by hand with "java -jar /cachelocation/RMstartup.jar" then it creates the configuration directory and logs an error
java.lang.RuntimeException: Could not find framework
at org.eclipse.core.launcher.Main.getBootPath(Main.java:639)
at org.eclipse.core.launcher.Main.basicRun(Main.java:274)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952) Which isn't surprising.
So I have the impression, that nothing happens, after downloading everything needed. The only thing that happens, is that the Web Start Console appears for a few seconds and then disappars again.
Thank you for taking the time looking at the JNLP Files.
Pyoeter
|
|
| | | | | |
Re: RCP + Java Web Start, Application doesn't launch [message #457521 is a reply to message #457518] |
Wed, 01 November 2006 23:32 |
Alex Blewitt Messages: 946 Registered: July 2009 |
Senior Member |
|
|
Your 'add required plugins to the configuration' is adding things that you aren't making explicitly clear in your feature setup. As a result, your feature doesn't contain all the plugins.
In the examples, look for ClassNotFoundErrors, such as
java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
That's a clue that it's not finding/downloading the org.eclipse.swt plugin or one of its dependencies (but since SWT doesn't depend on anything else, probably that that isn't being found).
Are you sure you've got the right version of the SWT? The versions look different in the fragments vs the plugins:
<jar href="plugins/org.eclipse.swt_3.2.0.v3232o.jar"/>
:
<jar href="plugins/org.eclipse.swt.win32.win32.x86_3.2.0.v3232m.jar"/>
Note that one ends in 'o' and the other ends in 'm'. This may be the desired outcome, or it may not. You should also check in the product directory what the versions of each of the bundles is; it's quite possible that when running internally, you're running against a slightly different (e.g. updated) version of Eclipse.
To find out what bundles aren't starting, try running the set of jars from the command line with:
java -Dosgi.configuration.area=... -Dosgi.instance.area=... -jar startup.jar -console -noExit
That will bring you into the OSGi console (? is help) and you can then issue a 'ss' to find out what bundles are installed, or cannot be resolved. 'diag' will give you more information.
If you've got bundle incompatibilities (or missing bundles) then this will help give you a clue.
Also, try creating a new launch configuration and *only* enable the RCP and XXX feature. If it doesn't run like that, you've got some missing dependencies in your features you need to fix.
Alex.
|
|
| |
Re: RCP + Java Web Start, Application doesn't launch [message #457524 is a reply to message #457523] |
Thu, 02 November 2006 00:05 |
Alex Blewitt Messages: 946 Registered: July 2009 |
Senior Member |
|
|
Try running this with the -console and -noExit flags, and use the OSGi console to list what's there. You might find that you've not included everything you need in your main feature, or that the SWT is out of date. Are you running on e.g. 3.2.1 which you upgraded from 3.2.0? If so, consider downloading a fresh copy of 3.2.1 and then setting up a different workspace, then import your projects in again. At least then you'll know whether you've got a consistent set of plugins, if not a complete set.
You can also try to create a new (empty) launch config in PDE, and *just* add the features, and try to startup. With any luck, that shouldn't work. Take a note of all the plugins that are selected, and then click on 'validate plugins' -- it should give you a warning if there are any missing. If that doesn't work, try to add required bundles and then see what's different. Chances are, you're just missing something that the PDE can help with.
Lastly, check the RCP feature that you're exporting it with. If you've got an RCP feature from 3.2.0, but have 3.2.1 installed (or vice versa), you might get problems since the version numbers won't match exactly.
Alex.
|
|
|
Re: RCP + Java Web Start, Application doesn't launch [message #457579 is a reply to message #457524] |
Thu, 02 November 2006 18:45 |
Peter Rutsch Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Just a short report what is going on. I downloaded and installed the Eclipse Version 3.3.0 Build id: I20060922-0010. First small success: I can now export a product that is based on features and run it.
I tested to run the startup.jar of this exported product with the command you told me (java -Dosgi.configuration.area=... -Dosgi.instance.area=... -jar startup.jar -console -noExit ). It doesn't start the application. What I got in the osgi console is this
Framework is launched.
id State Bundle
0 ACTIVE system.bundle_3.3.0.v20060919
32 ACTIVE org.eclipse.equinox.common_3.3.0.v20060906
33 ACTIVE org.eclipse.update.configurator_3.2.0.v20092006-1400
34 ACTIVE org.eclipse.core.runtime_3.2.100.v20060905
35 RESOLVED test.rcphellowebstart_1.0.0
36 ACTIVE org.eclipse.core.runtime.compatibility.auth_3.2.0.v20060717
37 RESOLVED org.eclipse.jface_3.3.0.I20060921-0010
38 ACTIVE org.eclipse.equinox.registry_3.2.100.v20060918
40 RESOLVED com.ibm.icu_3.4.4.1
41 RESOLVED org.eclipse.core.commands_3.2.0.I20060918-0010
43 RESOLVED org.eclipse.rcp_3.2.0.v20060605
44 RESOLVED org.eclipse.jface.databinding_1.0.100.I20060918-0010
46 RESOLVED org.eclipse.ui.workbench_3.3.0.I20060921-0010
47 RESOLVED org.eclipse.core.expressions_3.2.0.v20060920-1200
48 RESOLVED org.eclipse.core.contenttype_3.2.100.v20060808
49 ACTIVE org.eclipse.core.jobs_3.2.0.v20060731
51 RESOLVED org.eclipse.swt_3.3.0.v3309a
52 RESOLVED org.eclipse.ui_3.3.0.I20060921-0010
53 RESOLVED org.eclipse.help_3.3.0.v20060915
54 INSTALLED org.eclipse.swt.gtk.linux.x86_3.3.0.v3309
55 ACTIVE org.eclipse.equinox.preferences_3.2.100.v20060918
Remark that org.eclipse.swt.gtk.linux.x86_3.3.0.v3309 is only installed not resolved or active. If I execute the compiled launcher and look at the osgi console the application runs and this package is marked as resolved.
Then I looked at the log file it created. The following is the output
!SESSION 2006-11-02 12:15:55.397 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=motif, NL=en_CA
Command-line arguments: -console
..
**Error messages like in one of the previous posts**
..
..
!ENTRY org.eclipse.osgi 2 0 2006-11-02 12:15:57.132
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2006-11-02 12:15:57.132
!MESSAGE Bundle update@plugins/org.eclipse.swt.gtk.linux.x86_3.3.0.v3309.jar [23] was not resolved.
!SUBENTRY 2 org.eclipse.swt.gtk.linux.x86 2 0 2006-11-02 12:15:57.132
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
!SUBENTRY 2 org.eclipse.swt.gtk.linux.x86 2 0 2006-11-02 12:15:57.132
!MESSAGE Missing Constraint: Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
Look at these lines:
BootLoader constants: OS=linux, ARCH=x86, WS=motif, NL=en_CA
..
..
..
!MESSAGE Platform filter did not match: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))
So what happens is that for any reason java wants to start with the "motif" window system but the package is exported with gtk. So I tried to add to the
"java -Dosgi.configuration.area=... startup.jar -console -noExit" command "-ws gtk" and it started perfectly.
So I guess that with Java Web Start the same does happen. When I look at the log file of the Java Web Start launch I can see the same in the header, it launches as "motif" but should launch as "gtk". The Eclipse help says that you should add this to your main jnlp to solve this issue:
<resources os="Linux"/>
<property name="osgi.ws" value="gtk"/>
</resources>
I did that but it still launches as "motif".
So here is my main jnlp file again:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp
spec="1.0+"
codebase="file:///home/prutsch/bin/helloworld"
href="hello.jnlp"> <!-- URL to the site containing the jnlp application. It should match the value used on export. Href, the name of this file -->
<information>
<!-- user readable name of the application -->
<title> Hello Web Start </title>
<!-- vendor name -->
<vendor>Hello</vendor>
<!-- vendor homepage -->
<homepage href="http://www.helloworld.com" />
<!-- product description -->
<description>GUI Aplication to test Java Web Start</description>
<icon kind="splash" href="splash.gif"/>
</information>
<!--request all permissions from the application. This does not change-->
<security>
<all-permissions/>
</security>
<!-- The name of the main class to execute. This does not change-->
<application-desc main-class="org.eclipse.core.launcher.WebStartMain">
<argument>-nosplash</argument>
</application-desc>
<resources>
<!-- Reference to the startup.jar. This does not change -->
<jar href="startup.jar"/>
<!-- Reference to all the plugins and features constituting the application -->
<!-- Here we are referring to the wrapper feature since it transitively refers to all the other plug-ins necessary -->
<extension
name="Hello Feature"
href="features/test.rcphellowebstart.feature_1.0.0.jnlp"/>
<!-- Information usually specified in the config.ini -->
<property
name="osgi.instance.area"
value="/tmp/workspace"/>
<property
name="osgi.configuration.area"
value="/tmp/config"/>
<!-- The id of the product to run, like found in the overview page of the product editor-->
<property
name="eclipse.product"
value="test.rcphellowebstart.product"/>
</resources>
<!-- Indicate on a platform basis which JRE to use -->
<resources os="Mac">
<j2se version="1.5+" java-vm-args="-XstartOnFirstThread"/>
</resources>
<resources os="Windows">
<j2se version="1.5+"/>
</resources>
<resources os="Linux">
<j2se version="1.5+"/>
</resources>
<!-- start as gtk -->
<resources os="Linux"/>
<property name="osgi.ws" value="gtk"/>
</resources>
</jnlp>
OK, so far my results. Java Web Start still doesn't work but I have the feeling that I'm almost there.(Hopefully)
Pyoeter
|
|
| |
Re: RCP + Java Web Start, Application doesn't launch [message #457704 is a reply to message #457585] |
Fri, 03 November 2006 22:46 |
Peter Rutsch Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Hi,
so here are the latest news.
I put the hello world application on a web server and opened the jnlp file on a windows machine. No problems, everything worked fine.Then I started it on a Mac. The application launched, but didn't respond to user inputs, e.g. you couldn't close it anymore. This is probably the same problem as in this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=63306
I also tried your suggestion to telnet into the application, but that didn't work. I added this to the jnlp file:
<!-- The name of the main class to execute. This does not change-->
<application-desc main-class="org.eclipse.core.launcher.WebStartMain">
<argument>-nosplash</argument>
<argument>-console 1234</argument>
<argument>-noExit</argument>
<argument>-ws gtk</argument>
</application-desc>
You see I tried some other things as well, e.g. I tried to pass -ws gtk to the command line. I just wanted to see what happens, because this way I was able to launch the feature. But no success.
I tried things like that:
<!-- Indicate on a platform basis which JRE to use -->
<resources os="Mac">
<j2se version="1.5+" java-vm-args="-XstartOnFirstThread"/>
</resources>
<resources os="Linux">
<j2se version="1.5+" java-vm-args="-ws gtk"/>
</resources>
No success.
I looked again in the cache folder of jws, and actually I didn't look right the first time when I checked the folder. My machine didn't download the org.eclipse.swt.gtk.linux.x86_3.3.0.v3309.jar. I wondered why. Then I checked like you suggested what java returns when you check the system properties for os.name and os.arch. It is "Linux" and "i386", so I added this to the jnlp file where all the OS connections are specified:
<resources os="Linux" arch="i386">
<jar href="plugins/org.eclipse.swt.gtk.linux.x86_3.3.0.v3309.jar"/>
</resources>
Then I checked the folder again, and this time it downloaded it. But still no web start. :-(
Then I changed it to motif:
<resources os="Linux" arch="i386">
<jar href="plugins/org.eclipse.swt.gtk.linux.x86_3.3.0.v3309.jar"/>
</resources>
and got this error message:
!SESSION 2006-11-03 17:42:10.986 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=motif, NL=en_CA
Framework arguments: -console 1234
Command-line arguments: -console 1234
!ENTRY org.eclipse.osgi 4 0 2006-11-03 17:42:13.070
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: /tmp/config/org.eclipse.osgi/bundles/27/1/.cp/libswt-motif-3309.so: libXm.so.2: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1660)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.motif.OS.<clinit>(OS.java:18)
at org.eclipse.swt.graphics.Device.<clinit>(Device.java:115)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:433)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at test.rcphellowebstart.Application.run(Application.java:16)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341)
at org.eclipse.core.launcher.Main.basicRun(Main.java:285)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain.java:59)
at org.eclipse.core.launcher.Main.run(Main.java:987)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1154)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1101)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:944)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:515)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:218)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:595)
That's it so far.
|
|
| | |
Re: RCP + Java Web Start, Application doesn't launch [message #457711 is a reply to message #457709] |
Sat, 04 November 2006 08:50 |
Alex Blewitt Messages: 946 Registered: July 2009 |
Senior Member |
|
|
Well, of course you can't say -ws gtk on a Windows box -- that would prevent it from running on a bunch of places! You might have to have a separate JNLP for Linux. I'm not really sure why the resource didn't work. You could try the following:
Move the -ws arg to a osgi.ws property (but on all platforms). See if it launches on Linux. Then, once you've tested this, you could try and find out whether putting it in a Linux resource block (maybe it's the capital letter in Linux? Did you try linux?). That should fix that problem.
As for the Mac/WebStart thing; you've found the bug, Cc yourself on it. What's happening is that the WebStart is starting up the AWT thread, and the AWT thread is getting in the way of the SWT thread running. What they're having to do is find a way of getting AWT to shut down prior to SWT coming up after the load, or use a different process to launch the downloaded WebStart. However, since those changes require bugs to be fixed in the JavaVM, it's really a matter of waiting for Apple's engineers to solve the problem and make a new version of the VM with the fixes. (They've done this already; the -XstartOnFirstThread argument is a fix to support SWT on Apple; it's just that WebStart brings up the AWT thread before this argument gets processed at the moment.) Stay tuned ...
|
|
| | | | | |
Re: RCP + Java Web Start, Application doesn't launch [message #458214 is a reply to message #457709] |
Wed, 15 November 2006 18:34 |
Eclipse User |
|
|
|
Originally posted by: linux.kaiho.de
Hi Pyoeter!
I've the same problem that you described in http://eclipsezone.com/eclipse/forums/t83652.html#92058187:
org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid
....
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
The error occurs although I've added ...property name="osgi.ws" value="gtk"... in the JNLP-file and that seems to work:
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
You said "So the problem was that java didn't launch with gtk." and this sounds as I have to say java/javaws to start with gtk (besides the osgi.ws-thing). How do I accomplish that? (My System is SUSE 10.0).
Thanks for your help!
Kai
|
|
| | | | |
Goto Forum:
Current Time: Tue Apr 23 07:01:21 GMT 2024
Powered by FUDForum. Page generated in 0.06361 seconds
|