Org.jboss.naming.remote.client.InitialContextFactory maven dependency

advertisements

I am using following code in my program, which is jndi lookup for jboss 7 client.

public static Context getInitialContext() throws NamingException {
      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY,
              "org.jboss.naming.remote.client.InitialContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "remote://localhost:4447");
      return new InitialContext(properties);
}

when I run my program from eclipse->Run as java application it works fine provided I give jboss/bin/client/jboss-client.jar in my classpath.

I need to include the same jar in my maven dependency.

What is the maven dependancy pom for "org.jboss.naming.remote.client.InitialContextFactory" or where can I find the dependency pom.

Thanks.


Use this dependency:

<dependency>
  <groupId>org.jboss</groupId>
  <artifactId>jboss-remote-naming</artifactId>
  <version>1.0.7.Final</version>
</dependency>