1 Reply Latest reply: May 27, 2010 5:20 PM by 843810 RSS

    How to get Java source in applet stack trace to debug Java security manager

    843810
      How can I get line numbers for Java source in stack traces for my applet? I'm having a problem with my code-signing certificate. On one of my applets, I consistently get a NullPointerException inside the security dialog code in the JDK. As a result, either the "trust this applet" dialog never appears, or even though it appears, it defaults to untrusted because of the exception, so I can't access any local files (and that's a bit of a problem for an applet whose sole purpose is to upload files to our server). I unzipped src.zip in my JDK directory and set the debug flag for my Ant <javac> task as well as set debuglevel to "lines." Anything else? Here's the trace that I'm getting so far. See that after the NullPointerException it assumes that the user has denied permission. If I could read this Java source maybe I could figure out why it hates my code-signing certificate (jarsigner, BTW, never complains when I verify my jar).

      security: Blacklist file not found or revocation check is disabled
      security: Accessing keys and certificate in Mozilla user profile: null
      security: Loading Root CA certificates from D:\Program Files (x86)\Java\jre6\lib\security\cacerts
      security: Loaded Root CA certificates from D:\Program Files (x86)\Java\jre6\lib\security\cacerts
      security: Loading Deployment certificates from C:\Users\Rich\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs
      security: Loaded Deployment certificates from C:\Users\Rich\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs
      security: Loading certificates from Deployment session certificate store
      security: Loaded certificates from Deployment session certificate store
      security: Validate the certificate chain using CertPath API
      security: Obtain certificate collection in Root CA certificate store
      security: Obtain certificate collection in Root CA certificate store
      security: Start to check whether root CA is replaced
      security: The root CA has been replaced
      security: No timestamping info available
      security: Found jurisdiction list file
      security: Start checking trusted extension for this certificate
      security: Start comparing to jurisdiction list with this certificate
      security: The CRL support is disabled
      security: The OCSP support is disabled
      security: This OCSP End Entity validation is disabled
      security: Checking if certificate is in Deployment denied certificate store
      security: Checking if certificate is in Deployment permanent certificate store
      security: Checking if certificate is in Deployment session certificate store
      java.lang.NullPointerException
           at com.sun.deploy.ui.UIFactory.showSecurityDialog(Unknown Source)
           at com.sun.deploy.security.TrustDeciderDialog.showDialog(Unknown Source)
           at com.sun.deploy.security.X509Util.showSecurityDialog(Unknown Source)
           at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
           at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
           at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$700(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
           at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at com.sun.deploy.security.DeployURLClassPath.getLoader(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 java.security.AccessController.doPrivileged(Native Method)
           at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
           at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
           at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      security: User has denied the priviledges to the code
      security: Adding certificate in Deployment denied certificate store
      security: Added certificate in Deployment denied certificate store
      security: Loading certificates from Deployment session certificate store
      security: Loaded certificates from Deployment session certificate store
      security: Validate the certificate chain using CertPath API
      security: Obtain certificate collection in Root CA certificate store
      security: Obtain certificate collection in Root CA certificate store
      security: Start to check whether root CA is replaced
      security: The root CA has been replaced
      security: No timestamping info available
      security: Found jurisdiction list file
      security: Start checking trusted extension for this certificate
      security: Start comparing to jurisdiction list with this certificate
      security: The CRL support is disabled
      security: The OCSP support is disabled
      security: This OCSP End Entity validation is disabled
      security: Checking if certificate is in Deployment denied certificate store
      security: Checking if certificate is in Deployment denied certificate store