AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

log4j and JMSAppender

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Fri Apr 21, 2006 12:12 pm    Post subject: log4j and JMSAppender Reply with quote



I've got a problem with configuration log4j with JMSAppender:

log4j.properties:

log4j.appender.jms=org.apache.log4j.net.JMSAppender
# I'm not sure for line below, is it right?
log4j.appender.jms.InitialContextFactoryName=com.sun.jndi.fscontext.RefFSContextFactory
log4j.appender.jms.ProviderURL=file:/E:/JNDI-Directory
log4j.appender.jms.TopicBindingName=jms/TopicJNDI
log4j.appender.jms.TopicConnectionFactoryBindingName=jms/ConnectionFactory
log4j.appender.jms.layout=org.apache.log4j.PatternLayout
log4j.appender.jms.layout.ConversionPattern=%d{ISO8601} %-5p %c %x -
%m%n

piece of my web.xml:
<resource-env-ref>
<description>ConnectionFactory</description>
<resource-env-ref-name>jms/ConnectionFactory</resource-env-ref-name>
<resource-env-ref-type>com.test.jms.ConnectionFactory</resource-env-ref-type>
</resource-env-ref>

and context.xml:
<Resource name="jms/ConnectionFactory" auth="Container"
type="com.test.jms.ConnectionFactory"
factory="com.sun.jndi.fscontext.RefFSContextFactory" />

and when I try to log something in my junit test, I have exception:
log4j:ERROR Error while activating options for appender named [jms].
java.lang.ClassCastException: javax.naming.Reference
at org.apache.log4j.net.JMSAppender.activateOptions(Unknown Source)
at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
...

I don't understand that problem, because my class ConnectionFactory
implements Referencable interface. It's my first day with jndi, jms and
log4j, please be patient for me :)

best regards
RoB
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.