简体   繁体   中英

log4j:WARN Please initialize the log4j system properly

How to resolve these following errors... Am I missing some jar file???

log4j:WARN No appenders could be found for logger (smslib).
    log4j:WARN Please initialize the log4j system properly.



org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.PortInUseException: Port currently owned by Unknown Windows Application
        at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:97)
        at org.smslib.modem.AModemDriver.connect(AModemDriver.java:110)
        at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:158)
        at org.smslib.Service$1Starter.run(Service.java:252)


WaitCommEvent: Error 31
WaitCommEvent: Error 31

My first thought was that your log4j XML or properties file wasn't picked up when log4j initialized. Make sure one of them is in your CLASSPATH.

A more careful reading of your exception suggests that you're trying to use a port that a Windows app already has taken control of.

Do a "netstat -a" to see what ports are currently in use and what's attached to them. Pick another one for your log4j appender to use.

Have you written a custom appender to write log messages to SMS? Something else is using the port you've chosen.

EDIT:

The jre/lib directory is not in the CLASSPATH. You should not be putting any of your code in that directory. It should end up in the directory where your compiled .class files are written to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM