4

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
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
Ishan
  • 4,008
  • 32
  • 90
  • 153

1 Answers1

2

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.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • the port to which iv connected my gsm phone,am using gprs service on d sam devise...is it because of dat??? – Ishan Oct 18 '09 at 18:06
  • friend... bt the 2nd error is unsolved!!plz help to sort m out wid d 2nd error...thnx – Ishan Oct 18 '09 at 18:12
  • sorrry... still its givin same errors..i placed d log4j.properties file in C:\Program Files\Java\jdk1.6.0_16\jre\lib ..but still am getin sam pbm – Ishan Oct 18 '09 at 18:20
  • 1
    @duffymo: the port in question is a serial port. Note the javax.comm package. – erickson Oct 18 '09 at 19:10
  • Who's going around and downvoting two year old answers that have been accepted? – duffymo Dec 02 '11 at 16:48