Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Launching RCP with JNLP problem
Launching RCP with JNLP problem [message #1695785] Tue, 19 May 2015 09:18 Go to next message
Jakub Wegrzyn is currently offline Jakub WegrzynFriend
Messages: 4
Registered: October 2014
Junior Member
Hi,
We want to distribute our application using JNLP. I started with this example:
thomaswabner.wordpress.com/2011/03/28/run-eclipse-rcp-application-via-webstart/
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fjava_web_start.htm
but after downloading, veryfing application jars it shuts down.

This is the log:

!ENTRY org.eclipse.osgi.compatibility.state 4 0 2015-05-19 10:18:53.059
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in class org.eclipse.osgi.compatibility.state.Activator.start() of bundle org.eclipse.osgi.compatibility.state.
	at org.eclipse.osgi.storage.FrameworkExtensionInstaller.startExtensionActivator(FrameworkExtensionInstaller.java:223)
	at org.eclipse.osgi.storage.FrameworkExtensionInstaller.startExtensionActivators(FrameworkExtensionInstaller.java:180)
	at org.eclipse.osgi.internal.framework.SystemBundleActivator.start(SystemBundleActivator.java:100)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java
       ....
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: [b]access denied ("org.osgi.framework.ServicePermission" "org.eclipse.osgi.service.resolver.PlatformAdmin" "register")[/b]
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.internalCheckPermission(EquinoxSecurityManager.java:117)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager$CheckPermissionAction.run(EquinoxSecurityManager.java:60)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager$CheckPermissionAction.run(EquinoxSecurityManager.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.checkPermission(EquinoxSecurityManager.java:88)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.checkPermission(EquinoxSecurityManager.java:186)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.checkRegisterServicePermission(ServiceRegistry.java:1068)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:212)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:998)
	at org.eclipse.osgi.compatibility.state.PlatformAdminImpl.start(PlatformAdminImpl.java:36)
	at org.eclipse.osgi.compatibility.state.Activator.start(Activator.java:19)
	at org.eclipse.osgi.storage.FrameworkExtensionInstaller.startActivator(FrameworkExtensionInstaller.java:231)
	at org.eclipse.osgi.storage.FrameworkExtensionInstaller.startExtensionActivator(FrameworkExtensionInstaller.java:217)
	... 34 more
Root exception:
java.security.AccessControlException: access denied ("org.osgi.framework.ServicePermission" "org.eclipse.osgi.service.resolver.PlatformAdmin" "register")
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.internalCheckPermission(EquinoxSecurityManager.java:117)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager$CheckPermissionAction.run(EquinoxSecurityManager.java:60)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager$CheckPermissionAction.run(EquinoxSecurityManager.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.checkPermission(EquinoxSecurityManager.java:88)
	at org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager.checkPermission(EquinoxSecurityManager.java:186)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.checkRegisterServicePermission(ServiceRegistry.java:1068)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:212)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:998)


Part of console log:
Insecure property: (eclipse.application, RCPtest.application) specified in unsigned jnlp file will not be set.
Insecure property: (osgi.parentClassloader, current) specified in unsigned jnlp file will not be set.
Insecure property: (osgi.instance.area, @user.home/RCP-Configuration/) specified in unsigned jnlp file will not be set.
Insecure property: (osgi.configuration.area, @user.home/RCP-Configuration/) specified in unsigned jnlp file will not be set.

(I created JNLP-INF/APPLICATION_TEMPLATE.JNLP)

Jakub

Re: Launching RCP with JNLP problem [message #1697044 is a reply to message #1695785] Mon, 01 June 2015 07:29 Go to previous message
Jakub Wegrzyn is currently offline Jakub WegrzynFriend
Messages: 4
Registered: October 2014
Junior Member
Hi,
I solved the issue. In general these tutorials are not complete - at least not in my case(I also tried first with simple RCP with a view).

In addition to the tutorials I had to do following:

1.Create template for your JNLP

2. Add permissions to your manifest file
Permissions: all-permissions
Codebase: URL
Application-Name: Name

3. Create a wrapper class for org.eclipse.equinox.launcher.WebStartMain (no need to add permissions to org.eclipse.equinox.launcher.jar)

public class WebStartLauncher {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Properties properties = System.getProperties();
        // copy properties to avoid ConcurrentModificationException
        Properties copiedProperties = new Properties();
        copiedProperties.putAll(properties);
        Set<Object> keys = copiedProperties.keySet();
        for (Object key : keys) {
            if (key instanceof String) {
                String keyString = (String) key;
                if (keyString.startsWith("jnlp.")) {
                    // re set all properties starting with the jnlp-prefix
                    // and set them without the prefix
                    String property = System.getProperty(keyString);
                    String replacedKeyString = keyString.replaceFirst("jnlp.", "");

                    System.setProperty(replacedKeyString, property);
                }
            }
        }

        WebStartMain.main(args);
    }
} 


4. Add start levels to your jnlp file

<property name="osgi.bundles"
value="org.eclipse.core.runtime@start,org.eclipse.equinox.common@2:start,org.eclipse.equinox.ds@1:start,org.eclipse.equinox.simpleconfigurator@1:start,org.eclipse.osgi@-1:start,org.eclipse.equinox.event@3:start" />
Previous Topic:Access workbench.xmi Information through code?
Next Topic:ToolBarManager alignment
Goto Forum:
  


Current Time: Thu Mar 28 11:33:20 GMT 2024

Powered by FUDForum. Page generated in 0.03327 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top