logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adamides, Paul O" <padami...@paychex.com>
Subject Can't get basic Zeroconf example to work.
Date Tue, 20 Jan 2009 20:14:00 GMT
So I set up a simple java project to test out this chainsaw zeroconf
thing.
 
I'm using log4j 1.2.15.  My log4j.properties looks like this:
 
# Set root category priority
log4j.rootCategory=DEBUG, LOGFILE, CONSOLE, HUBAPPENDER

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x -
%m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=log/application.log
log4j.appender.LOGFILE.Append=false
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x -
%m%n

#Socket Hub Appender
log4j.appender.HUBAPPENDER=org.apache.log4j.net.ZeroConfSocketHubAppende
r
log4j.appender.HUBAPPENDER.Name=TestAppender

My test class looks like this:

package chainsawtest;

import java.io.IOException;

import javax.jmdns.JmDNS;
import javax.jmdns.impl.JmDNSImpl;

import org.apache.log4j.Logger;

public class ChainsawTest {
	
	private static final Logger LOG =
Logger.getLogger(ChainsawTest.class);
	/**
	 * @param args
	 * @throws InterruptedException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws
InterruptedException, IOException {
		for (int i = 0; i < 100; i++){
			LOG.info("===============================");
			Thread.sleep(5000);
		}
	}

}

Very simple and straight forward.

However, as soon as I run the app, I get the following Error:

java.lang.InstantiationError: javax.jmdns.JmDNS
	at
org.apache.log4j.net.Zeroconf4log4j.<clinit>(Zeroconf4log4j.java:23)
	at
org.apache.log4j.net.ZeroConfSocketHubAppender.activateOptions(ZeroConfS
ocketHubAppender.java:45)
	at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
	at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java
:133)
	at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java
:97)
	at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator
.java:689)
	at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator
.java:647)
	at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConf
igurator.java:544)
	at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.j
ava:440)
	at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.j
ava:476)
	at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConver
ter.java:471)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
	at org.apache.log4j.Logger.getLogger(Logger.java:118)
	at chainsawtest.ChainsawTest.<clinit>(ChainsawTest.java:15)

What gives?


-----------------------------------------
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer. 

Thank you. Paychex, Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message