MC9S12NE64 OpenTCP Java Applet

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S12NE64 OpenTCP Java Applet

3,465 次查看
MatthieuSIMON
Contributor I
Hello,

I'm trying to execute a Java applet (this one : http://donpichol.free.fr/applet/ ) from an OpenTCP http server embedded in the NE64 flash memory.

I can reach the "index.htm" and it's loaded well, then the java virtual machine try to load the "test.class" and it gives an error :

--------------------------------------------------------------------------------------
java.lang.RuntimeException: java.lang.NullPointerException
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(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 java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
...

and so on ...
--------------------------------------------------------------------------------------

If I "Save As..." the index.htm into a local directory it works well -> so, the datas aren't corrupted, the communication works and the "index.htm" and "test.class" are well "burned" into flash, http server GETs them, ...

Does someone have ever experienced this kind of problem ?

I found a demo example from http://www.softecmicro.com/forum/showthread.php?s=7df906a26a7f5f029d90f6f04e782ba1&threadid=482&goto...
but the .jar is to big to fit in the memory with my code.

Does someone have a small working html file + .jar to try on my application ?

I'm using JRE 1.5.0_06

Regards,

Matthieu SIMON
--------------------------------------------------
CANEL - C.E.I.D.
14, rue Michel Luciani
91330 Yerres - France
Phone +33169484216
Fax +33169481420
--------------------------------------------------
标签 (1)
0 项奖励
回复
5 回复数

817 次查看
rammohank
Contributor I
Hi Matthieu SIMON
Which TCP/IP STACK are you using for loading webpages.
I have loaded OPEN TCP/IP STACK in my NE64.
I am not able to load index.htm file.
Is there any settings to be done in that code.
If there is any please let me know.
Thanks and Regards
Ram Mohan
0 项奖励
回复

817 次查看
DrSeuss
Contributor I
Turn off Java caching. Java will use the .class file from the local machine if there is a match to the filename. If the file is the wrong one or corrupted, things will not work correctly.
0 项奖励
回复

817 次查看
pittbull
Contributor III
Hello,

It seems that the browser fails to load the .class files. This can happen for a number of reasons:
- There's a wrong "codebase" attribute in your "applet" tag.
- Your server doesn't handle class loaders HTTP requests properly.
- Your server does not allow multiple connections.
- ...

As a starting point, you may trace the HTTP requests to see if they're handled and if your server delivers the required stuff to the browser.

Hope this helps a little,

-> pittbull
0 项奖励
回复

817 次查看
MatthieuSIMON
Contributor I

Hi pittbull,

Thank you for helping.

Tracing the HTTP requests and acks was the first thing I did.
(Ethereal's export function is bugged in version 0.99.0, so can't show you the log but have a look at the printscreen)

>- There's a wrong "codebase" attribute in your "applet" tag.
what do you mean ? I can't control this, it's generated by java compiler, no ?

Well, my whole app works well (ethernet to serial converter), all the work is done but I just need a way to configure the different parameters (IP, netmask, ..., baudrate, stop bits, ...)
The simplest way was to create a java applet which connects to target by TCP protocol to send parameters but maybe there's another way, any suggestions ?

Regards,

Matthieu SIMON
--------------------------------------------------
CANEL - C.E.I.D.
14, rue Michel Luciani
91330 Yerres - France
Phone +33169484216
Fax +33169481420
--------------------------------------------------

 

ethereal.jpg

Message Edited by t.dowe on 2009-10-21 12:18 AM
0 项奖励
回复

817 次查看
pittbull
Contributor III
Hello,

There are some RST's in your ethereal dump - are you sure your webserver can handle multiple connections?
Also there's an incorrect TCP checksum. This should normally not happen because an ethernet card throws away damaged packets (wrong CRC, you should not see this as an incorrect TCP checksum).

Matthieu SIMON wrote:
> The simplest way was to create a java applet which connects to target by TCP protocol
> to send parameters but maybe there's another way, any suggestions ?

I think the simplest way is using an HTML FORM and submit button. You need neither multiple connections nor a JVM on the browser for this.
0 项奖励
回复