Thanks for the reply, following are the steps of the application.

1) Made use of CommPortIdentifier to identify the modems attached to
different ports so as to get the parameters(viz. modelno, manufacturer,
baud rate) of the modems.
2)Closed all the OutputStream, InputStream, SerialPort after extracting the
info. from each modem.
3)Then initialized all the gateway with the information extracted in the
above step.
Following is the snippet for initializing modems :

 private void XXXParam() {
        private SerialModemGateway gt[];

        for(int i = 0; i < smsui.getDevicehm().size(); i++) {
            DeviceDetails deviceobj = smsui.getDevicehm().get(i);
            gt[i] = new SerialModemGateway(deviceobj.getProfilename(),
deviceobj.getPort(),
                    Integer.parseInt(deviceobj.getBaudrate()),
deviceobj.getManufacture(), deviceobj.getModelno());
            gt[i].setInbound(true);
            gt[i].setOutbound(true);

            try {
                service.addGateway(gt[i]);

            } catch (GatewayException e) {
                e.printStackTrace();
            }
        }

        try {
            service.startService(true);

        } catch (TimeoutException e) {
            e.printStackTrace();

        } catch (GatewayException e) {    //Exception is thrown here
            e.printStackTrace();

        } catch (SMSLibException e) {
            e.printStackTrace();

        } catch (IOException e) {
            e.printStackTrace();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

Exception is thrown when the service.startService(true) method in invoked
in the smslib
This method starts all the available gateways.

On Wed, Jan 2, 2013 at 6:52 PM, SMSLib Discussion Group on behalf of
Thanasis Delenikas <[email protected]> wrote:

> Hi,
>
> The standard answer for those running on Win32 is to check sync apps, like
> Nokia PC Suite and the like, which tend to hold the port... but I don't
> know if this is true for your case.
>
> Are you running anything similar? Any monitor maybe?
> Are you starting / stopping the SMSLib Service all the time or just once?
>
>
> On 2 January 2013 07:44, Balvant via SMSLib Discussion Group <
> smslib+noreply-apn2wqfnar0zaqpqdgzpdhwsccbsxszajcm57zdm6k63mg...@googlegroups.com
> > wrote:
>
>>
>>
>> Hi
>>
>> I have written an application which supports multiple modems attached.At
>> present I am attaching only two modems.This application sends sms from both
>> the modems. This application throws me the below mentioned exception:
>>
>> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB1: File
>> exists
>> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyUSB0: File
>> exists
>>
>> org.smslib.GatewayException: Comm library exception:
>> java.lang.RuntimeException: gnu.io.PortInUseException: Unknown Linux
>> Application
>>      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 am not able to get to the crux of the issue. Sometimes it works and I
>> am able to send sms from both the modems. My OS is Linux and inspite of
>> debugging the code, I am not able to understand which Linux application is
>> keeping hold of the ports as given in the exception. Any help would be
>> appreciated
>>
>>
>>  --
>> 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/-/TPZVTu93BuIJ.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 https://groups.google.com/groups/opt_out.
>
>
>



-- 
Thanks and Regards,

Balvant Desai.

-- 
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 https://groups.google.com/groups/opt_out.


  • [smslib] Unknown L... Balvant via SMSLib Discussion Group
    • Re: [smslib] ... SMSLib Discussion Group on behalf of Thanasis Delenikas
      • Re: [smsl... SMSLib Discussion Group on behalf of Balvant
        • Re: [... SMSLib Discussion Group on behalf of Alex

Reply via email to