This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 189567 - "attempt to add a Permission to a readonly Permissions object" inside jnlplauncher.Main.main
Summary: "attempt to add a Permission to a readonly Permissions object" inside jnlplau...
Status: RESOLVED WORKSFORME
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 20:51 UTC by simpatico
Modified: 2010-10-19 17:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
unsigned content warning (26.75 KB, image/png)
2010-08-16 20:51 UTC, simpatico
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simpatico 2010-08-16 20:51:00 UTC
Created attachment 101428 [details]
unsigned content warning

<!-- The following property is needed when running with unsigned jars: -->
    <property name="netbeans.jnlp.fixPolicy" value="true"/>



java.lang.SecurityException: attempt to add a Permission to a readonly Permissions object
	at java.security.Permissions.add(Permissions.java:110)
	at com.sun.deploy.security.CeilingPolicy.addTrustedPermissions(CeilingPolicy.java:64)
	at com.sun.javaws.security.AppPolicy.addPermissions(AppPolicy.java:134)
	at com.sun.jnlp.JNLPClassLoader.getTrustedCodeSources(JNLPClassLoader.java:689)
	at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(CPCallbackHandler.java:176)
	at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(CPCallbackHandler.java:139)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(DeployURLClassPath.java:744)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$700(DeployURLClassPath.java:625)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(DeployURLClassPath.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(DeployURLClassPath.java:684)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(DeployURLClassPath.java:668)
	at com.sun.deploy.security.DeployURLClassPath$3.run(DeployURLClassPath.java:400)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:389)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:366)
	at com.sun.deploy.security.DeployURLClassPath.getResource(DeployURLClassPath.java:230)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:332)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at org.netbeans.modules.apisupport.jnlplauncher.Main.main(Main.java:62)
	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:597)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1812)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
	at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1532)
	at com.sun.javaws.Launcher.run(Launcher.java:135)
	at java.lang.Thread.run(Thread.java:637)


Steps to reproduce: 
1. create a dummy nb platform application (through ide).
2. Set the signature parameters in the pom and build it with deployment (jws) config.
3. Execute the master.jnlp

Setting the property to false will go through but then will give a warning that unsigned code exists.
Comment 1 Jesse Glick 2010-09-21 21:08:00 UTC
Reproducible on Linux. Not sure what causes it yet.
Comment 2 Jesse Glick 2010-10-15 20:30:41 UTC
Needs to be investigated.
Comment 3 Jesse Glick 2010-10-19 17:20:57 UTC
I just fixed http://jira.codehaus.org/browse/MNBMODULE-103 saying that this property should be false. (Setting it to true is a hack and might not even work with modern versions of javaws.)

And it works for me just as well when using a custom signature; all the JARs are signed.

If you have any further problems with current versions of the plugin, please file under MNBMODULE rather than here.