-
July 1st, 2009, 02:44 PM
#1
Java beginner cannot find embeded applet
Hello,
I have been learning Java and I have a working Hello World app that I can make work from the command prompt. I see
Hello World!
My problem comes to when I embed the program into a webpage. My HTML is all sound...
<applet code="helloworld.class" width=300 height=300>
<param name="bgcolor" value="ffffff">
<param name="fontcolor" value="000000">
Your browser is not Java enabled.
</applet>
My .html and .class files are both in the same directory on the website.
But my applet produces the following error...
load: class helloworld.class not found.
java.lang.ClassNotFoundException: helloworld.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://www.webtest.frihost.org/helloworld/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: helloworld.class
Does anyone know what the problem might be? I have trawled the net for answers and not fornd an answer as of yet
Neilos
-
July 1st, 2009, 04:20 PM
#2
Re: Java beginner cannot find embeded applet
Do you think the 'caused by' message in the stack trace might contain a clue?
Caused by: java.io.IOException: open HTTP connection failed:http://www.webtest.frihost.org/helloworld/class.class
We don't have time to stop for gas, we're already late...
M. Cleron
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
July 1st, 2009, 07:46 PM
#3
Re: Java beginner cannot find embeded applet
Originally Posted by dlorde
Yes, I had notices this but couldn't understand why the JRE would want to open a file called class.class in the subdirectory helloworld/... when I don't put that in the applet 'code' element...
code="helloworld.class"
Can anyone see why it is looking there for the file? I cannot see why it would or how to point it at the right place (as far as I'm aware it should be pointed at the correct file).
Thanks
Neilos
-
July 6th, 2009, 12:04 AM
#4
Re: Java beginner cannot find embeded applet
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|