1

I am trying to run an applet in html, but keep getting this NullPointerException.

Below is the stacktrace,

CacheEntry[file:/C:/Users/User/workspace/SearchAlgorithms/bin/Main.jar]: updateAvailable=false,lastModified=Fri Apr 24 15:09:46 IST 2015,length=10095
Missing Permissions manifest attribute in main jar: file:/C:/Users/User/workspace/SearchAlgorithms/bin/Main.jar
java.io.FileNotFoundException: dataProduct.csv (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at Main.init(Main.java:39)
    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: dataLocation.csv (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at Main.init(Main.java:45)
    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 Plug-in 10.79.2.15
Using JRE version 1.7.0_79-b15 Java HotSpot(TM) Client VM
User home directory = C:\Users\User

Things that I have tried:

  1. Signing the jar file
  2. Including the accesscontrol.dopriviledge,

     try {
         FileInputStream fis = AccessController.doPrivileged(
         new PrivilegedExceptionAction<FileInputStream>() {
             public FileInputStream run() throws FileNotFoundException {
                 return new FileInputStream("someFile");
             }
         });
     } catch (PrivilegedActionException e) {
         // e.getException() should be an instance of FileNotFoundException,
         // as only "checked" exceptions will be "wrapped" in a
         // PrivilegedActionException.
         throw (FileNotFoundException) e.getException();
     }
    

The applet runs perfectly on the applet viewer. But embedding in html, gives the NullPointerException.

Please Help.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • What `NullPointerException`??? You have shown us a `FileNotFoundException` stacktrace – Stephen C Apr 24 '15 at 10:23
  • Have you tried adding a permissions attribute to the manifest? – Stephen C Apr 24 '15 at 10:24
  • Hi Stephen, thank you for your comment. It says a nullpointexception on the popupwindow when running the html. Could you please guide me with the permissions attribute to the manifest. – Indraneel Dabhade Apr 24 '15 at 10:27
  • This should help: http://stackoverflow.com/questions/19659134/how-do-i-fix-missing-codebase-permissions-and-application-name-manifest-attri – Stephen C Apr 24 '15 at 10:41

0 Answers0