Hi, all
I'm trying to create a servlet wich is oppening one serial port and send
some data on it. The problem is that the following piece of code gives me a
NullPointerException on method hasMoreElements() but the portList object is
different from null:
portList = CommPortIdentifier.getPortIdentifiers();
while(portList.hasMoreElements()){
portId = (CommPortIdentifier)portList.nextElement();
System.out.println(portId.getName());
}
I'm working on NT4 workstation and all the serial stuff(including the code
above) is working very well if I am calling the above code from main(...)
method in a regular class. But if I use the code inside service() method in
a servlet I get NullPointerException. Did I missed something? Or there are
some security problems using servlets in this way? Thanks in advance.
Bogdan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html