Comment on Tutorial - How to Send SMS using Java Program (full code sample included) By Emiley J.



Comment Added by : chetan

Comment Added at : 2007-10-17 08:13:14

Comment on Tutorial : How to Send SMS using Java Program (full code sample included) By Emiley J.
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.

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 requirement

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(LinuxSerial.java:346)
at SerialConnection.setConnectionParameters(SerialConnection.java:167)
at SerialConnection.openConnection(SerialConnection.java: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.java:66)
at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:369)
at SerialConnection.openConnection(SerialConnection.java: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 confirguring 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..

Please help!!!..


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Log onto incoming mail server(POP3) - failed
View Tutorial          By: dragos at 2012-12-13 10:41:59

2. If i delete a record, will that recId be replaced
View Tutorial          By: faisal at 2009-06-08 21:36:29

3. Hello! May I know where is the "main" fu
View Tutorial          By: Angelia at 2009-06-25 18:54:28

4. I have been trying to learn ASP.net for a week and
View Tutorial          By: eric at 2010-08-06 15:43:49

5. Can anybody tell the steps to go ahead with the ex
View Tutorial          By: Sunpenn at 2009-10-12 03:57:58

6. it provides manna in the studies of java to me
View Tutorial          By: aravinden at 2011-12-27 08:18:18

7. is good bot not full
View Tutorial          By: amin parishani iran at 2010-07-07 10:51:33

8. Code indentation would help!...
View Tutorial          By: James at 2011-06-30 04:54:51

9. thaks sir for giving information about adding int
View Tutorial          By: vijay kumar at 2012-10-10 04:59:05

10. j = 0;
while(--j)
{

View Tutorial          By: alistair at 2012-01-28 06:05:48