I wrote a test case for JMSAppender that used ActiveMQ so I can show
you how to get it to work:
See:
https://issues.apache.org/bugzilla/show_bug.cgi?id=38513
specifically, putting the jndi.properties that is attached here:
https://issues.apache.org/bugzilla/attachment.cgi?id=17590
as an example, should get you started with AMQ (I love AMQ! :) )
On 12/02/2009, at 10:20 PM, Sylvester wrote:
Hi,
I've been trying to use Log4j with ActiveMQ. I have ActiveMQ running
on my system. To setup log4j I use:
JMSAppender appender= new JMSAppender();
appender.setName("JMSAppender");
appender.setTopicBindingName("topic");
appender.setTopicConnectionFactoryBindingName(""); //not
sure what is supposed to go here
appender.setLayout(patternLayout);
appender
.setInitialContextFactoryName
("org.apache.activemq.jndi.ActiveMQInitialContextFactory"); //is
this right?
appender.setURLPkgPrefixes(""); //not sure about this one
either
appender.setProviderURL( "tcp://localhost:61616");
appender.activateOptions();
The appender.activateOptions(); line gives me:
log4j:ERROR Error while activating options for appender named
[JMSAppender].
java.lang.NullPointerException
at javax.naming.InitialContext.getURLScheme(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown
Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.apache.log4j.net.JMSAppender.lookup(Unknown Source)
at org.apache.log4j.net.JMSAppender.activateOptions(Unknown Source)
at com.Main.main(Main.java:83)
How do I fix this?
Thanks,
Sylvester
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Paul Smith
Production Engineering Manager
Aconex
The easy way to save time and money on your project
696 Bourke Street, Melbourne,
VIC 3000, Australia
Tel: +61 3 9240 0200 Fax: +61 3 9240 0299
Email: [email protected] www.aconex.com
This email and any attachments are intended solely for the addressee.
The contents may be privileged, confidential and/or subject to
copyright or other applicable law. No confidentiality or privilege is
lost by an erroneous transmission. If you have received this e-mail in
error, please let us know by reply e-mail and delete or destroy this
mail and all copies. If you are not the intended recipient of this
message you must not disseminate, copy or take any action in reliance
on it. The sender takes no responsibility for the effect of this
message upon the recipient's computer system.