Exception javax.naming.NamingException: Failed to connect to any server. Servers tried: [remote://localhost:4447]

Solution Unverified - Updated -

Issue

  • User has Spring based application using HornetQ. User added the below dependencies in pom.xml :
<dependency>
        <groupId>org.jboss.xnio</groupId>
    <artifactId>xnio-nio</artifactId>
    <version>3.0.10.GA-redhat-1</version>
</dependency>
         <dependency>
  <groupId>org.jboss</groupId>
  <artifactId>jboss-remote-naming</artifactId>
  <version>1.0.8.Final-redhat-1</version>
</dependency>

After adding xnio-ni dependencies. user is getting below exception

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [JMSMessageTest.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Failed to connect to any server. Servers tried: [remote://localhost:4447]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    .....
Caused by: javax.naming.NamingException: Failed to connect to any server. Servers tried: [remote://localhost:4447]
    at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:213)
    at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:144)
    .....
  • There are 2 things user wants to mention here:
  1. send and receive from queue works fine if user don't have these dependencies in pom and just add the jboss-home/bin/client/jboss-client.jar to classpath. user really wish it will work by having it as a maven dependency.
  2. When user deploy the listener as a war, user can send an object to the queue fine. But the listener doesn't seem like listening.it doesn't receive the object until flush the queue. Anything missing ?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.3.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.