|
lolostar wrote: I need solution for this problem as soon as
some suggestions:
1. start sooner
2. don't throw away the information exceptions are offering
3. explain what the problem is (use case, symptoms, ...)
|
|
|
|
|
It's time to play Guess The Problem.
Is it:
A - my code doesn't compile
B - it throws an exception at runtime
C - nothing happens when I run it
D - it triggers global thermonuclear war and the start of a new ice age
Press the button on your handset now, and let's see what the studio audience thinks...
|
|
|
|
|
Sir! Sir! Pick me Sir!
Is it global thermonuclear war?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
the problem appear when the receiver receive file from the sender .
|
|
|
|
|
yes
|
|
|
|
|
But why is it still a secret?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
[mode=igor]
Shall I fire up the labotomy drill marther?
[/mode]
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I think the salient information is that the programs build and run, but an error occurs. Is this correct?
If yes, then WHAT IS THE EXCEPTION?
Going by your garbled post, you think the file image.gif exists, but it can't be loaded by the sender. Correct?
What folder is the file in? Where is sender.jar in relation to it?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
yes , the program is running but the error occur at the receiver side because the exception occurred when the receiver try to receive the transmitted file from the sender .
the image.gif found in the sender package and because the transmitted process complete successfully so I don't think the problem in the image file .
|
|
|
|
|
Here is a very basic suggestion which should help you. I would not recommend this in a real production application, but for your situation I think you may find it helpful.
Replace this section of code:
catch(IOException e)
{
System.out.println("error...");
}
with this:
catch (IOException e)
{
e.printStackTrace();
}
This will give you more information which will hopefully give you an idea of what is going wrong.
|
|
|
|
|
I may be wrong in the analysis of the problem but on the server code you are creating 2 handles of files simultaneously without closing one. Wont this be a problem.
|
|
|
|
|
Well, I'm working on an application that works as a server for a Ship Management System. And my boss had an idea to limit client number based on license. After brief discussion we agreed to with a licensing system where we distribute a license file that must be put in app dir that contain a definition regarding how many clients are allowed.
Now regarding that file, I'm thinking of creating a class that contains the info then serialize it. and distribute that file to client and read the file from my application. My questions are, what encryption should I use? Are there any better solution?
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
use dongles. Dongles @ Wikipedia[^]
With dongles you can control who uses the Software and how much copies are used.
The dongle should be handled as a chip card, a USB-Dongle opens a gate to get viruses and all kinds of other stuff onto the ship.
Also think of obfuscation -> encryption of the code.
regards Torsten
I never finish anyth...
|
|
|
|
|
Thanks for the info on Dongle, it's a nice read (though I highly doubt my boss would agree with this one).
TorstenH. wrote: Also think of obfuscation -> encryption of the code.
Sup, will do.
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
Create a hash of the relevant license data, encrypt it on your computer with your private key, and add that to the license file.
The application shipped to the customer contains the public key. The application reads the license file, creates the hash as you did on your local computer, decrypts the stored encrypted hash value and compares it with its computed hash value. If it's ok, the license file is ok, otherwise the application would refuse to run.
I.e. you use an encryption method with a public and a private key.
|
|
|
|
|
Ah, Thanks for the heads up.
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
I want to print restaurant bill directly to printer when user click button "Print Bill" without display content is printed. My project is JSP/Servlet web appplication.So, solution can write in java or javascript. Can you help me ? Thanks so much.
Sorry, I don't know post this question in which topic Java or Web development.
|
|
|
|
|
|
I'm writing copy to clipboard and paste from clipboard in jlist by myself .
I don't know why I can't use 'ctrl C' key to do it in jlist . With other key is ok (For example : 'ctrl M'... .
I know jlist support DnD .
AnyIdea ?
Thanks !!
|
|
|
|
|
|
Hello All,
I'm trying to validate two input text boxes and am running into a snag. I'm using a while loop that runs while either one of the inputs is 'false'. The problem is that it doesn't stop and allow for a user to correct the first input if its bad and goes on to check the next input.
I could do this before when I just checked one input at time and called the validate method twice. Trying to do both in one method is proving to be a pain. Any ideas?
Here's my validate method:
private boolean validateInput(String input1, String input2)
{
Boolean[] inputValidArray = {false , false};
String[] inputArray = {input1, input2};
JTextField[] textFieldArray = {jTextField1, jTextField2};
float numberToValidate = 0;
int counter = 0;
String errorMessage = "";
while (!inputValidArray[0] || !inputValidArray[1])
{
try
{
if (!(inputArray[counter].isEmpty() || inputArray[counter] == null))
{
numberToValidate = Float.valueOf(inputArray[counter]);
inputValidArray[counter] = true;
}
else
{
errorMessage = "This field can not be left blank!\n" +
" Please enter a valid number!\n" +
" (example: 123.45 or -123.45)";
Create_Error_Message_Dialog_Box(errorMessage);
textFieldArray[counter].requestFocusInWindow();
}
}
catch (NumberFormatException nfe)
{
errorMessage = inputArray[counter] + " is not a valid number!\n" +
"Please enter a valid number!\n" +
"(example: 123.45 or -123.45)";
Create_Error_Message_Dialog_Box(errorMessage);
textFieldArray[counter].requestFocusInWindow();
textFieldArray[counter].selectAll();
}
counter += 1;
}
return (inputValidArray[0] && inputValidArray[1]);
}
modified 6-Nov-11 7:08am.
|
|
|
|
|
Please edit this and put <pre> tags around the code.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Edited, sorry, didn't know that the <pre> was needed around the code. Thanks!
-- modified 4-Nov-11 13:15pm.
|
|
|
|
|
Well it still isn't set properly; take a look at the result of your edit.
It should be:
<pre lang="java">
// code here
</pre>
so it looks like
private boolean validateInput(String input1, String input2)
{
}
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Oh, I didn't have the code highlighted first and it showed up at the top of my code. So, I copied the </pre> and put it at the end of my code (but forgot to delete it from the top). Should be all set now for review!
|
|
|
|