JDK-8081330 : The applet thrown NullPointerException when loading it
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 8u51,8u60,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2015-05-27
  • Updated: 2015-09-29
  • Resolved: 2015-06-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60 b21Fixed 9Fixed
Description
Testsuite: set3 in applet
Test name(s): gamesiwon_BattleTank
Product(s) tested: Jre8u51b13 64bit 
OS/architecture: Ubuntu15.04-x64
Reproducible: Always
Reproducible on machine: egtc

Is it a Regression: YES

Test result on the last GAed release for this train: 8u45 b34 dialog "Can not verify rule set jar."

[if Fail] Test result on FCS:

Is it a platform specific issue: No

Exception/Error from Log:http://scaaa008.us.oracle.com:9502/runs/00912/912170.ManualSubmit/912170.ManualSubmit-1/workDir/set3/gamesiwon_BattleTank.jtr

Copy applet workspace, install test jre, and run this case

Test Procedure: 
1. Go to Java Control Panel. Enable tracing, logging, Show applet lifecycle exceptions + Show console.
2. Browse http://games.iwon.com 
3. Login as user 'wwwegtccomcn' with password 'password' 
4. Click 'All games'. Enter 'Battle tank'. http://www.iwon.com/modules/launchGame/games/LaunchGame3.jhtml?gameId=22

The actual result:
We login in the applet using user 'wwwegtccomcn' and password 'password' ;The applet thrown java.security.AccessControlException and java.io.FileNotFoundException when loading it. Please refer to BattleTank.png.
Comments
Bug confirmed in 8u60 b17: java.lang.NullPointerException at com.sun.deploy.security.DeployURLClassPath$JarLoader.getMainAttributes(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.parseExtensionsDependencies(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getClassPath(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Ignored exception: java.lang.NullPointerException
01-07-2015

I will not fix it in deploy code. And I'm not sure you need yo add .java.policy to the tests. I suppose you can just ignore this exception for this particular test.
01-07-2015

OK, are you going to fix this problem or we need to add ".java.policy" to the tests?
01-07-2015

No it's not a duplicate of JDK-8075602. In the current issue, user tries to resolve host name from user's code, which results to java.security.AccessControlException for sanbox mode.
01-07-2015

As I understand this is duplicate of https://bugs.openjdk.java.net/browse/JDK-8075602 - it has already been fixed in 8u65 and we are waiting sync to 8u60? WORKAROUND Add "deployment.security.use.user.home.java.policy=true" to C:\Windows\Sun\Java\Deployment\deployment.properties and add ".java.policy" to USERPROFILE (user home): grant { permission java.net.SocketPermission "*:*", "accept, connect, listen, resolve"; }; Using this workaround I have only "java.io.FileNotFoundException: http://ak.imgfarm.com/images/iwon/games/gamehouse/22/sounds/silent.au" in trace.
01-07-2015

The first exception was thrown because the user tries to resolve host name using getByName(). SocketPermission("resolve") is not granted for the app running in sandbox mode. It should be run with all-permissions to perform the action.
01-07-2015

8u60 b21 - NPE fixed, but I confirm 2 exceptions: java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.iwon.com" "resolve") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source) at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getByName(Unknown Source) at com.sun.deploy.net.CrossDomainXML.addAccess(Unknown Source) at com.sun.deploy.net.CrossDomainXML.allowNoAccess(Unknown Source) at com.sun.deploy.net.CrossDomainXML.check(Unknown Source) at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source) at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getByName(Unknown Source) at inknet.InkUtil.?(inknet/InkUtil) at inknet.InkUtil.getGameCanvasType(inknet/InkUtil) at gamehouse.SuperApplet.init(gamehouse/SuperApplet) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) java.io.FileNotFoundException: http://ak.imgfarm.com/images/iwon/games/gamehouse/22/sounds/silent.au at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.access$200(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessController.doPrivilegedWithCombiner(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.URL.openStream(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.getResourceAsStream(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory$1.run(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory.createAudioClip(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$AppletContextImpl.getAudioClip(Unknown Source) at java.applet.Applet.getAudioClip(Unknown Source) at java.applet.Applet.getAudioClip(Unknown Source) at gamehouse.SuperApplet.?(gamehouse/SuperApplet) at gamehouse.SuperApplet.run(gamehouse/SuperApplet) at java.lang.Thread.run(Unknown Source) For http://ak.imgfarm.com/images/iwon/games/gamehouse/22/sounds/silent.au I have Error 404 in browser - so we can ignore this exception.
01-07-2015

I don't think the issue has a significant impact. At least it's not a blocker for CPU15_03. SQE OK to defer it to 8u60.
05-06-2015

After fixing the NPE, the applet can be launched, but there are 2 another exceptions: java.io.FileNotFoundException: http://ak.imgfarm.com/images/iwon/games/gamehouse/22/sounds/silent.au at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1835) at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:90) at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1432) at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1430) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1429) at java.net.URL.openStream(URL.java:1038) at sun.plugin2.applet.Applet2ClassLoader.getResourceAsStream(Applet2ClassLoader.java:323) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory$1.run(Applet2AudioClipFactory.java:99) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory$1.run(Applet2AudioClipFactory.java:39) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.uitoolkit.impl.awt.Applet2AudioClipFactory.createAudioClip(Applet2AudioClipFactory.java:37) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$AppletContextImpl.getAudioClip(AWTAppletAdapter.java:1022) at java.applet.Applet.getAudioClip(Applet.java:329) at java.applet.Applet.getAudioClip(Applet.java:349) at gamehouse.SuperApplet.��(gamehouse/SuperApplet) at gamehouse.SuperApplet.run(gamehouse/SuperApplet) at java.lang.Thread.run(Thread.java:745) - seems like it's caused by the fact that silent.au cannot be loaded using the provided url (404 Not found) and java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.iwon.com" "resolve") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1048) at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(SecurityManagerHelper.java:321) at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(AWTAppletSecurityManager.java:64) at java.net.InetAddress.getAllByName0(InetAddress.java:1247) at java.net.InetAddress.getAllByName(InetAddress.java:1171) at java.net.InetAddress.getAllByName(InetAddress.java:1105) at java.net.InetAddress.getByName(InetAddress.java:1055) at com.sun.deploy.net.CrossDomainXML.addAccess(CrossDomainXML.java:181) at com.sun.deploy.net.CrossDomainXML.allowNoAccess(CrossDomainXML.java:146) at com.sun.deploy.net.CrossDomainXML.check(CrossDomainXML.java:287) at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(SecurityManagerHelper.java:327) at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(AWTAppletSecurityManager.java:64) at java.net.InetAddress.getAllByName0(InetAddress.java:1247) at java.net.InetAddress.getAllByName(InetAddress.java:1171) at java.net.InetAddress.getAllByName(InetAddress.java:1105) at java.net.InetAddress.getByName(InetAddress.java:1055) at inknet.InkUtil.��(inknet/InkUtil) at inknet.InkUtil.getGameCanvasType(inknet/InkUtil) at gamehouse.SuperApplet.init(gamehouse/SuperApplet) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(AWTAppletAdapter.java:289) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1764) at java.lang.Thread.run(Thread.java:745) - looks like in this case it's not a deployment issue. The user code calls InetAddress.getByName(..) and it fails because the SocketPermission is not granted for the app running in sandbox mode. I suppose either the implementation in the user's code should be changed, or the applet should be launched in all-permissions mode. Note, for launching this applet, 2 sites should be added in ESL: http://www.iwon.com and http://ak.imgfarm.com and. If the second one is not added, there will be App Blocked dialog.
05-06-2015

1) You should remove DRS jar before testing it, as the current problem is not related to DRS. If currently we also have DRS issues, you have to post another issue for that 2) You should check it for latest CPU (not for 8u45) - 8u51 3) I don't understand how you concluded that it's a regression after DRS exception in 8u45?
03-06-2015

In 8u60 b17 I have java.lang.NullPointerException, but in 8u45 b34 dialog "Can not verify rule set jar." => P2 + "regression" keyword.
03-06-2015

8u45 b34: 1. Go to Java Control Panel. Add http://www.iwon.com to ESL. Enable tracing, logging, Show applet lifecycle exceptions + Show console. 2. Browse http://games.iwon.com 3. Login as user 'wwwegtccomcn' with password 'password' 4. Click 'All games'. Enter 'Battle tank'. http://www.iwon.com/modules/launchGame/games/LaunchGame3.jhtml?gameId=22 basic: exception: Can not verify rule set jar. com.sun.deploy.security.BlockedException: Can not verify rule set jar at com.sun.deploy.security.BlockedDialog.show(Unknown Source) at com.sun.deploy.security.SandboxSecurity.isPermissionGranted(Unknown Source) at com.sun.deploy.security.SandboxSecurity.isPermissionGranted(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Unknown Source) at java.security.SecureClassLoader.getProtectionDomain(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
03-06-2015

SQE will check if it's a regression in the CPU15_03
03-06-2015

I can reproduce the java.lang.NullPointerException. Is it regression?
01-06-2015

RULE set3/gamesiwon_BattleTank any any RULE set3/gamesiwon_KnockEmOut any any
27-05-2015