USB GSM 调制解调器 (Huawei e160) 连接时出错?
javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier
我正在使用上面的链接源代码..但我收到错误
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)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,例外说明了一切。没有它可以访问的端口。
我看到了你发布的链接的代码。它尝试连接 COM2。那是设备所在的位置吗?如果它位于 COM1 上,请更改您的代码。
另一个原因是 JavaComm 安装。你把所有的东西都包括进去了吗? DLL、JAR 等?如果是 DLL 问题,您也会收到 UnsatisfiedLinkError 异常,但无论如何。
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.