[logback-user] JMSAppender NameNotFoundException

buzzterrier terry.jeske at gmail.com
Wed Jun 9 00:16:03 CEST 2010


I am trying to get the JMSAppender to work, without success

The producer app has the following appender

 <appender name="JMS" class="ch.qos.logback.classic.net.JMSQueueAppender">
    <InitialContextFactoryName>
      org.apache.activemq.jndi.ActiveMQInitialContextFactory
    </InitialContextFactoryName>
    <ProviderURL>tcp://xw8-025:61616</ProviderURL>
   
<QueueConnectionFactoryBindingName>ConnectionFactory</QueueConnectionFactoryBindingName>
    <QueueBindingName>metrics.queue</QueueBindingName>
  </appender>


The consumer app is wired for JMS using Spring:

<bean id="metricsMessageListener"
class="foo.bar.metrics.service.MetricsMessageListener"
	p:metricsService-ref="metricsServiceImpl"/>

<!-- and this is the message listener container -->
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="metricsDestination"/>
    <property name="messageListener" ref="metricsMessageListener" />

</bean>        

<bean id="metricsDestination"
class="org.apache.activemq.command.ActiveMQQueue">
	<constructor-arg index="0" value="metrics.queue"/>
</bean>
	
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory"
		p:brokerURL="tcp://xw8-025:61616" />
	
When I start the producer webapp I get:
15:01:24,571 |-ERROR in ch.qos.logback.classic.net.JMSQueueAppender[JMS] -
Could not find name [metrics.queue].
15:01:24,571 |-ERROR in ch.qos.logback.classic.net.JMSQueueAppender[JMS] -
Error while activating options for appender named [JMS].
javax.naming.NameNotFoundException: metrics.queue
        at javax.naming.NameNotFoundException: metrics.queue
        at      at
org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:225)
        at      at
javax.naming.InitialContext.lookup(InitialContext.java:392)
 

If I wire in a spring JMS template on the producer side, it connects to the
metrics.queue without issue. Kind of stumped. Back to using the DBAppender,
but was hoping that someone might have an idea.


-----
Buzzterrier

http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer... 
-- 
View this message in context: http://old.nabble.com/JMSAppender-NameNotFoundException-tp28823755p28823755.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list