Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.jboss.naming.remote.client.InitialContextFactory maven dependancy

Tags:

java

maven

jboss

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.

like image 888
Surendran Duraisamy Avatar asked Dec 16 '22 05:12

Surendran Duraisamy


1 Answers

Use this dependency:

<dependency>
  <groupId>org.jboss</groupId>
  <artifactId>jboss-remote-naming</artifactId>
  <version>1.0.7.Final</version>
</dependency>
like image 150
Fabricio Lemos Avatar answered May 11 '23 00:05

Fabricio Lemos