Announcement Announcement Module
No announcement yet.
"Occasional" JMS NoSuchBeanDefinitionException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Occasional" JMS NoSuchBeanDefinitionException

    Hi we are using weblogic 8.1 and use spring framework within EJB to send JMS messages. This works fine. However, we occasionally encounter NoSuchBeanDefinitionException. No idea why this would occur.

    Thanks for your help.

    xml file:

    <bean id="toComplianceReqQueue" class="org.springframework.jms.core.JmsTemplate102 " lazy-init="true">
    <property name="connectionFactory">
    <ref bean="jmsQueueConnectionFactory"/>
    <property name="destinationResolver">
    <ref bean="jmsDestinationResolver"/>
    <property name="pubSubDomain">
    <property name="defaultDestinationName">

    Java code:

    private void sendComplianceMessage(String complianceMessage)
    throws ComplianceUnavailableException {
    // Use JMS framework to send a request
    CommonMessageUtility lUtil = CommonMessageUtility.getInstance();
    try {
    lUtil.setupAppContext((ApplicationContext) getBeanFactory());
    } catch (BeansException e) {
    "There is an error at initializing the settings for messaging.Either the compliance message destinations are down or unreachable",
    JmsTemplate102 lSender = (JmsTemplate102) JMSContext.getInstance().getBean(aDestination);
    lSender.convertAndSend(aSendObject); <------ throws exception


    org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'toComplianceReqQueue' is defined
    at istableBeanFactory.getBeanDefinition(DefaultListab
    at BeanFactory.getMergedBeanDefinition(AbstractBeanFa
    at BeanFactory.getBean(
    at BeanFactory.getBean(
    at ationContext.getBean(AbstractApplicationContext.ja va:555)
    at tBean(
    at com.wellmanage.investsys.jms.framework.CommonMessa geUtility.send(
    at com.wellmanage.investsys.cci.server.request.Reques tManagerBean.sendComplianceMessage(RequestManagerB
    at com.wellmanage.investsys.cci.server.request.Reques tManagerBean.checkBasket( 45)
    at com.wellmanage.investsys.cci.server.request.Reques tManager_omf7ik_EOImpl.checkBasket(RequestManager_
    at com.wellmanage.investsys.cci.server.request.Reques tManager_omf7ik_EOImpl_WLSkel.invoke(Unknown Source)

  • #2
    Any chance that you might have crossed a classloader boundary in your application? I noticed the "cci" in the package hierarchy. I was wondering if the problem was sporadic not because it is random, but maybe you are sometimes invoking the code in different class loaders, one of which is consistently working, the other more infrequently used but never working.

    The only other thought is that you might want to turn up the logging or weave in extra logging on the bean factories to see if Spring saw your bean definition but was unable to register it for some reason.


    • #3
      Thanks for your help,Reid. I guess the issue was caused by some bad thread programming elsewhere. Your idea of ClassLoader not working seems to fit this !


      • #4
        NoSuchBeanDefinitionException - Spring Container

        Hello rkr,

        Could you please let me know what did you find out regarding your issue regarding the NoSuchBeanDefinitionException ? I am facing a similar issue intermittently and I do have multiple threads accessing the Spring Container (in ApplicationContext) through a Transaction Manager utility class. When I have one thread using one instance of TransactionManager there is no issue, but when I share the TransactionManager among multiple threads I get this issue.
        Last edited by Domarp_Rian; Jan 29th, 2007, 09:21 AM.


        • #5
          I still haven't found a solution. Let me know how it works for you


          • #6
            I haven't found the real cause or solution. I could not reproduce it later on. But I believe my issue also is with regards to some threading raise conditions. I am using ThreadLocal extensively for session, transaction management and this seem to be an issue when multiple threads are trying to use the same transaction management utility instance.