Posted By:
chirag_shah
Posted On:
Wednesday, October 17, 2007 02:25 PM
we are java research students. we are working on sms based project, we have one issue of sending sms on fedora 7 with fargo maestro 20 gsm modem.Our Modem is connected to Serial Port. Before I proceed let me tell you that we are newbies in Linux & having average knowlegde of java, j2me... We have installed sun java in the linux box..then comm.jar api. the deployment of the .so & java.comm jar is done as per specified our application is based on the following code: http://www.java-samples.com/showtutorial.php?tutorialid=22 we have complied java files...then we have written the shell file for running the java class file.
More>>
we are java research students.
we are working on sms based project, we have one issue of sending sms on fedora 7 with fargo maestro 20 gsm modem.Our Modem is connected to Serial Port.
Before I proceed let me tell you that we are newbies in Linux & having average knowlegde of java, j2me...
We have installed sun java in the linux box..then comm.jar api.
the deployment of the .so & java.comm jar is done as per specified
our application is based on the following code:
http://www.java-samples.com/showtutorial.php?tutorialid=22
we have complied java files...then we have written the shell file for running the java class file.
--------------------------------------------------------------------------------
//DemoSms.java
public class DemoSms
{
public static void main(String args[])
{
SMSClient sc = new SMSClient(1);
sc.sendMessage("MyCellNo","Hello");
}
}
//ends here
--------------------------------------------------------------------------------
#shell file
JAVA_HOME=/opt/jdk1.5.0_12
CLASSPATH=/opt/sms:$JAVA_HOME/jre/lib/comm.jar
$JAVA_HOME/bin/java -cp $CLASSPATH DemoSms
#shell file ends here
--------------------------------------------------------------------------------
/*
Console message errors we get are as follows
*/
[root@TEST ~]# sh SmsSend.sh
/dev/ttyS0
PortId = javax.comm.CommPortIdentifier@173a10f
java.io.IOException: Not all params are supported by kernel
at com.sun.comm.LinuxSerial.nativeSetSerialPortParams (Native Method)
at com.sun.comm.LinuxSerial.setSerialPortParams(Linux Serial.java:346)
at SerialConnection.setConnectionParameters(SerialCon nection.java:167)
at SerialConnection.openConnection(SerialConnection.j ava:100)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Thread.java:595)
[1]+ Stopped sh SmsSend.sh
[root@TEST ~]# sh SmsSend.sh
/dev/ttyS0
PortId = javax.comm.CommPortIdentifier@173a10f
java.lang.RuntimeException:
Error opening "/dev/ttyS0"
lockf(): Resource temporarily unavailable
at com.sun.comm.LinuxDriver.getCommPort(LinuxDriver.j ava:66)
at javax.comm.CommPortIdentifier.open(CommPortIdentif ier.java:369)
at SerialConnection.openConnection(SerialConnection.j ava:89)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Thread.java:595)
--------------------------------------------------------------------------------
As we are newbies we are not able to trace where the actual problem is...
We have used this modem in windows env and it runs perfectly..
We have tried configuring minicom also to try to send sms but we have failed in doing so..
We have already put around 20 hours trying to find the error but with no use..
Your help is very much appreciated...
Please help!!!..
<<Less