3 Replies Latest reply on Dec 23, 2010 3:16 AM by tde

    CommunicationException while using JNDI template in JMS Consumer.

    divakar

      I am getting the following exception, and this is my configuration

       

       

      <jms:consumer service="aaa:MyConsumerServiceTest"

                        endpoint="jms"

                        targetService ="IncidentOutbound"

                        connectionFactory="#connectionFactory"

                        destinationResolver="#jmsDestinationResolver"

                        destinationName ="xxx.Destination"

                        pubSubDomain = "true"

                        subscriptionDurable="true"

                        clientId = "fuse.bridge.tester1112"

                        durableSubscriptionName = "fuse.bridge.app.tester1112"

                        />

       

       

          <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">

           <property name="environment">

               <props>

           <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>

           <prop key="java.naming.provider.url">t3://xxxx.xxxx.com:XXXX</prop>

      </props>

           </property>

          </bean>

       

       

          <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">

            <property name="jndiTemplate" ref="jndiTemplate" />

            <property name="jndiName">

              <value>JMSConnectionFactory</value>

            </property>

          </bean>

       

          <bean id="jmsDestinationResolver"

           class="org.springframework.jms.support.destination.JndiDestinationResolver">

           <property name="jndiTemplate" ref="jndiTemplate" />

          </bean>

       

       

       

          <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

       

       

       

      </beans>

       

       

      A sample java progam with the same JMS configuration is working fine, were as this throwing exception on the same machine,

       

      Exception:

       

      Cannot resolve reference to bean 'connectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in URL bundleentry://212.fwk27263487/META-INF/spring/xbean.xml: Invocation of init method failed; nested exception is javax.naming.CommunicationException Root exception is java.net.ConnectException: t3://xxxx.xxxx.xxxx.com:XXXX: Bootstrap to xxxx.xxxx.xxxx.com/xx.xx.xx.xx:XXXX failed. It is likely that the remote side declared peer gone on this JVM

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

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

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

      at java.security.AccessController.doPrivileged(Native Method)

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

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

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

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

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

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

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

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

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)

      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)

      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)

      at java.lang.Thread.run(Thread.java:619)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in URL bundleentry://212.fwk27263487/META-INF/spring/xbean.xml: Invocation of init method failed; nested exception is javax.naming.CommunicationException Root exception is java.net.ConnectException: t3://xxxx.xxxx.xxxx.com:XXXX: Bootstrap to xxxx.xxxx.xxxx.com/xx.xx.xx.xx:XXXX failed. It is likely that the remote side declared peer gone on this JVM

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

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

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

      at java.security.AccessController.doPrivileged(Native Method)

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

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

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

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

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

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

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

      ... 20 more

      Caused by: javax.naming.CommunicationException Root exception is java.net.ConnectException: t3://xxxx.xxxx.xxxx.com:XXXX: Bootstrap to xxxx.xxxx.xxxx.com/xx.xx.xx.xx:XXXX failed. It is likely that the remote side declared peer gone on this JVM

      at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)

      at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:783)

      at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:367)

      at weblogic.jndi.Environment.getContext(Environment.java:315)

      at weblogic.jndi.Environment.getContext(Environment.java:285)

      at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)

      at org.apache.servicemix.naming.OSGiInitialContextFactoryBuilder.createContext(OSGiInitialContextFactoryBuilder.java:179)

      at org.apache.servicemix.naming.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:92)

      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

      at javax.naming.InitialContext.init(InitialContext.java:223)

      at javax.naming.InitialContext.<init>(InitialContext.java:197)

      at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:137)

      at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:104)

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

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

      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:200)

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

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

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

      ... 30 more

      Caused by: java.net.ConnectException: t3://xxxx.xxxx.xxxx.com:XXXX: Bootstrap to xxxx.xxxx.xxxx.com/xx.xx.xx.xx:XXXX failed. It is likely that the remote side declared peer gone on this JVM

      at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:203)

      at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)

      at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:352)

      ... 50 more

      Caused by: java.rmi.ConnectException: Bootstrap to xxxx.xxxx.xxxx.com/xx.xx.xx.xx:XXXX failed. It is likely that the remote side declared peer gone on this JVM

      at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:328)

      at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)

      at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)

      at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:225)

      at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:188)