-
1. Re: JNDI over http
frito Jul 29, 2003 8:54 AM (in response to uramisten)These properties must be set on the client who is doing the lookup (JB 3.x, default or all configuration):
[pre]
java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://:8080/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
[/pre]
No changes to your code are required.
Greetings,
Frito -
2. Re: JNDI over http
bentzn Aug 5, 2003 5:55 AM (in response to uramisten)Yes!
Great, that's what I've been looking for....
-only one thing.... My firewall still has to have high ports (>1024) open if I want it to work...
It seems to me, that after the first connection is established over http (port 8080) then a second connection on a random portnumber starts....
I have no probs with the load (yet) so could I maybe assign a fixed portnumber to that second connection - it's beacuse I use another machine to make the filtering/routing with SuSE Firewall2
Thanks
b -
3. Re: JNDI over http
frito Aug 5, 2003 6:14 AM (in response to uramisten)You are only looking up over http. The bean call later on is standard RMI, this means at least two ports, one of these dynamically changing every time you start JBoss, are used.
We are doing bean calls from behind a firewall using the SSL invoker. Search the forum or read the JBoss book (chapter 8 - Using SSL with JBoss using JSSE). You only need to open one port for the SSL invoker and this approach is much more performant than another possibility: HTTP tunneling.
Greetings,
Frito -
4. Re: JNDI over http
mikesu Aug 5, 2003 8:07 AM (in response to uramisten)Could you please elaborate?
-
5. Re: JNDI over http
bentzn Aug 5, 2003 8:14 AM (in response to uramisten)Thanks!
I'll look into the JSSE-thing...
I just discovered that I can't make a lookup from outside the firewall at all....
Am I missing something or is the communication inside my regular TCP/IP ethernetwork the same as on the internet - ie. outside my firewall...? -
6. Re: JNDI over http
bentzn Aug 5, 2003 8:28 AM (in response to uramisten)'elaborate'... I guess it's me.... :-)
I'm using JBoss as an EJB-server.
Login is performed with JAAS (client-loginmodule and so on)
And then I make a lookup:
Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jboss.naming..HttpNamingContextFactory");
env.setProperty("java.naming.provider.url", "http://62.107.81.101:8080/invoker/JNDIFactory");
env.setProperty("java.naming.url.pkgs", "org.jboss.naming:org.jboss.jnp.interface");
InitialContext iCtx = new InitialContext(env);
Object ref = iCtx.lookup("nameOfBean");
EJBHome home = (EJBHome)PortableRemoteObject.narrow(ref, EJBHome.class);
I have a computer on the internal network where I've developed everthing - and everything works fine on that one...
-and then I have another computer with it's own connection to the internet for testing - and nothing works on that one - well, that is, the Tomcat-server on port 8080 works fine.
Firewall on the server is set (right now) to open ports 80 and 1024:65000 and iptables redirect port 80 to 8080
Any help would be greatly appreciated... I'm going on vacations tomorrow.... - if I get this working... :-)
thanks
b -
7. Re: JNDI over http
bentzn Aug 5, 2003 6:37 PM (in response to uramisten)I've been looking at JSSE - the chapter in the book and the very little in the forums...
- and I can't get it working...
Maybe I'm just too tired...
I have added the jboss-service.xml-example in the book to the Tomcat jboss-service.xml:
<!-- The SSL domain setup -->
my.keystore
mypasswd
4445
org.jboss.security.ssl.RMISSLClientSocketFactory
org.jboss.security.ssl.RMISSLServerSocketFactory
java:/jaas/MYDOMAIN
jboss.security:service=JaasSecurityDomain,domain=MYDOMAIN
-where MYDOMAIN is an application-policy in login-config.xml
and it throws an NameNotFoundException because it can't find MYDOMAIN
-anyway a sample or simple explanation of domains, keystores and so on would come in handy... :-)
best
b
PS Am I completely wrong here?!
I wanted to make a 'traditional' client/server thing communicating over
the internet and it seems to be at best dificult - maybe even impossible....?! -
8. Re: JNDI over http
twutort Sep 11, 2003 9:12 AM (in response to uramisten)I'm having this same error and can not figure it out. When I attempt to lookup an object I get "Failed to connect to server http:1099". I trying to do the look up using the http protocol over port 8080. Is there some setting I need? Here is my lookup code:
Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jboss.naming..HttpNamingContextFactory");
env.setProperty("java.naming.provider.url", "http://loclahost:8080/invoker/JNDIFactory");
env.setProperty("java.naming.url.pkgs", "org.jboss.naming:org.jboss.jnp.interface");
InitialContext iCtx = new InitialContext(env);
Object ref = iCtx.lookup("classA"); -
9. Re: JNDI over http
twutort Sep 11, 2003 9:49 AM (in response to uramisten)I got this to work by removing the following property:
env.setProperty("java.naming.url.pkgs", "org.jboss.naming:org.jboss.jnp.interface");
From the documentation it gathered that I needed this property. However, I noticed this property was not set in the examples. So I removed it and it worked. WHy is this? Is it because the url.pkgs property says to use jnp? Perhaps I misread the documentation and assumed I needed that property for http.
Thanks,
Tim