Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange: Jar file not working in HTML

2 views
Skip to first unread message

Todd Hlavacek

unread,
Apr 12, 2002, 3:31:04 PM4/12/02
to
Hi:

I am at a loss as to why this situation is in my hands. :)
Seriously, I have packaged a JAR file with several classes and
resource files (all Gifs of 400 bytes or less).

I ran it just fine via the java -jar Foo.jar and java
-classpath=foo.jar etc etc -- all from the prompt using java.exe.

But I cannot seem to be able to run it via an applet on the web. The
applet has the following code:

<html>
<CENTER>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = "800" HEIGHT = "525"
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME = CODE VALUE = "loApplet.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<PARAM NAME="filename" VALUE="C:\Epoch\outbox\julieshi.solution5.oft">
<PARAM NAME="sessionid" VALUE="no_session_id_yet">
<PARAM NAME="returnurl"
VALUE="http://julieshi5.ih.lucent.com/EPOCHServer/Report/report.asp">
<!-- PARAM NAME="returnurl"
VALUE="http://julieshi5.ih.lucent.com/EPOCHServer/Product/Product.asp"
-->
<PARAM NAME="debug" VALUE="t">
<PARAM NAME="testdir" VALUE="todd">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3" CODE =
"loApplet.class" ARCHIVE="EPOCHlayout.jar" WIDTH = "800" HEIGHT =
"500" MAYSCRIPT="true" scriptable=false
pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>

</NOEMBED></EMBED>
</OBJECT>

<!--
<APPLET CODE = "loApplet.class" ARCHIVE="EPOCHlayout.jar"
MAYSCRIPT="true" WIDTH = "800" HEIGHT = "500">


</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->

</CENTER>
</html>

And the html and JAR files are in the same directory. I'm getting an
ClassNotFoundException error (output from Java Console using trace
level set to 5):

load: class loApplet.class not found.
java.lang.ClassNotFoundException: java.io.FileNotFoundException: File
not found: http://mycompany.url.com:2222/todd/loApplet/class.class at
sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source)
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) at
sun.applet.AppletClassLoader.findClass(Unknown Source) at
sun.plugin.security.PluginClassLoader.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)

***

I even tried changing the CODE from "loApplet.class" to "loApplet".
Same bat result.

***

By the way, this works if I put the *.class and *.gif resource files
in the same directory. I want the JAR file and not individual class
files.

Any ideas?

Thanks,
Todd

Todd Hlavacek

unread,
Apr 29, 2002, 2:03:01 PM4/29/02
to
I wanted to post the solution here for others who may have the same
problem:

Credit to Gil Vincent for helping me out.

Hi Gil,

I wanted to bring closure to this by informing you that your latest
email did the trick! (that email was about plugging in archive in a
plain old applet (and non-html-converted) file then running it through
the html converter)

Wanted you to know.

If you'd like, I'll post your comments to google for others to look at
and give you due credit.

Todd

At 09:52 AM 4/16/2002 -0700, you wrote:
Hi Todd,

Assumption: java plug-in being used.

What does your html (just the applet portion) look
like? It might help me to identify the problem.
Also, did you use the old <applet> tag and use the
html converter to produce the actual tags, or did you
write them manually?

-Gil


--- Todd Hlavacek <toddh@euuu> wrote:
> Hi Gil,
>
> Thanks! I'm using MSIE5.5 SP2. I do not know what
> our customers will use,
> but this product must have at least a MSIE version
> 5.0.
>
> I'm also using a Java Plug-in version 1.3. The jar
> file does not get
> pulled in via the plug-in at all. I put the
> archive=... keyword in two
> places: in between the <embed> and </embed> tags
> and one for the hidden
> applet code.
>
> Neither worked.
>
> I'm going to try the cab approach.
>
> Todd
>
> At 11:58 PM 4/15/2002 -0700, you wrote:
> >I posted (or thought so, but apparently didn't go
> out)
> >this reply to your question about applets and jar
> >files. I hope this helps.
> >
> >-Gil Vincent
> >
> >***************************
> >
> >Which browser? The problem is that the JVM
> >implementations in browsers are not consistant. If
> MS
> >IE, then archive argument is expected to be in
> >Microsoft's ".cab" file format. If Netscape, then
> it
> >will accept ".jar". If using the java plugin, a
> .jar
> >file should also work just fine.
> >
> >***************************


> >
> >From: "Todd Hlavacek" <toddh@euu4>
> >Subject: Strange: Jar file not working in HTML
> >Date: Friday, April 12, 2002 12:31 PM
> >
> >Hi:
> >
> >I am at a loss as to why this situation is in my
> >hands. :)
> >Seriously, I have packaged a JAR file with several
> >classes and
> >resource files (all Gifs of 400 bytes or less).
> >
> >I ran it just fine via the java -jar Foo.jar and
> java
> >-classpath=foo.jar etc etc -- all from the prompt
> >using java.exe.
> >
> >But I cannot seem to be able to run it via an
> applet
> >on the web. The
> >applet has the following code:
> >
> >

to...@lucent.com (Todd Hlavacek) wrote in message news:<8abf1b57.02041...@posting.google.com>...

0 new messages