Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-286

Unhandled SecurityException in DefaultFTPFileEntryParserFactory.createFileEntryParser when using applets

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 3.0
    • FTP
    • None

    Description

      When using a commons.net.ftp in a (signed) applet, we encountered an unhandles SecurityException in DefaultFTPFileEntryParserFactory.createFileEntryParser in some cases.
      If the applet was being hosted on my Windows Vista devmachine, connecting to FTP servers was no issue.
      However, as soon as we uploaded the applet to our webserver (CentOS), things stopped working. After some debugging, we found that there was a SecurityException being thrown by the following code in DefaultFTPFileEntryParserFactory.createFileEntryParser:
      parserClass = Class.forName(key);
      parser = (FTPFileEntryParser) parserClass.newInstance();
      The toString() of the exception gave:
      java.lang.SecurityException: class "UNIX Type: L8"'s signer information does not match signer information of other classes in the same package
      (Note: When using a different FTP server, the string was obviously different.)
      The exception got caught by the generic catchblock at the bottom that doesn't really do anything.
      We managed to solve this by taking the code inside the catching of ClassNotFoundException and use that to catch the SecurityException.

      I hope this is somewhat helpfull.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jorygeerts Jory Geerts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: