Applet & RS232
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Robert_Ciurkot
Posted On:   Wednesday, May 12, 2004 05:32 AM

Hello, Is possible to read data form RS232 by applet?? I created applet with simple code, which reads data form rs232 and next sign the applet, but it doesn’t work. I have following information on my java console: java.lang.NullPointerException: name can't be null at java.io.FilePermission.init(Unknown Source) at java.io.FilePermission. (Unknown Source) at java.lang.SecurityManager.checkWrite(Unknown Source) at sun.plugin.security.ActivatorSecurityManager.checkDelete(Unknown Source) at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:89) … at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(   More>>

Hello,
Is possible to read data form RS232 by applet??
I created applet with simple code, which reads data form rs232 and next sign the applet, but it doesn’t work. I have following information on my java console:

java.lang.NullPointerException: name can't be null

at java.io.FilePermission.init(Unknown Source)

at java.io.FilePermission. (Unknown Source)

at java.lang.SecurityManager.checkWrite(Unknown Source)

at sun.plugin.security.ActivatorSecurityManager.checkDelete(Unknown Source)

at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:89)

…

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)




When, I run the same code, but as application every thing is ok.
Thanks for all suggestions.

   <<Less

Re: Applet & RS232

Posted By:   Sean_Owen  
Posted On:   Wednesday, May 12, 2004 09:59 AM

The difference is that the applet executes with the SecurityManager enabled. That's good -- I wouldn't want your applet to be able to read/write to my computer's ports by default!



So when the applet runs it is executing a security check that your stand-alone application does not. Are you passing null to getPortIdentifier? If not then this could be a bug in javax.comm, frankly.

About | Sitemap | Contact