Results 1 to 6 of 6
  1. #1
    Mysidia is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Problems in IDE and Jar file

    HI, i was wondering if anyone faced this problem before.

    Currently i am doing a project involving Secure FTP server and client.
    Basically my client is logging into the server will receive a String of challenge converted from byte array

    This is what part of the server program regarding the challenge looks like

    SecureRandom sr = new SecureRandom();
    byte[] challengeBytes = new byte[16];
    sr.nextBytes(challengeBytes);
    challenge = new String(challengeBytes);
    mwriter.write(challenge); //mwriter is a bufferedwriter

    This is what the client will do to read

    line = in.readLine(); //in is a bufferedReader
    String challenge = line;

    My problem is that, when i am using the IDE, hence in netbeans, i will be able to read all the challenge with no problem.

    But once i complie and use the Jar file, the client can no long read properly the String. Unless i change challengeByes to the following:
    byte[] challengeBytes = new byte[1];

    Errors will always occur when reading the data.

    Have any one met with this problem before and could offer me some insights to it?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Problems in IDE and Jar file

    You sure this happen when you work on with NetBeans?

    Did you end-up with an error when reading data in the alternative way you used?

  3. #3
    Mysidia is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Problems in IDE and Jar file

    yes. I am only using netbeans to develop my programs currently.

    both the client and server are developed on it.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: Problems in IDE and Jar file

    Did you compile or build the project with NetBeans? That means did you use the jar file inside dist folder? Sometime NetBeans does funny things. ;)

  5. #5
    Mysidia is offline Member
    Join Date
    Dec 2011
    Posts
    4
    Rep Power
    0

    Default Re: Problems in IDE and Jar file

    yup... compiled + build the project using Netbeans. and yes i do refer to the jar file in dist folder.
    unless i am opening the wrong file, which i do not think i am, i have no idea what is wrong lol.
    maybe i should go try and use another ide to compile see if the same thing happens

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. InputStream/Jar Problems/File IO Problems
    By rdjava in forum Advanced Java
    Replies: 31
    Last Post: 01-17-2011, 11:12 AM
  2. problems with txt file
    By blumdiggity in forum New To Java
    Replies: 1
    Last Post: 02-27-2010, 01:16 PM
  3. Jar file problems!
    By viper81 in forum Eclipse
    Replies: 3
    Last Post: 12-31-2008, 10:50 AM
  4. Problems with file dir
    By willemjav in forum Java Applets
    Replies: 0
    Last Post: 02-07-2008, 12:08 AM
  5. problems with the name of file
    By bbq in forum Java Servlet
    Replies: 0
    Last Post: 06-28-2007, 04:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •