Exceptions occur in Spring based application using HornetQ

Solution Verified - Updated -

Issue

  • User has Spring based application using HornetQ instead of ActiveMQ. For the remote client JNDI look up, user is using org.jboss.naming.remote.client.InitialContextFactory. When user runs the program from eclipse->Run as java application it works after user provides jboss/bin/client/jboss-client.jar in the classpath. Instead user wants to add a maven dependency. user added the below:
<dependency>
       <groupId>org.jboss</groupId>
       <artifactId>jboss-remote-naming</artifactId>
       <version>1.0.8.Final-redhat-1</version>
</dependency>
  • User get the below exception :
Caused by: javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.IllegalArgumentException: No matching XNIO provider found]
    at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:51)
    at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:152)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
    at javax.naming.InitialContext.init(InitialContext.java:242)
    at javax.naming.InitialContext.<init>(InitialContext.java:216)
    at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)
    at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
......
Caused by: java.lang.IllegalArgumentException: No matching XNIO provider found
    at org.xnio.Xnio.doGetInstance(Xnio.java:192)
    at org.xnio.Xnio.getInstance(Xnio.java:146)
    at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:73)
    at org.jboss.naming.remote.client.EndpointCache.get(EndpointCache.java:44)
    at org.jboss.naming.remote.client.InitialContextFactory.createEndpoint(InitialContextFactory.java:226)
    at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateEndpoint(InitialContextFactory.java:207)

.....
javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.IllegalArgumentException: No matching XNIO provider found]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
......

Environment

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content