Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: Applet Not Writing to FTP

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Applet Not Writing to FTP

    I've been beating my head against this wall for 8-10 hours, today. Please help if you can!

    I have a java applet which uses an Apache FTPClient to download some information from a file, then use that information to write a file onto that same FTP server. These are all located in the same directory as the applet itself. When I run this applet in my Eclipse Applet Viewer, it works perfectly, writing the information to the FTP. When I load it from the browser, however, it hangs at that point and never writes. I've signed the only .jar file, and nothing seems to be working. Is there anything else I might be missing?


  2. #2
    Forum VIP
    Join Date
    Jun 2011
    Posts
    339
    My Mood
    Busy
    Thanks
    48
    Thanked 104 Times in 87 Posts
    Blog Entries
    5

    Default Re: Applet Not Writing to FTP

    No error messages? Are you using chrome? If so you can use the debugger to check out the stack trace. If I were a betting man I would put my money on a SecurityException since applets aren't allowed to read/write to a physical drive (hackers would have a field day if they could).

    If would also be worth while logging you program so you can see exactly where it has failed.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    20,974
    Thanks
    51
    Thanked 2,269 Times in 2,241 Posts

    Default Re: Applet Not Writing to FTP

    Cross posted at Writing to File on FTP

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,330
    Thanks
    181
    Thanked 829 Times in 772 Posts
    Blog Entries
    5

  5. #5
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applet Not Writing to FTP

    Regarding "What Applets Can and Cannot Do...," I've read over that stuff, and the impression that I had was that if I signed my applet, it wouldn't have the same restrictions once the user accepted it, right?

  6. #6
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applet Not Writing to FTP

    Ok - Java console is telling me it cannot locate the Apache class that I'd installed -

    AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient


    Why might this be happening? I compile fine and include all compiled classes in my jar...
    Last edited by jtd200; January 13th, 2012 at 10:46 AM.

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    20,974
    Thanks
    51
    Thanked 2,269 Times in 2,241 Posts

    Default Re: Applet Not Writing to FTP

    What are you doing that could be restricted?
    I don't know if sending a request to the server that the applet is loaded from is a problem.
    Doing file I/O on a local PC is a problem.

    You forgot to say if there are error messages in the browser's java console.
    Be sure to look. Copy and paste the full text of the messages here.
    Last edited by Norm; January 13th, 2012 at 10:48 AM.

  8. #8
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applet Not Writing to FTP

    IT WORKS! Sorry for wasting everyone's time - as soon as I checked the log, I realized it wasn't finding the apache library because I had to include that jar on the server... Thanks for helping everyone! (And sorry for the cross posts...)

    By the way - this site was great with the reply times. Bookmarked!

  9. #9
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,330
    Thanks
    181
    Thanked 829 Times in 772 Posts
    Blog Entries
    5

    Default Re: Applet Not Writing to FTP

    Quote Originally Posted by jtd200 View Post
    By the way - this site was great with the reply times. Bookmarked!
    For future reference however, please read the forum rules, and please read the following: The problems with cross-posting

  10. #10
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applet Not Writing to FTP

    Ok - read the post about cross-posting, and it does make sense. All apologies, and thanks for the help.

Similar Threads

  1. Writing to DTD Document
    By DanG1775 in forum Java SE APIs
    Replies: 4
    Last Post: December 12th, 2011, 03:41 PM
  2. Replies: 0
    Last Post: October 13th, 2011, 07:42 PM
  3. writing to an output...
    By lairel in forum Object Oriented Programming
    Replies: 4
    Last Post: March 1st, 2011, 03:27 AM
  4. writing to JEditorPane
    By nasi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 8th, 2010, 09:23 PM
  5. I need help writing this program
    By kev2000 in forum Algorithms & Recursion
    Replies: 5
    Last Post: June 4th, 2009, 03:14 AM