views:

75

answers:

2

Hello all! :)

i need this applet located herelink text (the same in a popup is here: hxxp://tcip.mste.illinois.edu/applet_popup.php?num=2)

(please replace "hxxp" with "http" for accessing above link)

i have downloaded (actually mirrored the whole site :D ) all the jars & the js files.

one of the js (tcip.js) describes which applet will be called & from which class located in a particular jar file.

So, how can i execute/run it offline? is it like that i have to include all the jar files in a netbeans project & then run it ?

As i am a beginner in java & i need this applet badly for a Power Grid presentation in my college

I will really appreciate if anybody could help me out with this.

one of the lines which i was able to get in page's source was this:

edu.uiuc.TCIP.education.summer06.lessons.lesson4.Lesson4Applet

what does this mean..? is it like all the 5-6 jar files which i have download are run simultaneously.. and then one of the jar file named "lessons" or "lessons_old_naming" is having this structure

edu.uiuc.TCIP.education.summer06.lessons.lesson4.Lesson4Applet

as in this is the package structure..? and Lesson4Applet is what i want to get executed..?

How can i get it for offline viewing/execution..?

would appreciate it..if anyone from you could get it working for me..for offline (locally executed jar) viewing.

Thanks & Regards echo9

console output/error-details:

Java Plug-in 1.6.0_22
Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
User home directory = C:\Users\~Ultimate~
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
load: class edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet not found.
java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\USB_240910\ht\nw22\nw22\tcip.mste.illinois.edu\edu\uiuc\TCIP\education\summer06\lessons\lesson2\Lesson2Applet.class (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 9 more
Exception: java.lang.ClassNotFoundException: edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet
A: 

Save the result of the php page as html page and open it in any browser. It the applet does not need a server connection then it will work.

Horcrux7
its not working :( (was the first thing i did :P )
echo9
+1  A: 

Delving into the JS that launches that applet suggests the relevant applet element is:

<APPLET name='myApplet' WIDTH = 800 HEIGHT = 600 
        CODE='edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet' 
        ARCHIVE='jfreechart-1.0.10.jar , jcommon-1.0.13.jar , jama-1.0.2.jar, lessons_old_naming.jar , psdataobjects.jar, psdisplayobjects.jar, anl_lpsolver.jar , zebLP.jar'>
</APPLET>

If you create an HTML with that applet element and a codebase of http://tcip.mste.illinois.edu/, it should work. Mind you, once the applet loaded in my FF, I got simply a 'black screen' (shrugs).

BTW - do you have permission from the makers of the applet and the site to use their applet?


BTW - I have tested this applet element and seen it work locally!


Later: Now I look at your question more carefully, I realize that I never really answered it correctly, because I missed the 'offline' specifics. My bad!

By adding the codebase attribute, I was 'cheating' by allowing the JRE to reach back to the originating site for all the resources. AFAIU those resources are:

  1. The Jars mentioned in the archive attribute.
  2. The images used by the applet.

This is going to be a little more tricky.

Let us assume you want the HTML to be (poorly) named OFFLINE_applet.html, and you want everything located into the powergrid directory. In that case, the structure would be..

  • powergrid
    • OFFLINE_applet.html
    • jfreechart-1.0.10.jar
    • jcommon-1.0.13.jar
    • jama-1.0.2.jar
    • lessons_old_naming.jar
    • psdataobjects.jar
    • psdisplayobjects.jar
    • anl_lpsolver.jar
    • zebLP.jar
    • applet_images

Actually, not every image in applet_images is required. This applet only uses about 20 of them AFAIR, but download all of them it and should work.

Of course, remove the 'codebase' attribute, or the JRE will still be trying to reach back to the http://tcip.mste.illinois.edu/ site for the resources!

Test it and get back to me.

Andrew Thompson
btw: whats a "codebase" ? As you mentioned here: "If you create an HTML with that applet element and a codebase of http://tcip.mste.illinois.edu/.."
echo9
oh yea even i tried the same and its not working. Getting the same blank screen. PS: yes :) i have the permission from the authors of the site in fact i got a email from "Zeb Tate" someone from the TCIP Education, University of Illinois. But he too isn't of much help. He told me to save the corresponding web page and save the images in the /images folder :D to my knowledge i don't think those (/images) are needed :) I checked out the jar file (lesson) and it contains the images i saw on the applet.
echo9
codebase is an applet attribute, like code or archive.
Andrew Thompson
oh..k that means that this line: CODE='edu.uiuc.TCIP.education.summer06.lessons.lesson2.Lesson2Applet' is the codebase for the applet which i want to run locally? So..any further suggestions..? On how can I run this thingy? :)
echo9
No, 'code' is the 'code' attribute. 'codebase' is the 'codebase' attribute. For more info. on the attributes see http://www.w3.org/TR/REC-html40/struct/objects.html#edef-APPLET. See edited post above for the COMPLETE applet element that has been seen to work here.
Andrew Thompson
ok..i tried the code given by you above by saving it in a test.html file i the same directory as all the jar files required are present..now all I can see is the java progress circle (progress bar?) going round n round. Ahh..well have you tested the same code on your machine..? is it really working with the code above??
echo9
HEY :) :) it works now! cool simply awesome!! but i got a few questions. Now in the code above the attribute "codebase" now does this thing will make the page (the html in which this code is pasted) look for this (mentioned in codebase) website..? . That means that if I am running this html page on a machine having no internet connectivity then..it won't work..? will it?
echo9
FINALLY: BRAVO! :) you know what Andrew..? You saved my ass off the table :D hah thanks I really appreciate your dedicated and focused help. n Yeah..its a bit poorly named .html file neva'mind ;) Thanks man~
echo9