-
1. Re: Connecting from one server to other
jerrygauth May 4, 2006 10:28 AM (in response to s.rzytki)You can use HA-JNDI instead of a local JNDI address if you're running in a cluster. If you know which server to use for various lookups, you might also try creating initial contexts for each server and use the one appropriate for each lookup.
-
2. Re: Connecting from one server to other
s.rzytki May 5, 2006 2:07 AM (in response to s.rzytki)I tried to create two InitialContext but when i try to connect to remote jndi I get connection to local jndi (situation was described in post above). Please write some code examples.
Thanks
Sebastian -
3. Re: Connecting from one server to other
jerrygauth May 5, 2006 8:04 AM (in response to s.rzytki)Code like the folloiwng should be sufficient to direct your JNDI lookups to a specific server. Change the provide url as needed.
You can use HA-JNDI by using the HA-JNDI port in the url. By default, this is port 1100. Note that HA-JNDI requests may not go to the specified server as HA-JNDI uses round-robin load balancing. This would only matter if you had local entries bound with the same name to different values in which case you wouldn't want to use HA-JNDI.
env.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://myserver:1099");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context naming = new InitialContext(env); -
4. Re: Connecting from one server to other
ljnelson May 15, 2006 12:38 PM (in response to s.rzytki)I am seeing the same behavior, even with the recommended environment settings.
In my case, I have some code running on a JBoss 4.0.3SP1 server trying to act as a client to a JBoss 3.2.6 server. Obviously I can't just use the client libraries supplied by JBoss 4.03SP1 for this purpose.
How would one set up inter-server JNDI communication when the servers may not be from the same vendor, or may be different versions from the same vendor? I would have thought it should be through the environment parameters.
Laird -
5. Re: Connecting from one server to other
littlefish May 18, 2006 5:23 AM (in response to s.rzytki)Somebody told me that, when you packaging the .war, also pack the "jbossall-client.jar" (the one get from the ejb server jboss) to the WEB-INF/lib should be ok.
But i still can't make it work.
Anybody knows how to make it work? -
6. Re: Connecting from one server to other
jahlborn May 19, 2006 12:52 PM (in response to s.rzytki)Hmm, I'm starting to think this is a bug in 4.0.3SP1. I'm having the exact same issue, as i posted in a separate forum:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=83207 -
7. Re: Connecting from one server to other
niki600 Jun 6, 2006 3:40 PM (in response to s.rzytki)What about next situation?
I have made an .ear and I want to run client application on the one machine and the JBoss AS on the another.
My client machine is called ubuntu with address 192.168.0.4
and laptop on which I want to run JBoss AS has an address 192.168.0.5
Also on the laptop I have installed Postgres server.
I know that I have to set up jndi.properties which must point on the IP address of the machine where exists JBoss AS.But how to force JBoss AS to not listen on the localhost address and to listen on the ethernet address in my case
is 192.168.0.5.How to set up /etc/hosts ?
If someone could help me I would be gratefull. -
8. Re: Connecting from one server to other
visolvejboss Jun 7, 2006 5:38 AM (in response to s.rzytki)Hello,
You can make the JBoss AS to listen an particular ipaddress instead of localhost by running the JBoss AS with the following option.
$ ./run.sh -b {ipaddress}
For your case,
$ ./run.sh -b 192.168.0.5
Regards,
ViSolve JBoss Team