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

  • Not instatiating jms beans

    hi!
    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 org.springframework.context.support.AbstractRefres hableApplicationContext refreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=8436776]: org.springframework.beans.factory.support.DefaultL 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 org.springframework.context.support.AbstractApplic ationContext refresh
    INFO: 7 beans defined in application context [org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=8436776]
    11:15:24,527 ERROR [STDERR] Jan 24, 2008 11:15:24 AM org.springframework.context.support.AbstractApplic ationContext initMessageSource
    INFO: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMess [email protected]]
    11:15:24,535 ERROR [STDERR] Jan 24, 2008 11:15:24 AM org.springframework.context.support.AbstractApplic 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 org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultL 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 org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in {org.springframework.beans.factory.support.Default 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[]{"/"+
    getClass().getResource("application-context.xml").getPath()});
    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"));
    container.setMessageListener(this);



    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>
    </property>
    </bean>

    <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>

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


    if anyone knows the reason for this,pls reply

    thanks in advance
    Lahiruts

  • #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.

    Regards,
    Andreas

    Comment


    • #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.

      regards,
      Lahiruts

      Comment


      • #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.

        Regards,
        Andreas

        Comment

        Working...
        X