I have a java program that seems to work okay when I'm debugging it or running it from the Eclipse IDE. But when I export it into a jar file and run it through a jnlp it hangs at a certain step.
I'm not exactly sure but I think the problem might be a step when I'm converting a file into a text file.
I'm not specifying any specific location to get or put the file convertedFile.txt in. Its just a variable that will take the converted information and then pass on in a later step and not be used anymore. Is there a possible problem with this or is the hanging likely due to something else?
PS the jar runs from the Local Settings/Temp Folder in windows. Someone else made it that way.
It 'crashes' as shown below...I put in text statements to pinpoint the position. Can't dig deeper without a lot of extra trouble because doing so would be going into a jar library file.
INPUT is a file chosen by the user using a file browser.
Code:
selectedFile = jfileChooser.getSelectedFile();
final FileConversion task = new FileConversion(selectedFile, txtArea);
//Conversion Function
FileConversion(File INPUT, JTextArea innerTextArea) {
//initialize
this.INPUT = INPUT;
this.innerTextArea = innerTextArea;
}
@Override
public File doInBackground() {
File convertedFile = new File("convertedFile.txt");
int convertstepcounter=0, convertstepcounter2=0;
publish( 1 );
IoUtil.assertFileIsReadable(INPUT);//crashes here
publish( 2 );
final SAMFileReader reader = new SAMFileReader(INPUT);//or here if above line is disabled.
publish ( 3 );
It could be throwing an exception that you're not aware of. You could try putting throw new Exception("see if I can see this"); after publish( 1 ). If you don't see that exception then the problem is that you're not setup so that you can see exceptions when thrown from that piece of code.
Bookmarks