where to host your applets
Hi, I tried to save an applet on my freewebs account so I could access it from anywhere in an html webpage, but for some reason it refuses to work.
Does anyone know how I can fix this? If not, do you know of a good, (free) place where you can upload java applets, and access them within an html webpage?
Btw, I'm also fairly new to java and to programming in general, so don't assume I know a lot. :-\
[423 byte] By [
mikau16a] at [2007-11-27 4:50:35]

> the exception thats thrown is a
> classDefNotFoundException
>
> its just not able to access the .class file on my
> freewebs account. I checked repeatedly to make sure
> the adress was correct, I copied it directly from my
> freewebs account.
Dunno if I'm telling you this right but, do you have FTP access to your freewebs account? I don't know much about freewebs as I use a paid-for website, so, ya.
And, how are you trying to save this applet exactly?
Zacha at 2007-7-12 10:03:58 >

again, I'm fairly new to this stuff, especially web programming so i don't fully understand some of your questions. :-(
I don't know what FTP accesss means so I'm not sure if I have it. :-\
If a file on freewebs is an image, you can view the image just by typing its url.
If I try to access a .class file though, nothing happens, but heck, nothing happens if you try to open a .class file
directly on your own computer, right?
here's my html code
<html>
<head>
<title> myTitle </title>
</head>
<body>
<APPLET CODE="http://www.freewebs.com/mikau16/JavaShapeArray4.class"></APPLET>
</body>
</html>
and here are the error messages:
Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Rav
-
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 http://www.freewebs.com/mikau16/JavaShapeArray4.class not found.
java.lang.ClassNotFoundException: http:..www.freewebs.com.mikau16.JavaShapeArray4.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
load: class http://www.freewebs.com/mikau16/JavaShapeArray4.class not found.
java.lang.ClassNotFoundException: http:..www.freewebs.com.mikau16.JavaShapeArray4.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
Is the web page that has the <applet> tag on it on the same server as the applets?
It's possible that freewebs blocks applets. You should ask them. But if they did, you'd probably still be able to connect to the server; it's just that the applet you get back would be corrupted or zero length or have a bad status code (most likely, for reasons I don't want to go into). You probably wouldn't get a stack trace message saying that it couldn't connect at all. On the other hand, maybe the message is just obscure.
Were you able to read the web server logs, to see if the applet was referenced and if so what the response was? Was there a corresponding message in the error log.
Personally, I wouldn't use a web provider if they didn't let me have access to the logs.
I have a couple web sites at verio.net and applets aren't a problem, although this is not an endorsement. I'll bet applets are OK at most places.