log4j.xml when included in a jar causes an ExceptionInInitializationError

38 views
Skip to first unread message

Travis

unread,
May 11, 2007, 4:02:05 AM5/11/07
to typica
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)


If you don't use File in LoggingConfigurator this will go away, eg:

/*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());

Commented out all the File stuff and it works fine now.

Also another good reason to remove the log4j dependency and to leave
the logging config up to the user.

dkav...@gmail.com

unread,
May 14, 2007, 1:57:10 PM5/14/07
to typica
Including log4j.xml in your classes directory (or simply in your
classpath) should solve the problem. I'll go look at the
LoggingConfigurator some more.

David

Travis

unread,
May 31, 2007, 12:08:29 PM5/31/07
to typica
Any chance this was fixed in your latest release?

Travis

dkav...@gmail.com

unread,
May 31, 2007, 2:57:28 PM5/31/07
to typica
Travis, I'm sorry, but I was busy with the new SQS support. I do
intend to look at logging again (likely using commons.logging) and
look into the logging configurator. I'm pretty busy at work these
days. It is on my list! Feel free to throw stuff in the issue tracker
because I do check that.

David

Travis Reeder

unread,
May 31, 2007, 8:51:48 PM5/31/07
to typ...@googlegroups.com
No worries. I posted the fix in the issue tracker. Should take all of about 10 seconds to apply.  ;)

Travis
Reply all
Reply to author
Forward
0 new messages