tags:

views:

3377

answers:

1

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
+1  A: 

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
the port to which iv connected my gsm phone,am using gprs service on d sam devise...is it because of dat???
thnx 4 reply.... n ya...i was missing log4j properties file...
So vote the answer up and accept it....it's part of your obligation here.
duffymo
friend... bt the 2nd error is unsolved!!plz help to sort m out wid d 2nd error...thnx
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
@duffymo: the port in question is a serial port. Note the javax.comm package.
erickson