NoSuchPortException probably means that you've used a portname that doesn't
exist.
Try this code to enumerate the available ports.
See if you're using a port that exists:
Or just test your code with all enumerated ports.
System.out.println("De Available Ports:\n------------------");
Enumeration<CommPortIdentifier> comports= CommPortIdentifier.
getPortIdentifiers();
for(Enumeration<CommPortIdentifier> enu = comports; enu.hasMoreElements
();){
CommPortIdentifier dezePort = enu.nextElement();
System.out.println("Name: "+dezePort.getName());
System.out.println("PortType: "+dezePort.getPortType());
}
On Tuesday, 6 November 2012 00:02:47 UTC+1, Bruno Moreira wrote:
>
> I've created a project based on ReadMessages example, in NetBeans 7.0.1.
> in Windows 7 32Bit
> I can run the project without problems, and(for those who don't know,
> Netbeans automatically creates an executable jar file inside dist folder.
>
> The problem is that when I try to run the jar file using java -jar
> readmessages.jar, it always say that the COM port wasn't found.
>
> What am I doing wrong?
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Example: Read messages from a serial gsm modem.
> SMSLib: A Java API library for sending and receiving SMS via a GSM modem
> or othe
> r supported gateways.
> This software is distributed under the terms of the Apache v2.0 License.
> Web Site: http://smslib.org
> Version: 3.5.2
> log4j:WARN No appenders could be found for logger (smslib).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more in
> fo.
> org.smslib.GatewayException: Comm library exception:
> java.lang.RuntimeException:
> javax.comm.NoSuchPortException
> at
> org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java
> :102)
> at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
> at
> org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
> at org.smslib.Service$1Starter.run(Service.java:276)
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/smslib/-/m0xo5mQ_D20J.
For more options, visit https://groups.google.com/groups/opt_out.