I've created a very simple Java 2 applet which runs fine from a file:// url,
but I'm having difficulty trying to deploy it on my
local MS IIS. I'm getting a 'class not found' error caused by a 'open HTTP
connection failed' error.

I've been tearing my hair out on this for a while now and would be very
grateful if someone could offer some pointers.

I've been trawling through the various technical forums and see that this
seems to be a common problem using Java 2 applets via the Java plugin with
IE6/IIS, though I've yet to see a definitive solution. I'm guessing this is
either an IIS or java plug-in configuration problem on my part but I can't
see what I have left to play with. I've successfully run JSP, servlets, ASP
and ASP.NET over the local IIS, and Java applets are the only thing I can't
get to work.

I'm using IE 6.0.2800 (XP Pro), IIS 5.1, Java Plug-in version 1.4.1_03,
which I believe is the latest. I have the plug in configured to use the
default plug-in JRE and the browser proxy settings (I'm not using a proxy),
though I've tried it both ways without success. The PC I'm running it on is
on a local network behind an ADSL router.

The applet runs fine when invoked from a file://.. URL (provided I remove
the codebase tag), but not when I try to run it through the local IIS as
http://localhost/Fetcher/Fetcher.html (or, for that matter, as
http://127.0.0.1/..., http://192.168.1.11/... etc etc).

The directory structure I'm using is as follows (I'm not using a package or
archive to simplify matters, though I appreciate you would probably do so in
a production scenario);

C:\Inetpub\wwwroot\Fetcher\Fetcher.html
C:\Inetpub\wwwroot\Fetcher\Fetcher.class

The HTML I'm using is;

<html>
<head>
<title>Fetcher Java Applet Demo</title>
<body>
<applet
CODEBASE="/Fetcher/"
CODE = "Fetcher.class"
WIDTH = 500
HEIGHT = 300
HSPACE = 0
VSPACE = 0
ALIGN = middle
ALT="Your browser understands the &lt;APPLET&gt; tag but isn't running the
applet, for some reason."
Your browser is completely ignoring the &lt;APPLET&gt; tag!
>
</applet>
</body>
</html>


The complete error message is as follows;

Java(TM) Plug-in: Version 1.4.1_03
Using JRE version 1.4.1_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Steven Smith
Proxy Configuration: No proxy

[snip]

load: class Fetcher.class not found.
java.lang.ClassNotFoundException: Fetcher.class
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:153)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:114)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:506)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:567)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:496)
at sun.applet.AppletPanel.run(AppletPanel.java:293)
at java.lang.Thread.run(Thread.java:536)

Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:252)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:42)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:143)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:140)
... 10 more




--
Steven Smith


--
Steven Smith

Re: Problem deploying Java applet in IIS - open HTTP connection failed??? by Steven

Steven
Fri Jul 11 10:15:21 CDT 2003



--
Steven Smith
"Steven Smith" <steve@nospam.com> wrote in message
news:3f0e8665$0$965$cc9e4d1f@news.dial.pipex.com...
> I've created a very simple Java 2 applet which runs fine from a file://
url,
> but I'm having difficulty trying to deploy it on my
> local MS IIS. I'm getting a 'class not found' error caused by a 'open HTTP
> connection failed' error.

[snip]

For what it's worth, I posted exactly the same applet and html files in
exactly the same configuration to my ISP web site and it all works
perfectly;

http://www.aonv81.dsl.pipex.com/fetcher/fetcher.html

So I'm guessing this is definitely a local IIS 5.1 issue rather than a
problem with my applet, html, java plug-in or browser, but I may be wrong.



Re: Problem deploying Java applet in IIS - open HTTP connection failed??? by Steve

Steve
Sat Jul 12 06:27:47 CDT 2003


"Steve Smith" <nospam@nospam.com> wrote in message
news:3f0fd274$0$3135$cc9e4d1f@news.dial.pipex.com...
> If anyone's interested, it turned out to be an access issue.
>
> I was using Windows Authentication rather than anonymous access on my
local
> IIS web site (I generally just use it for local development &
> experimentation and never normally publish the results).
>
> For some reason IIS and/or the Java plug-in won't allow the applet to load
> under windows authentication but will under anonymous access. Windows
> authentication has always been something of a black art for me and it's
not
> immediately apparent to me why things should work this way (perhaps
someone
> would be good enough to explain it?), but it seems to be sorted now.
>

Continuing in this monologue ( ;-) ), if anyone's interested the very latest
1.4.2 JRE incorporates functionality which now works with Windows
Authentication (NTLM). The previous version didn't.

(got this from a tip in comp.lang.java.help)