Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8164677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:22:15+00:00 2026-06-06T19:22:15+00:00

I would like to know if someone knows why I can’t send sms with

  • 0

I would like to know if someone knows why I can’t send sms with my E226 3g modem. I have configured the example class, I setted modem model, PIN and Smsc number.

public class SendMessage
{
    public void doIt() throws Exception
    {
        OutboundNotification outboundNotification = new OutboundNotification();
        System.out.println("Example: Send message from a serial gsm modem.");
        System.out.println(Library.getLibraryDescription());
        System.out.println("Version: " + Library.getLibraryVersion());
        SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM4", 9600, "Huawei", "E226");
        gateway.setInbound(true);
        gateway.setOutbound(true);
        gateway.setSimPin("1010");
        // Explicit SMSC address set is required for some modems.
        // Below is for VODAFONE GREECE - be sure to set your own!
        gateway.setSmscNumber("+555181136200");
        Service.getInstance().setOutboundMessageNotification(outboundNotification);
        Service.getInstance().addGateway(gateway);
        Service.getInstance().startService();
        System.out.println();
        System.out.println("Modem Information:");
        System.out.println("  Manufacturer: " + gateway.getManufacturer());
        System.out.println("  Model: " + gateway.getModel());
        System.out.println("  Serial No: " + gateway.getSerialNo());
        System.out.println("  SIM IMSI: " + gateway.getImsi());
        System.out.println("  Signal Level: " + gateway.getSignalLevel() + " dBm");
        System.out.println("  Battery Level: " + gateway.getBatteryLevel() + "%");
        System.out.println();
        // Send a message synchronously.
        OutboundMessage msg = new OutboundMessage("+556199655944", "Hello from SMSLib!");
        Service.getInstance().sendMessage(msg);
        System.out.println(msg);
        // Or, send out a WAP SI message.
        //OutboundWapSIMessage wapMsg = new OutboundWapSIMessage("306974000000",  new URL("http://www.smslib.org/"), "Visit SMSLib now!");
        //Service.getInstance().sendMessage(wapMsg);
        //System.out.println(wapMsg);
        // You can also queue some asynchronous messages to see how the callbacks
        // are called...
        //msg = new OutboundMessage("309999999999", "Wrong number!");
        //srv.queueMessage(msg, gateway.getGatewayId());
        //msg = new OutboundMessage("308888888888", "Wrong number!");
        //srv.queueMessage(msg, gateway.getGatewayId());
        System.out.println("Now Sleeping - Hit <enter> to terminate.");
        System.in.read();
        Service.getInstance().stopService();
    }

    public class OutboundNotification implements IOutboundMessageNotification
    {
        public void process(AGateway gateway, OutboundMessage msg)
        {
            System.out.println("Outbound handler called from Gateway: " + gateway.getGatewayId());
            System.out.println(msg);
        }
    }

    public static void main(String args[])
    {
        SendMessage app = new SendMessage();
        try
        {
            app.doIt();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}

It outputs

run:
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: http://smslib.org
Version: 3.5.2
0      2012-06-28 19:08:32,652 [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: http://smslib.org
3      2012-06-28 19:08:32,655 [main] INFO  org.smslib.Service  - Version: 3.5.2
3      2012-06-28 19:08:32,655 [main] INFO  org.smslib.Service  - JRE Version: 1.7.0_05
5      2012-06-28 19:08:32,657 [main] INFO  org.smslib.Service  - JRE Impl Version: 23.1-b03
Exception in thread "Thread-3" java.lang.ExceptionInInitializerError
5      2012-06-28 19:08:32,657 [main] INFO  org.smslib.Service  - O/S: Windows 7 / amd64 / 6.1
8      2012-06-28 19:08:32,660 [main] DEBUG org.smslib.threading.AServiceThread  - Initialized.
8      2012-06-28 19:08:32,660 [NotifyQueueManager] DEBUG org.smslib.threading.AServiceThread  - Running...
8      2012-06-28 19:08:32,660 [NotifyQueueManager] DEBUG org.smslib.notify.NotifyQueueManager$NotificationQueueManager  - NotifyQueueManager running...
9      2012-06-28 19:08:32,661 [main] INFO  org.smslib.queues.DefaultQueueManager  - Queue directory not defined. Queued messages will not be saved to filesystem.
9      2012-06-28 19:08:32,661 [main] DEBUG org.smslib.threading.AServiceThread  - Initialized.
10     2012-06-28 19:08:32,662 [DelayQueueManager] DEBUG org.smslib.threading.AServiceThread  - Running...
10     2012-06-28 19:08:32,662 [DelayQueueManager] DEBUG org.smslib.queues.AbstractQueueManager$DelayQueueManager  - DelayQueueManager running...
10     2012-06-28 19:08:32,662 [main] DEBUG org.smslib.threading.AServiceThread  - Initialized.
    at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:69)
    at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
10     2012-06-28 19:08:32,662 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
    at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
11     2012-06-28 19:08:32,663 [Thread-3] INFO  org.smslib.modem.ModemGateway  - GTW: modem.com1: Starting gateway, using Huawei E226 AT Handler.
    at org.smslib.Service$1Starter.run(Service.java:276)
Caused by: java.lang.RuntimeException: CommPortIdentifier class not found
11     2012-06-28 19:08:32,663 [Thread-3] INFO  org.smslib.modem.SerialModemDriver  - GTW: modem.com1: Opening: COM4 @9600
    at org.smslib.helper.CommPortIdentifier.<clinit>(CommPortIdentifier.java:76)
    ... 4 more
15010  2012-06-28 19:08:47,662 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
30011  2012-06-28 19:09:02,663 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
45012  2012-06-28 19:09:17,664 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
60012  2012-06-28 19:09:32,664 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
75013  2012-06-28 19:09:47,665 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...
90014  2012-06-28 19:10:02,666 [WatchDog] DEBUG org.smslib.threading.AServiceThread  - Running...

That’s all I get for hours. Any idea why doesn’t work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:22:15+00:00Added an answer on June 6, 2026 at 7:22 pm

    You’re missing javax.comm. The situation with javax.comm on Windows is a bit of a mess, the smslib installation instructions suggest to use rxtx instead and point to Cloudhopper’s page for a Windows version. Get that library, add it as a dependency to your project and you should be all set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if someone knows how to make a function repeat
I would like to know if someone can help me to determine what steps
I would like to know if someone can point me any library or tutorial
i would like to know if there is an event for every time someone
i would like know some reference. I know i can googling it. but prefer
I would like to know, how can we change the SRC url for IFRAME
I would like to know, if I can get the background that is displayed
I would like to know how can i transform a .NET 4.0 VS 2010
Would like to know what a programmer should know to become a good at
Would like to know the c# code to actually retrieve the IP type: Static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.