aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes IPModemgateway - SMSLib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "IPModemgateway - SMSLib" Watch "IPModemgateway - SMSLib" New topic
Author

IPModemgateway - SMSLib

Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 265

Hi,

I am using the example code given in smslib for ipmodem, but it shows a null pointer exception at the main function and a connection timed out. I cant figure out what is the problem. I have added the code below and the output too.




Example: Send message from a ip 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.3
0 [main] INFO smslib - 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
1 [main] INFO smslib - Version: 3.5.3
1 [main] INFO smslib - JRE Version: 1.7.0_21
1 [main] INFO smslib - JRE Impl Version: 23.7-b01
1 [main] INFO smslib - O/S: Linux / i386 / 3.5.0-34-generic
5 [main] INFO smslib - Queue directory not defined. Queued messages will not be saved to filesystem.
7 [main] DEBUG smslib - Initialized.
7 [main] DEBUG smslib - Initialized.
7 [NotifyQueueManager] DEBUG smslib - Running...
7 [NotifyQueueManager] DEBUG smslib - NotifyQueueManager running...
8 [main] DEBUG smslib - Initialized.
9 [DelayQueueManager] DEBUG smslib - Running...
9 [DelayQueueManager] DEBUG smslib - DelayQueueManager running...
10 [WatchDog] DEBUG smslib - Running...
10 [Thread-3] INFO smslib - GTW: ipm: Starting gateway, using Generic AT Handler.
10 [Thread-3] INFO smslib - GTW: ipm: Opening: My ip @5555
15010[WatchDog] DEBUG smslib - Running...
30010[WatchDog] DEBUG smslib - Running...
45011[WatchDog] DEBUG smslib - Running...
60011[WatchDog] DEBUG smslib - Running...
63143[Thread-3] INFO smslib - GTW: ipm: Closing: My ip @5555
64018[NotifyQueueManager] DEBUG smslib - NotifyQueueManager end...
64018[DelayQueueManager] DEBUG smslib - DelayQueueManager end...
64118[NotifyQueueManager] DEBUG smslib - Running...
64118[NotifyQueueManager] DEBUG smslib - NotifyQueueManager running...
64218[WatchDog] DEBUG smslib - Stopped.
64219[main] INFO smslib - GTW: ipm: Stopping gateway...
64219[main] INFO smslib - GTW: ipm: Closing: My ip @5555
64219[main] INFO smslib - GTW: ipm: Gateway stopped.
64219[NotifyQueueManager] DEBUG smslib - NotifyQueueManager end...
64319[NotifyQueueManager] DEBUG smslib - Running...
64319[NotifyQueueManager] DEBUG smslib - NotifyQueueManager running...
64319[NotifyQueueManager] DEBUG smslib - NotifyQueueManager end...
64419[NotifyQueueManager] DEBUG smslib - Stopped.
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:168)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
at org.smslib.modem.IPModemDriver.connectPort(IPModemDriver.java:95)
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:277)
java.lang.NullPointerException
at test.Ipmodem.doIt(Ipmodem.java:54)
at test.Ipmodem.main(Ipmodem.java:75)
Exception in thread "main" java.lang.NullPointerException
at test.Ipmodem.main(Ipmodem.java:78)
Java Result: 1


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
--- Martin Fowler
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IPModemgateway - SMSLib