Announcement Announcement Module
No announcement yet.
Not instatiating jms beans Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not instatiating jms beans

    I am developing a jms resource adapter for the mobicents server.when I try to activate the resource adaptor entity it gave me the following error.

    11:15:23,430 ERROR [STDERR] Jan 24, 2008 11:15:23 AM org.springframework.core.CollectionFactory <clinit>
    INFO: JDK 1.4+ collections available
    11:15:23,856 ERROR [STDERR] Jan 24, 2008 11:15:23 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [application-context.xml]
    11:15:24,312 ERROR [STDERR] Jan 24, 2008 11:15:24 AM hableApplicationContext refreshBeanFactory
    INFO: Bean factory for application context [ plicationContext;hashCode=8436776]: istableBeanFactory defining beans [connectionFactory,receiverQueue1,sender1,sender2,s enderQueue1,senderQueue2,jmsTemplate]; root of BeanFactory hierarchy
    11:15:24,340 ERROR [STDERR] Jan 24, 2008 11:15:24 AM ationContext refresh
    INFO: 7 beans defined in application context [ plicationContext;hashCode=8436776]
    11:15:24,527 ERROR [STDERR] Jan 24, 2008 11:15:24 AM ationContext initMessageSource
    INFO: Unable to locate MessageSource with name 'messageSource': using default [ [email protected]]
    11:15:24,535 ERROR [STDERR] Jan 24, 2008 11:15:24 AM ationContext initApplicationEventMulticaster
    INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicatio [email protected]]
    11:15:24,543 ERROR [STDERR] Jan 24, 2008 11:15:24 AM istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in factory [ istableBeanFactory defining beans [connectionFactory,receiverQueue1,sender1,sender2,s enderQueue1,senderQueue2,jmsTemplate]; root of BeanFactory hierarchy]
    11:15:25,088 ERROR [STDERR] Jan 24, 2008 11:15:25 AM ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in { ListableBeanFactory defining beans [connectionFactory,receiverQueue1,sender1,sender2,s enderQueue1,senderQueue2,jmsTemplate]; root of BeanFactory hierarchy}
    11:15:25,102 INFO [STDOUT] Exception was caughtError creating bean with name 'connectionFactory' defined in class path resource [application-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPoolFactory

    this happens when executing the following code segment.

    AbstractApplicationContext context = new FileSystemXmlApplicationContext(new String[]{"/"+
    template = (JmsTemplate) context.getBean("jmsTemplate");
    org.springframework.jms.listener.DefaultMessageLis tenerContainer container = new DefaultMessageListenerContainer();
    container.setConnectionFactory((ConnectionFactory) context.getBean("connectionFactory"));
    container.setDestination((Destination) context.getBean("receiverQueue1"));

    the application-context is as follows

    <bean id="connectionFactory" class="org.apache.activemq.pool.PooledConnectionFa ctory" destroy-method="stop">
    <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQConnectionFacto ry">
    <property name="brokerURL" value="tcp://localhost:61616"/>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="deliveryMode" value="2"/>
    <property name="deliveryPersistent" value="true"/>

    <bean id="receiverQueue1" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value=""/>

    if anyone knows the reason for this,pls reply

    thanks in advance

  • #2
    Originally posted by lahiruts View Post
    java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPoolFactory
    It seems that commons-pool.jar is missing in your classpath. You can find it in the lib\jakarta-commons subfolder of your Spring (-with dependencies) installation.



    • #3
      Thanks Andreas.
      But I have the commons-pool jar in the class-path.This only happens when this is deployed in mobicents server.Sometimes this may be occured because of the MessageListner and the ResourceAdaptor functionalities are given to a single class.



      • #4
        Do you have the jar more than once in the classpath?
        In any case this seems to be a classloading issue then. I would check the classloading strategy of your server and see whether that matches your deployment.