1

It's being 2 days I am trying to configure smslib on my computer and I always got the exception below while trying to execute the sample code (SendMessage) contained in the zip file :

log4j:WARN No appenders could be found for logger (smslib).
   log4j:WARN Please initialize the log4j system properly.
   log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
   Exception in thread "Thread-3" java.lang.ExceptionInInitializerError
    at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:69)
    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:276)
   Caused by: java.lang.RuntimeException: CommPortIdentifier class not found
    at org.smslib.helper.CommPortIdentifier.<clinit>(CommPortIdentifier.java:76)
    ... 4 more

I have done everything asked on the smslib web site, I have read all the post related to the same error, I have also configured the JAVA_HOME path, but I steel get the same error. I am working on Windows 7, with Eclipse Juno and the JDK 7. Please can someone help try to fix this issue. And one more thing; is there another lib we can use instead of smslib?

Thanks

Harry Coder
  • 2,429
  • 2
  • 28
  • 32

1 Answers1

5

It fine now, I guess it was due to the fact that my eclipse was configured with the jre path instead of the JDK path. I put the required files in the jre's folders and it work fine.

Thank you very much !

Harry Coder
  • 2,429
  • 2
  • 28
  • 32
  • 1
    Had the same problem, moved my smslib application to a new PC - just couldn't find it. Then I realized I had the jre configured instead of jdk as default java environment. Thanks – arnehehe Oct 22 '14 at 08:28
  • Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.smslib.Service – dr Chandra Kant Sharma Apr 30 '20 at 14:51