Results 1 to 2 of 2
- 08-03-2010, 12:51 PM #1
Member
- Join Date
- Aug 2010
- Posts
- 1
- Rep Power
- 0
pack200 .gz file unpack and create .jar file in browser(speed test).
I have to test the speed after loading the .gz file in browser and I am having java applet based web application(Hello word) whose HelloWorld.jar file size is 743byets and using pack200 tool compressed to .gz(321 bytes)files.
1) created HelloWorld.java file
Java Code:import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello word!", 50, 25); } }
Created HelloWorld123.jar file with this class
2)Main html file hello.html
XML Code:<HTML> <head> <meta HTTP-EQUIV="Pragma" CONTENT="no-cache"> <meta HTTP-EQUIV="Expires" CONTENT="-1"> <meta HTTP-EQUIV="accept-encoding" CONTENT="gzip,deflate"> <meta http-equiv="content-type" content="text/html"> </head> <BODY> Here is the output of my program: <APPLET CODE = "HelloWorld.class" ARCHIVE = "HelloWorld123.jar" WIDTH = "200" HEIGHT = "50"> <param name="java_arguments" value="-Djnlp.packEnabled=true"/> </APPLET> </BODY> </HTML>
3)First time tried to load the class file from the jar file it works fine(HelloWorld.class is loading in the browser).
XML Code:<APPLET CODE = "HelloWorld.class" ARCHIVE = "HelloWorld123.jar" WIDTH = "200" HEIGHT = "50">
4) created different .gz file with same jar file(pack200 tool).
HelloWorld123.gz
pack200 --gzip -E9 HelloWorld123.gz HelloWorld123.jar
HelloWorld123.jar.pack
pack200 --no-gzip -E9 HelloWorld123.jar.pack HelloWorld123.jar
HelloWorld123.jar.pack.gz
pack200 --gzip -E9 HelloWorld123.jar.pack.gz HelloWorld123.jar
and tried these files with the above html code
XML Code:<APPLET CODE = "HelloWorld.class" ARCHIVE = "HelloWorld123.gz" WIDTH = "200" HEIGHT = "50" >
or
XML Code:<APPLET CODE = "HelloWorld.class" ARCHIVE = "HelloWorld123.jar.pack" WIDTH = "200" HEIGHT = "50" >
or
XML Code:<APPLET CODE = "HelloWorld.class" ARCHIVE = "HHelloWorld123.jar.pack.gz" WIDTH = "200" HEIGHT = "50" >
while loading this class I found that class loader error on sun console(as follows).
Java Code:liveconnect: Invoking JS method: document liveconnect: Invoking JS method: URL basic: Referencing classloader: sun.plugin.ClassLoaderInfo@23d275, refcount=1 basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@e85825 basic: Loading applet ... basic: Initializing applet ... basic: Starting applet ... basic: completed perf rollup network: Connecting [url]http://localhost:7020/designer/details/HelloWorld123.pack.gz[/url] with proxy=DIRECT network: Connecting socket://localhost:7020 with proxy=DIRECT network: Connecting [url]http://localhost:7020/designer/details/HelloWorld123.pack.gz[/url] with cookie "JSESSIONID=gGsmMJmbGmZhtyKTn1v2FWvcRkFhN18Dpm81R2RLM6LYvYfFLf25!-726539454" network: Downloading resource: [url]http://localhost:7020/designer/details/HelloWorld123.pack.gz[/url] Content-Length: 314 Content-Encoding: null load: class HelloWorld.class not found. java.lang.ClassNotFoundException: HelloWorld.class at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) basic: Exception: java.lang.ClassNotFoundException: HelloWorld.class Ignored exception: java.lang.ClassNotFoundException: HelloWorld.class
In the About detail I can get that HelloWorld123.pack.gz or HelloWorld123.jar.gz or HelloWorld123.jar.pack.gz is downloading.
My question is will browser decompress the .gz file to .jar file internally ? or I am missing some coding for .gz file decompression ?.Last edited by maheshsardar; 08-03-2010 at 12:53 PM.
- 08-04-2010, 03:24 PM #2
Similar Threads
-
Need to create the archieved file for all generated log file using log4j
By ashu_knw in forum New To JavaReplies: 1Last Post: 03-31-2010, 08:04 PM -
how to create New file with specified file extension ?
By doha786 in forum New To JavaReplies: 2Last Post: 03-22-2010, 08:55 AM -
Why do you only compile the Test file?
By Java Riser in forum New To JavaReplies: 8Last Post: 02-23-2010, 02:20 AM -
How to create .exe file using .class file
By pradnya in forum New To JavaReplies: 8Last Post: 04-18-2009, 12:50 AM -
Test internet speed
By kalpo in forum NetworkingReplies: 0Last Post: 03-31-2009, 12:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks