i try to send the message 2 times, but the second time have the
problem
org.smslib.GatewayException: Comm library exception:
java.lang.RuntimeException: gnu.io.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)
i write a new methods for stop service ,but it doesn't work.
public void stopSer()
{
try
{
Service.getInstance().stopService();
}
catch (GatewayException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SMSLibException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
for(int i=0;;i++)
{
String line;
String sento;
String allContent = "";
int lastIteration=1;
int iteration =1;
File file = new File ("D:/sendsms.txt");
FileInputStream in = new
FileInputStream( file);
InputStreamReader read = new
InputStreamReader(in);
BufferedReader reader = new
BufferedReader(read);
while ((line = reader.readLine()) !=
null)
{
allContent += line + " ";
}
SendMessage app = new SendMessage();
String[] array=allContent.split("[\\t \\n]+");
for(int j=0;j<array.length;j++)
System.out.println(array[j]);
try{
iteration=Integer.parseInt(array[6]);
}catch(Exception e){
System.out.print( "it's vide ");
app.stopSer();
}
System.out.println(iteration);
if(iteration>=(lastIteration+1))
{
sento = array[3];
//SendMessage app = new SendMessage();
try
{
app.doIt(sento,allContent);
lastIteration=iteration;
}
catch (Exception e)
{
e.printStackTrace();
}
}
else
app.stopSer();
app.waitService();
}
}
On 11月26日, 上午11时36分, Karol Pancypir <[email protected]> wrote:
> Hi,
> do you finish application with press enter button? I guess maby
> Service.getInstance().stopService(); is not properly executed.
>
> Pancypir
>
> On 25 Lis, 21:27, "Magic@lu" <[email protected]> wrote:
>
>
>
>
>
>
>
> > i use try to send sms(huawei E173) by emample SendMessage.java ,the
> > first time ,it's ok,but the second time ,i click run ,there are many
> > erreur.
>
> > org.smslib.GatewayException: Comm library exception:
> > java.lang.RuntimeException: gnu.io.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)
>
> > how can i solve the promblem.
>
> > i find out that i reconnecte the E173,i can send the sms once ,but it
> > the twice ,it dose not work.
>
> > thanks a lot .
--
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].
For more options, visit this group at
http://groups.google.com/group/smslib?hl=en.