Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      I get the following NPE:

      java.lang.NullPointerException
      at org.apache.ftpserver.FtpStatisticsImpl.setLogin(FtpStatisticsImpl.java:265)
      at org.apache.ftpserver.command.PASS.execute(PASS.java:153)
      at org.apache.ftpserver.RequestHandler.service(RequestHandler.java:277)
      at org.apache.ftpserver.RequestHandler.run(RequestHandler.java:242)
      at java.lang.Thread.run(Thread.java:613)

      by running code similar to the following:

      /**

      • Load our configuration.
        */
        new File(FTP_WORK).mkdirs();
        appContext = new ClassPathXmlApplicationContext("/embeddedRemoteFon.xml");

      /**

      • Start the FTP server.
        */
        FtpServer ftpServer = (FtpServer) appContext.getBean("ftpServer");
        ftpServer.start();

      /**

      • Create a mock user.
        */
        BaseUser user = new BaseUser();
        user.setName(MOCK_USERNAME);
        user.setPassword(MOCK_PASSWORD);
        user.setEnabled(true);
        String testuserFtpDirPath = MOCK_USER_HOMEDIR;
        File testuserFtpDir = new File(testuserFtpDirPath);
        testuserFtpDir.mkdirs();
        user.setHomeDirectory(testuserFtpDirPath);
        user.setWritePermission(true);
        ftpServer.getFtpConfig().getUserManager().save(user);

      // Try logging in using commons-net.
      FTPClient ftp = new FTPClient();
      String host = "localhost";
      String username = MOCK_USERNAME;
      String password = MOCK_PASSWORD;
      ftp.connect(host, FTPSERVER_PORT);
      if (!ftp.login(username, password))
      fail("Login failed.");

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Niklas Gustavsson
            Reporter:
            Noah Vihinen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development