当我运行我的程序时,使用smslib在netbeans上运行时工作正常,但是当我生成jar文件并运行它时,控制台会向我显示此错误。有关如何解决它的任何想法?非常感谢您的帮助。
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-6" 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:277)
Caused by: java.lang.RuntimeException: CommPortIdentifier class not found
at org.smslib.helper.CommPortIdentifier.<clinit>(CommPortIdentifier.java:76)
... 4 more
答案 0 :(得分:0)
smslib
库不在运行时类路径上,或者运行时类路径未正确设置。