• 0

[Java] JNLP execution errors


Question

Hi, I'm trying to make a JNLP file for an assignment, but I'm having a lot of trouble, I get a whole bunch of errors when I try to launch the file. It says, in Swedish, that the program cannot be started, and when I click on the second tab in the information window I see the following exception errors:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: T1
	at MultiThreadingJNLP.main(MultiThreadingJNLP.java:27)
	... 9 more
Caused by: java.lang.ClassNotFoundException: T1
	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)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 10 more

The JNLP file itself looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
codebase="file:///C:\Users\{User}\Desktop\Java\2.2">
	<information>
		<title>MultiThreading JNLP Test</title>
		<vendor>Goran Maksimovic</vendor>
		<homepage href="http://people.dsv.su.se/~gora-mak/ip/ip1/" />
		<description>Demonstration of JNLP</description>
	</information>
	<resources>
		  <j2se version="1.6+" />
		<jar href="MultiThreadingJNLP.jar" />
	</resources>
	<application-desc main-class="MultiThreadingJNLP" />
</jnlp>

Some help with this problem would be highly appreciated.

P.s. A side-note: One weird thing about this error is that the JFrame launches I can see it up in the left corner but not the the text that's suppose to be generated inside it.

Thanks in advance,

Raz

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Caused by: java.lang.ClassNotFoundException: T1

there is your problem, the class T1 could not be found on the classpath

you need to add the directory where T1 is to your classpath

ie

java -cp C:\<This_is_the_path_to_T1.class> MultiThreadingJNLP

Link to comment
Share on other sites

  • 0

But it links to a Jar file that contains all 3 classes from the code. There's also a T2.

---- Edit-----

Wow, well I just recompiled the Jar file, same way I did the last time and now suddenly it works o_O... Weird. But thanks for your help, wouldn't have felt the need to recompile had you not mentioned that so thanks a lot :)

Edited by Razorblade
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.