Re: JBoss behind a NAT
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=17554 Posted on behalf of a User
PLease, I and having the same problem?
Did you find the solution?
Many Thanks!
In Response To:
Good evening Community !
I'm trying to connect a client application to my JBoss, who is running inside a virtual machine (VMWare). The link between the virtual machine and its host is a NAT. We've got :
* PC_Client : real machine that has the "IP1" ip address in the subnet1 (the real one)
* PC_Server_Host : real machine that has the "IP2" ip address in the subnet1 (the real one), and "IP3" ine the NAT VMWare subnet
* Server_Virtual : virtual machine, Linux RedHat, running into "PC_Server_Host" ; il has "IP4" in the NAT VMWare subnet
I have forwarded the ports 1098, 1099, 4444, 4445, 8080 and 8083 from PC_Server_Host to Server_Virtual.
I've read this article from the wiki : http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJBossBehindAFirewall
And I tried, as il was suggested to add :
"-Djava.rmi.server.hostname=IP2 -Djava.rmi.server.useLocalHostname=true "
to my JBoss startup script run.sh.
I launch JBoss on Server_Virtual then, and then I launch the client on PC_Client ; the client falls into a "Connection timed out" error.
With wireshark (ethereal), I found that the discussion starts well between the PC_Client and the PC_Server_Host on port 1098, but the client tries then to connect on "IP4", which is not visible to him...
I've been looking on the web, and I found that the option should be "-Djava.rmi.server.useLocalHostname=false" instead of true, but it doesn't change anything to me.
Did I forget something ? I've also read that there may be a problem with the /etc/hosts file from the system where JBoss is running...
Even if the problem seems complicated to explain, I think that it's a very common one, but when I follow the tips, it doesn't work...
Any idea ?
Thanks you (at least to have read my post !!!)
16 years, 11 months
[Clustering/JBoss] - FYI : Communication between services in clustered environmen
by ekobir
Hi All
I just want to share some tricky points which I encountered while developing communications between services in clustered environment.
There might be options out there but following 2 options are definitely available for you to use.
1) JMX Notifications
* Provide cluster wide notifications
You can send notification to only local listeners, only remote listeners or both.
Only thing you need to do is to implement NotificationListener interface and register your service for notification in the startService method.
addNotificationListener(NotificationListener, NotificationFilter, Object handBack);
2) Remote Procedure Call by using HAPartition. (If your service extends from HAServiceMBeanSupport, you will have access to underlying ClusterPartition instance)
Remote method call might be more helpful if you want to call a specific method on a specific node in the cluster. Underlying HAPartition provides you following methods as of JBoss 5. Please refer to API for details.
callAsyncMethodOnNode
callAsyncMethodOnCluster
callMethonOnCluster
callMethonOnNode
callMethonOnCoordinatorNode
Important:
In order to make your service a RPC handler, you need to register it by calling
registerRPCHandler(String service_name, Object rpcHandler) on HAPartition.
If you are using jmx notifications as well RPCs, make sure service name you used to register your service as a RPC handler is different than actual service name.
The reason is that underlying HAServiceImpl's uses your actual service name to register its RPC handler as JMX Notification uses RPC behind the scene. (If Im not wrong method name is handleEvent.)
So you might ask what could happen if I register my service with original service name for RPC? Basically your service will not be getting any notifications from anywhere and in order to see what's happening you might need to change logging level to TRACE for jboss.
Note: If you are going to use instance of a custom class as data in your jmx notification, make sure that you are not using loader-repository element in jboss-app.xml.
If you used it, ClassNotFoundException will occur.
please let me know if anything is wrong.
Cheers
Erkin
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232293#4232293
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232293
16 years, 11 months