File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Problem related smslib api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem related smslib api" Watch "Problem related smslib api" New topic

Problem related smslib api

mayank pandey

Joined: Nov 24, 2011
Posts: 5
I am trying to send sms using smslib api using the example in it. but its giveing me below error. I think its basically because smslib is not coorectly installed in my eclipse because i cant find anywhere how to instal in an IDE like eclipse. Could anyone tell me how to do it?? thkns in advance.. n btw this is the error..
.Example: Send message from a serial gsm modem.
SMSLib: A Java API library for sending and receiving SMS via a GSM modem or other supported gateways.
This software is distributed under the terms of the Apache v2.0 License.
Web Site:
Version: 3.5.2
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre6\bin\awt.dll: The specified procedure could not be found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at Source)
at Method)
at java.awt.Toolkit.loadLibraries(Unknown Source)
at java.awt.Toolkit.<clinit>(Unknown Source)
at java.awt.Color.<clinit>(Unknown Source)
at org.apache.log4j.lf5.LogLevel.<clinit>(
at org.apache.log4j.lf5.LF5Appender.getDefaultInstance(
at org.apache.log4j.lf5.LF5Appender.<init>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(
at org.apache.log4j.helpers.OptionConverter.instantiateByKey(
at org.apache.log4j.PropertyConfigurator.parseAppender(
at org.apache.log4j.PropertyConfigurator.parseCategory(
at org.apache.log4j.PropertyConfigurator.configureRootCategory(
at org.apache.log4j.PropertyConfigurator.doConfigure(
at org.apache.log4j.PropertyConfigurator.doConfigure(
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(
at org.apache.log4j.LogManager.<clinit>(
at org.apache.log4j.Logger.getLogger(
at org.smslib.helper.Logger.<init>(
at org.smslib.helper.Logger.<clinit>(
at org.smslib.Service.listSystemInformation(
at org.smslib.Service.initializeService(
at org.smslib.Service.<init>(
at org.smslib.Service.<clinit>(
at in.msgin.SendSMS.doIt(
at in.msgin.SendSMS.main(
Paul Clapham

Joined: Oct 14, 2005
Posts: 19553

You are making a common beginner mistake. Because you are writing a program which uses a feature which you don't quite understand yet, you assume that the problem you are having must have something to do with that feature.

And that assumption makes you look in the wrong place for the problem. Let's have a look at the stack trace which you posted, reading from the bottom up:

at in.msgin.SendSMS.doIt(

This is your code calling the "doIt" method.

at org.smslib.helper.Logger.<clinit>(

This method calls some things which load the Logger class, also part of the smslib package.

at org.apache.log4j.Logger.getLogger(

... which in turn tries to get a Logger which is part of log4j. Going farther down the stack (which is farther up in the printed version)...

at org.apache.log4j.lf5.LogLevel.<clinit>(

The log4j initialization is trying to load a LogLevel.

at java.awt.Color.<clinit>(Unknown Source)

And to do that it tries to load the java.awt.Color class.

Now, if you thought your problem was something to do with SMS, you wouldn't notice that. But if you just try to read the stack trace and find out what the problem was, you would have to ask yourself why log4j would need to be using a Color object as a log level. And then you would go and look at your log4j configuration to see what was up with that.

mayank pandey

Joined: Nov 24, 2011
Posts: 5
yes you are right n thanks for help. Resolved. But Now i am stuck with another prblm. It couldnt identify the port but when I am running with establish serial communication. this is what its showing..

Example: Send message from a serial gsm modem.
SMSLib: A Java API library for sending and receiving SMS via a GSM modem or other supported gateways.
This software is distributed under the terms of the Apache v2.0 License.
Web Site:
Version: 3.5.2
1 2012-06-24 01:50:08,764 [main] INFO org.smslib.Service - SMSLib: A Java API library for sending and receiving SMS via a GSM modem or other supported gateways.
This software is distributed under the terms of the Apache v2.0 License.
Web Site:
9 2012-06-24 01:50:08,772 [main] INFO org.smslib.Service - Version: 3.5.2
10 2012-06-24 01:50:08,773 [main] INFO org.smslib.Service - JRE Version: 1.6.0_21
16 2012-06-24 01:50:08,779 [main] INFO org.smslib.Service - JRE Impl Version: 17.0-b17
16 2012-06-24 01:50:08,779 [main] INFO org.smslib.Service - O/S: Windows 7 / x86 / 6.1
24 2012-06-24 01:50:08,787 [main] DEBUG org.smslib.threading.AServiceThread - Initialized.
28 2012-06-24 01:50:08,791 [main] INFO org.smslib.queues.DefaultQueueManager - Queue directory not defined. Queued messages will not be saved to filesystem.
29 2012-06-24 01:50:08,792 [NotifyQueueManager] DEBUG org.smslib.threading.AServiceThread - Running...
29 2012-06-24 01:50:08,792 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager running...
30 2012-06-24 01:50:08,793 [main] DEBUG org.smslib.threading.AServiceThread - Initialized.
31 2012-06-24 01:50:08,794 [DelayQueueManager] DEBUG org.smslib.threading.AServiceThread - Running...
32 2012-06-24 01:50:08,795 [DelayQueueManager] DEBUG org.smslib.queues.AbstractQueueManager$DelayQueueManager - DelayQueueManager running...
32 2012-06-24 01:50:08,795 [main] DEBUG org.smslib.threading.AServiceThread - Initialized.
37 2012-06-24 01:50:08,800 [Thread-4] INFO org.smslib.modem.ModemGateway - GTW: modem.com1: Starting gateway, using Generic AT Handler.
37 2012-06-24 01:50:08,800 [Thread-4] INFO org.smslib.modem.SerialModemDriver - GTW: modem.com1: Opening: COM21 @9600
41 2012-06-24 01:50:08,804 [WatchDog] DEBUG org.smslib.threading.AServiceThread - Running...
69 2012-06-24 01:50:08,832 [Thread-4] INFO org.smslib.modem.SerialModemDriver - GTW: modem.com1: Closing: COM21 @9600
1038 2012-06-24 01:50:09,801 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager end...
1038 2012-06-24 01:50:09,801 [DelayQueueManager] DEBUG org.smslib.queues.AbstractQueueManager$DelayQueueManager - DelayQueueManager end...
1138 2012-06-24 01:50:09,901 [NotifyQueueManager] DEBUG org.smslib.threading.AServiceThread - Running...
1138 2012-06-24 01:50:09,901 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager running...
1238 2012-06-24 01:50:10,001 [WatchDog] DEBUG org.smslib.threading.AServiceThread - Stopped.
1238 2012-06-24 01:50:10,001 [main] INFO org.smslib.modem.ModemGateway - GTW: modem.com1: Stopping gateway...
1239 2012-06-24 01:50:10,002 [main] INFO org.smslib.modem.SerialModemDriver - GTW: modem.com1: Closing: COM21 @9600
1239 2012-06-24 01:50:10,002 [main] INFO org.smslib.modem.ModemGateway - GTW: modem.com1: Gateway stopped.
1240 2012-06-24 01:50:10,003 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager end...
1340 2012-06-24 01:50:10,103 [NotifyQueueManager] DEBUG org.smslib.threading.AServiceThread - Running...
1340 2012-06-24 01:50:10,103 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager running...
1341 2012-06-24 01:50:10,104 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager - NotifyQueueManager end...
1439 2012-06-24 01:50:10,202 [NotifyQueueManager] DEBUG org.smslib.threading.AServiceThread - Stopped.
org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.NoSuchPortException
at org.smslib.modem.SerialModemDriver.connectPort(
at org.smslib.modem.AModemDriver.connect(
at org.smslib.modem.ModemGateway.startGateway(
at org.smslib.Service$
subject: Problem related smslib api