2

I have written an applet that should compare files. It calculates a CRC32 checksum and then outputs files with the same checksum.

It runs great from appletviewer and as standalone app. So I have packed and signed it. However, when I am launching it in the browser, it does not work.

It launches good. The browser asks about permissions for this signature. It shows JFileChooser dialog, and I can select a target folder.

The problem is that it returns nothing. When it comes to file iteration or checksum calculations, it seems to crush quietly. (I have used apache.commons FileUtils for file iteration & checksum calculations)

It can open a .txt file and read its content. I have tested it in different browsers, different security settings, even on Linux.

I have tried to rewrite my code using "AccessController.doPrivileged" as this:

    @Override
public ArrayList<String> doInBackground() {

    return AccessController.doPrivileged(new PrivilegedAction<ArrayList<String>>() {
        public ArrayList<String> run() {...});

...and it still does nothing. What`s its problem?

Thanks in advance.

Roman C
  • 49,761
  • 33
  • 66
  • 176
MrAs
  • 77
  • 8
  • Do you get an exception? – Emmanuel Bourg Oct 31 '11 at 18:18
  • Try setting java console to show up every time the applet runs. There you can read (and copy here) the errors that keeps your applet from working properly. http://www.java.com/en/download/help/javaconsole.xml – Alfabravo Oct 31 '11 at 18:33
  • Nope, no exception. On "Trace level 5" console shows a lot of entries when the applet starts, but all of them seems to be normal. The odd one is shown when I am pressing run button for the first time: network: Cache entry not found [url: file:/C:/Users/pavlo/Desktop/Applet/, version: null] – MrAs Nov 01 '11 at 09:48

1 Answers1

0

The problem was that apache.commons and Guava libraries was not working correctly in applet. After rewriting this code by hands its finaly working.

MrAs
  • 77
  • 8