This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes NullPointerException: name can't be null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "NullPointerException: name can Watch "NullPointerException: name can New topic
Author

NullPointerException: name can't be null

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Good day!
I have this code which I want to implement in an Applet and put in on a JSP page after.



But after running this program, I get this error:

java.lang.NullPointerException: name can't be null
at java.io.FilePermission.init(Unknown Source)
at java.io.FilePermission.<init>(Unknown Source)
at java.lang.SecurityManager.checkDelete(Unknown Source)
at javax.comm.CommPortIdentifier.getPortIdentifiers(CommPortIdentifier.java:70)
at com.amkor.stripmap.ReadWriteC.getPorts(ReadWriteC.java:38)
at com.amkor.stripmap.ReadWriteC.<init>(ReadWriteC.java:78)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


What is lacking in my code?

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41065
    
  43
In order to perform socket I/O applets generally need to be signed; is that the case?

As an aside, you should remove the constructor, and move everything that's in it into an init() method.
[ October 19, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
thank you for your reply!

God bless!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException: name can't be null
 
Similar Threads
Cannot read the data from the serial port on the second time
Send SMS by using Serial Port
how can I send the output of a servlet to a jsp page?
Java Comm API... Please respond
how to append the contents of an ArrayList