kartheepanmirra 0 Newbie Poster

Hi i am working swing based applet application which is deployed on a jboss3.2.6 webserver.the jar file application.jar size is 140kb.i compressed the jar file using sun java pack200 technology as application.pack200.gz file.now the jar file size is 46kb.the jar is deployed on application.war file with context-path /application on the jboss deploy path.the war file that contains the jar file also has a servlet(pack200 servlet provided in the sunjava website) to service the .jar requests to give the compressed application.pack200.gz file to the

response.outputstream()

for any incoming requests for any jar file.
When i make a request on the webbrowser as http://localhost:8080/application/application.jar the pack200 service servlet inside the application.war services the request to yield a compressed application.jar(46kb).

Now the problem arises when im calling application.jar from an html page(index.html)using THE FOLLOWING CODE

<html>
<html>
    <title>
Applet APPLICATION
  </title>
  
  <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>
<Applet code='application.main.class' codebase='.' archive='../application/application.jar'> 
<param name="java_arguments" value="-Djnlp.packEnabled=true"/>
</applet>
</BODY>
</HTML>

The index.html file calling the applet is deployed in separate war file viewer.war with a context path /view inside the jboss3.2.6 deploy path

When i load the index.html inside the webbrowser i always get the following exception in the sun java console of the webbrowser

Java Plug-in 1.5.0_02
Using JRE version 1.5.0_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\kartheepan


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
p: reload proxy configuration
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 application.main.class not found.
java.lang.ClassNotFoundException: chart.MainApplet.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)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more

The applet did not load successfully.

When i change the coding in the pack200 service servlet to give application.jar as response rather the compressed application.pack200.gz the application loads successfully in the index.html without fail.I believe there is no problem with the pack200 service servlet provided by the sun website.I am using jdk.1.5 version of java for development with jboss3.2.6 as application server.

i am afraid the webbrowser is not able to decompress the compressed application.jar successfully using the jdk1.5/bin/unpack200.exe provided by the jdk1.5 version of java.Is it something im missing in the index.html code.

i have provided the following 2 mandatory things as mentioned in the pack200 deployment guidelines

<meta HTTP-EQUIV="accept-encoding" CONTENT="pack200-gzip,gzip">

inside the <head> tag and also

<param name="java_arguments" value="-Djnlp.packEnabled=true"/>

i even tried changing the meta tag value from

<meta HTTP-EQUIV="accept-encoding" CONTENT="pack200-gzip,gzip">

to

<meta HTTP-EQUIV="accept-encoding" CONTENT="gzip,deflate">

but with no success i still get the class not found exception.

Where i my going wrong,should i need to write any pack200 install routine.AND IF SO WHERE DO I need to write should it be written on the server provided alongside the compressed jar or should it be present on the client machine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.