What steps will reproduce the problem?
1. Include typica and log4j.xml in a jar.
What is the expected output? What do you see instead?
Expect no error, but see:
I get the following:
ROOT CAUSE:
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:363)
at
com.xerox.amazonws.tools.LoggingConfigurator.configureLogging(Logging
Configurator.java:47)
at
com.xerox.amazonws.sqs.QueueService.<clinit>(QueueService.java:52)
at
com.xerox.amazonws.sqs.SQSUtils.getQueueService(SQSUtils.java:81)
at
com.xerox.amazonws.sqs.SQSUtils.connectToQueue(SQSUtils.java:60)
Please provide any additional information below.
The fix is to comment out the file stuff:
If you don't use File in LoggingConfigurator this will go away, eg:
public class LoggingConfigurator {
private static boolean loggingConfigured = false;
private static final String LOGGER_CONFIG = "Log4j.xml";
public static Logger configureLogging(Class callingClass) {
if (!loggingConfigured) {
URL configFileURL =
callingClass.getClassLoader().getResource(LOGGER_CONFIG);
if (configFileURL == null){
System.err.println("The log4j configuration file
\""+LOGGER_CONFIG+
"\" was not found on the classpath.");
}
/*File configFile = null;
try {
configFile = new File(configFileURL.toURI());
}catch (URISyntaxException e) {
System.err.println("Log4J config file URL "+configFileURL+
" couldn't be converted to a URI.");
e.printStackTrace(System.err);
}*/
DOMConfigurator.configureAndWatch(configFileURL.toString());
loggingConfigured = true;
System.out.println("\n\nLogging initial configuration complete
according to file "+configFileURL);
}
System.out.println("Log4j logger created.");
return Logger.getLogger(callingClass.getName());
}
}
Original issue reported on code.google.com by treeder on 31 May 2007 at 9:22
Original issue reported on code.google.com by
treeder
on 31 May 2007 at 9:22