I can't setup my jndi.properties to access remote EJBs on Jboss 5
<p>I'm trying to setup the Jboss server &quot;client&quot; (version 5.1.0) to use remote EJBs from another Jboss server (10.90.0.91), but I can't do this using a jndi.properties file on the Jboss client.</p>
<p>I can get the remote EJB using this simple code on my client:</p>
<pre><code>        InitialContext ctx = null;
        try {
            Hashtable&lt;String, String&gt; jndiProps = new Hashtable&lt;String, String&gt;();
            jndiProps.put(InitialContext.INITIAL_CONTEXT_FACTORY, &quot;org.jnp.interfaces.NamingContextFactory&quot;);
            jndiProps.put(InitialContext.PROVIDER_URL, &quot;jnp://10.90.0.91:1099&quot;);
            ctx = new InitialContext(jndiProps);
            return ctx.lookup(jndiName);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
</code></pre>
<p>This works fine.</p>
<p>Now I would like to setup the Jboss client with this properties. But if I edit the existent jndi.properties file localized on <code>server/{application}/conf/</code> from:</p>
<pre><code># DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
#
java.naming.factory.initial=org.jboss.iiop.naming.ORBInitialContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
</code></pre>
<p>To:</p>
<pre><code># DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
#
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://10.90.0.91:1099
</code></pre>
<p>I receive some errors when I start the Jboss client (apparently, I don't know what I'm doing :)):</p>
<pre><code>2016-08-19 10:17:41,645 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=HASessionStateService state=Create
javax.naming.NameAlreadyBoundException: Default
    at org.jnp.server.NamingServer.bind(NamingServer.java:209)
    at org.jnp.server.NamingServer.bind(NamingServer.java:167)
[...]

2016-08-19 10:17:42,767 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=ProfileServiceProxyFactory state=Create
javax.naming.NameAlreadyBoundException: ProfileService
    at org.jnp.server.NamingServer.bind(NamingServer.java:209)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[...]

2016-08-19 10:17:44,778 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss:service=ClientUserTransaction state=Create mode=Manual requiredState=Installed
javax.naming.NameAlreadyBoundException: UserTransaction
    at org.jnp.server.NamingServer.bind(NamingServer.java:209)
    at sun.reflect.GeneratedMethodAccessor487.invoke(Unknown Source)
[...]
</code></pre>
<p>And in the final:</p>
<pre><code>2016-08-19 10:17:51,993 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment &quot;ProfileServiceInvocationHandler&quot; is missing the following dependencies:
    Dependency &quot;ProfileServiceProxyFactory&quot; (should be in state &quot;Configured&quot;, but is actually in state &quot;**ERROR**&quot;)
    Dependency &quot;ProfileServiceProxyFactory&quot; (should be in state &quot;Configured&quot;, but is actually in state &quot;**ERROR**&quot;)

DEPLOYMENTS IN ERROR:
  Deployment &quot;jboss:service=ClientUserTransaction&quot; is in error due to the following reason(s): javax.naming.NameAlreadyBoundException: UserTransaction
  Deployment &quot;HASessionStateService&quot; is in error due to the following reason(s): javax.naming.NameAlreadyBoundException: Default
  Deployment &quot;ProfileServiceProxyFactory&quot; is in error due to the following reason(s): javax.naming.NameAlreadyBoundException: ProfileService, **ERROR**
</code></pre>
<p>So, I think I can't touch in already existent JNDI properties on that file.</p>
<p>If the jndi.properties file can't be changed because it is being used by JBoss itself, in which location can I set my JNDI lookup settings to the remote EJBs within the Jboss 5? How can I configure a jndi.properties file to be available in the application classpath without put the jndi.properties file inside of my WAR file?</p>
<p>Thanks!</p>