Reputation: 1677
javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier
sending sms(text) from java code to mobile phone in windows
i am using the above link source code .. but i am getting errors
javax.comm.NoSuchPortException
at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:105)
at com.codon.sms.SerialConnection.openConnection(SerialConnection.java:71)
at com.codon.sms.Sender.send(Sender.java:45)
at com.codon.sms.SMSClient.run(SMSClient.java:33)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.codon.sms.SerialConnection.openConnection(SerialConnection.java:90)
at com.codon.sms.Sender.send(Sender.java:45)
at com.codon.sms.SMSClient.run(SMSClient.java:33)
at java.lang.Thread.run(Unknown Source)
Upvotes: 0
Views: 1873
Reputation: 3172
Well the exception says it all. There is not such port it can access.
I saw the code of the link u posted. It tries to connect on COM2. Is that where the device is sitting? If it's sitting on COM1 change your code.
Another reason would be the JavaComm installation. Have you included everything? DLLs, JARs etc? If it was a DLL issue you would get the UnsatisfiedLinkError exception too but anyway.
Upvotes: 1