Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


IDE=runs Jar File=hangs


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 01 December 2012 - 10:18 PM

A program runs fine through the Eclipse IDE but hangs when run through a Jar and JNLP. The Jar has been signed and I've run similar jars through the same process. The problem occurs as shown below using txt msgs to track. INPUT is a file chosen by the user with a file browser. The functions that take INPUT are in jar libraries so I can't get any deeper without massively rearranging the 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);//hangs here
publish( 2 );
	final SAMFileReader reader = new SAMFileReader(INPUT);//or here if above line is disabled.
publish ( 3 );


Sponsor:

#2 Bubsy   Members   -  Reputation: 407

Like
0Likes
Like

Posted 02 December 2012 - 12:00 PM

Do you have provided the required permissions on the JNLP descriptor ? Seems like a sandbox permission problem to me. Try running with <all-permissions/> first to pinpoint if it's indeed a security problem.

#3 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 02 December 2012 - 10:08 PM

Do you have provided the required permissions on the JNLP descriptor ? Seems like a sandbox permission problem to me. Try running with <all-permissions/> first to pinpoint if it's indeed a security problem.


All permissions is already set in the jnlp

#4 Bubsy   Members   -  Reputation: 407

Like
0Likes
Like

Posted 03 December 2012 - 09:23 AM

Try to put a try catch block(catching Throwable) encapsulating the method call, this block should call ex.printStackTrace(), sometimes a RuntimeError can lurk and unwind the entire stack.

P.S. Does anything get printed on the Webstart console ?

#5 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 03 December 2012 - 06:54 PM

Try to put a try catch block(catching Throwable) encapsulating the method call, this block should call ex.printStackTrace(), sometimes a RuntimeError can lurk and unwind the entire stack.

P.S. Does anything get printed on the Webstart console ?


Thanks for your help so far I tried



    try{
        publish( 1 );
        IoUtil.assertFileIsReadable(INPUT);
        publish( 2 );
    }
    catch(Throwable ex)
    {
          ex.printStackTrace();
    }

in the code posted and I get the same as before...the '1' prints out and then nothing happens. meanwhile its happily chugging on the IDE with the exact same code. I don't know exactly what you mean by the webstart console. After the prompts its just the program thats running.

#6 Bubsy   Members   -  Reputation: 407

Like
1Likes
Like

Posted 03 December 2012 - 07:18 PM

Hmmm to turn the console on type on the prompt javaws -viewer, on the last tab there's a node which is called java console. Turn it on and see if something pop on it.

You can also try turning the debugger on the webstart application by using the Java's remote debugging facility. I never had to used it, but I know it is feasible.

#7 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 04 December 2012 - 05:00 PM

Hmmm to turn the console on type on the prompt javaws -viewer, on the last tab there's a node which is called java console. Turn it on and see if something pop on it.

You can also try turning the debugger on the webstart application by using the Java's remote debugging facility. I never had to used it, but I know it is feasible.


Aite, looks like we have a something here finally...

java.lang.NoClassDefFoundError: net/sf/picard/io/IoUtil

at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: net.sf.picard.io.IoUtil
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

I have the relevant jars packed into my jar file I open the net/sf/picard/io/ directory in the jar and I see the classes they're whining about so I don't know why they can't be detected.

Edited by Jarwulf, 04 December 2012 - 05:01 PM.


#8 Bubsy   Members   -  Reputation: 407

Like
0Likes
Like

Posted 05 December 2012 - 08:06 AM

It's all packed in one jar ?

#9 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 05 December 2012 - 12:00 PM

It's all packed in one jar ?


Yeah, the supposedly missing classes run fine from the same jar in the IDE so I dunno why it can't detect them anymore once the files are exported in one big jar. Maybe its the manifest file? But I can't tell from the documentation what I'm doing wrong since it autogenerates during the jar export.

Edited by Jarwulf, 05 December 2012 - 12:24 PM.


#10 Jarwulf   Members   -  Reputation: 222

Like
0Likes
Like

Posted 05 December 2012 - 06:20 PM

I've decided it would be easier to simply reference the jars from the jnlp file. It seems to work alright...thanks for your help.

#11 Bubsy   Members   -  Reputation: 407

Like
0Likes
Like

Posted 06 December 2012 - 06:30 AM

No problem man, glad to help. Referencing multiples jars on the JNLP is easier and it's best at production level, because the JavaWS will only download jars which have been changed (ok, you could use the jardiff protocol, but it's TCO is higher, as you'd need a servlet container and it's harder to setup).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS