0 Replies Latest reply on Sep 11, 2013 1:02 AM by moooneee

    Error in Tomcat application connect JBOSS messaging

    moooneee

      I have spring project running under Tomcat, it try to connect JBOSS messaging, I got an exception like [java.lang.InstantiationException: org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory ]

      Appreciate for any suggestion!!

       

      I have put the jboss-messaging.jar to Tomcat lib folder and here is the context.xml configuration:

      ----------------------------------------------------

          <Resource name="jms/ConnectionFactory" 

             auth="Container" 

             type="org.jboss.jms.server.connectionfactory.ConnectionFactory" 

             description="JMS Connection Factory" 

             factory="org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory" 

             brokerURL="jnp://135.27.205.220:1099" 

             brokerName="LocalActiveMQBroker"

             useAsyncSend="true"/>

      ----------------------------------------------------

       

      But I got error as below:

      ----------------------------------------------------

       

       

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory' defined in file [C:\AAOD6.0\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\RTASender\WEB-INF\classes\spring\appconfig\applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.InstantiationException: org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)

        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)

        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)

        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

        at org.apache.catalina.core.StandardService.start(StandardService.java:519)

        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

      Caused by: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.InstantiationException: org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory]

        at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:102)

        at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)

        at javax.naming.InitialContext.lookup(Unknown Source)

        at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)

        at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)

        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)

        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)

        at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)

        at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)

        at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)

        at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485)

        ... 27 more

      Caused by: java.lang.InstantiationException: org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory

        at java.lang.Class.newInstance0(Unknown Source)

        at java.lang.Class.newInstance(Unknown Source)

        at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:98)

        ... 48 more