Am 14.03.12 16:07 schrieb "TheJBoss" unter <jbraat...@gmail.com>:

>I am still working on option [2] .
>
>When I attempt to register the exception listener[3], I get the exception
>below.  Is there a special way of registering the listener for a WAS7 MQ
>ConnectionFactory?
>
>
><bean id="smlc"
>class="org.springframework.jms.listener.SimpleMessageListenerContainer">       
>               <property name="connectionFactory" ref="connectionFactoryJndi" 
> />       
>               <property name="destinationName" value="CUS.SERVER.REQUEST" />
></bean>

Just define a bean of yours implementing javax.jms.ExceptionListener:

     <bean id="myExceptionListener" class="com.my.ExceptionListener" />


Which would for example just log the thrown JMSException as error.
 
And then inject it on your jms bean:

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
...
   <property name="exceptionListener" ref="myExceptionListener" />
        </bean>



>
>
><property name="exceptionListener" ref="smlc" />
>
>[3/14/12 10:04:28:329 CDT] 00000024 ContextLoader E
>org.springframework.web.context.ContextLoader initWebApplicationContext
>Context initialization failed
>                  
>org.springframework.beans.factory.BeanCreationException: Error creating
>bean
>with name 'smlc' defined in ServletContext resource
>[/WEB-INF/applicationContext.xml]: Invocation of init method failed;
>nested
>exception is org.springframework.jms.IllegalStateException: Method
>setExceptionListener not permitted; nested exception is
>javax.jms.IllegalStateException: Method setExceptionListener not permitted
>       at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto
>ry.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Camel-JMS-Request-Reply-with-Websphere-t
>p5095847p5565080.html
>Sent from the Camel - Users mailing list archive at Nabble.com.


Reply via email to