Ниже приведен производственный код, я использую его для нового драйвера.portName - это COM4, и этот порт существует на ПК (и я могу подключиться к нему с помощью гипертерминала), так почему же Javacomm генерирует исключение NoSuchPortException?COM4 обнаруживается нормально в устройстве mgr.тоже
final String portName = getSerialPort();
try {
final CommPortIdentifier id = CommPortIdentifier.getPortIdentifier(portName);
port = (SerialPort) id.open(getName(), 1000);
} catch (NoSuchPortException nspe) {
report(SeverityCode.LEVEL2, getName(), "PIN Pad is not connected to " + portName + " port, or the port does not exist.");
return;
} catch (PortInUseException piue) {
report(SeverityCode.LEVEL2, getName(), portName + " port is already in-use by some other device. Reason: " + piue.getMessage());
return;
}