Hi All
I have been playing with the HTTP server and Michael Walkers fine work on interfacing with Java.
That demo works fine on my mbed!
I have an applet built with Eclipse packaged into a jar file.
I can serve the web page from my MBED but get errors when trying to run the applet.
load: class SolarMonitor not found.
java.lang.ClassNotFoundException: SolarMonitor
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.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://192.168.1.65/SolarMonitor.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)
... 9 more
Exception: java.lang.ClassNotFoundException: SolarMonitor
No I'm no expert, but it looks like the browser can't find my applet, the jar file is present and as far as i can tell, it does contain my applet.
The web page is super simple:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Solar Monitor</title>
</head>
<body>
<h1>Solar Monitor</h1>
<P align = "CENTER">
<APPLET ARCHIVE="Solar.jar" code="SolarMonitor.class" WIDTH="700" HEIGHT="410">
<PARAM NAME="rate" VALUE="1000">
The Applet should be here, check it has been loaded on to mbed and that Java is installed and enabled in your browser.
</APPLET>
</P>
</body>
</html>
This is a tweaker version of Michaels example.
I assume it's a class path issue or simmilar, complicated by the server being on the mbed.
Any suggestions greatfully received.
Brendan
Hi All
I have been playing with the HTTP server and Michael Walkers fine work on interfacing with Java.
That demo works fine on my mbed!
I have an applet built with Eclipse packaged into a jar file.
I can serve the web page from my MBED but get errors when trying to run the applet.
load: class SolarMonitor not found.
java.lang.ClassNotFoundException: SolarMonitor
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.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://192.168.1.65/SolarMonitor.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)
... 9 more
Exception: java.lang.ClassNotFoundException: SolarMonitor
No I'm no expert, but it looks like the browser can't find my applet, the jar file is present and as far as i can tell, it does contain my applet.
The web page is super simple:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Solar Monitor</title>
</head>
<body>
<h1>Solar Monitor</h1>
<P align = "CENTER">
<APPLET ARCHIVE="Solar.jar" code="SolarMonitor.class" WIDTH="700" HEIGHT="410">
<PARAM NAME="rate" VALUE="1000">
The Applet should be here, check it has been loaded on to mbed and that Java is installed and enabled in your browser.
</APPLET>
</P>
</body>
</html>
This is a tweaker version of Michaels example.
I assume it's a class path issue or simmilar, complicated by the server being on the mbed.
Any suggestions greatfully received.
Brendan