RMI (Internet, LAN, Firewall)

Hello everybody.
In the last view days I solved a lot of problems with my RMI based System... There was the registry problem, the IE problem (no RMI support), the access permission problem and so on...
But now everythiung is working properely. I use the Java Plug-In (JRE), so I don't even mind about Microsoft's Java implementation :-)
The registry is working, the server is working and the applet is working, too.
The problem I had is that I couldn't connect to my RMI server from the Internet... the applet could only connect from a LAN-host. The server is running on 192.168.0.1 and I could only connect from hosts like 192.168.*.*.
So I changed the rmiregistry command line:
"rmiregistry &"
to
"rmiregistry -J-Djava.rmi.server.hostname=myhost.net &"
and the server command line:
"java -Djava.rmi.server.codebase=http://myhost.net/msg/ -Djava.security.policy=server.policy MessageServer &"
to
"java -Djava.rmi.server.codebase=http://myhost.net/msg/ -Djava.security.policy=server.policy -Djava.rmi.server.hostname=myhost.net MessageServer &"
("myhost.net" is just a reference for the real domain name)
Now, I can connect the server from outside (Internet) but if I try to connect from the LAN (192.168.*.*) I get an Exception:
java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.1:5099 accept,resolve)
Per haps there is a firewall problem. I connect to the internet unsing the gateway (firewall) 192.168.0.1 (which is also the RMI and webserver) and I opened the port 1099 for RMI (but in the exception above there is always another port, for example 5099, 5100, 5101, 5102, 5103) and it looks as if the applet tries to connect on different ports... first for example 4800, then 4801, 4802 and so on (and I really can't open alle these ports).
What should I try... I'm new to RMI and I don't have much experience in using RMI and handling ports, hosts, codebases etc. Is there a possibility to allow the access to the registry/server from LAN AND Internet or what can I do. Is there a possibility to tell the client/server to connect to a fix port (for example 5099) so I would open this port on my firewall.
Please give me some advice... I would be very grateful.
Thanks a lot.
Greetings
Adrian R.
Switzerland

If you look back through this forum you will find LOTS of discussion about operating through firewalls. A lot of it is problems with callbacks. Ignore it (unless this is the next problem you have to tackle.)
The probelm is about as you guessed: The actual communications from client to server program require a socket, and that's a problem unless you can nail down fixed ports and open them in the firewall. (There is supposed to be an automatic workaround built into RMI to use HTTP tunnelling. This may work - I just have no experience using it.)
One basic technique for solving the problem you posted is to define and set a "socket factory" that will provide fixed addresses for the communications.
As I said, look back through earlier postings.

Similar Messages

  • RMI Clients behind firewall

    When the RMI client behind firewall tries to access the server the following error is thrown up:
    java.rmi.ConnectIOException: Exception creating connection to: 10.130.12.128; ne
    sted exception is:
    java.net.NoRouteToHostException: Operation timed out: no further informa
    tion
    java.net.NoRouteToHostException: Operation timed out: no further information
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at RMIFaxServer_Stub.getResult(Unknown Source)
    at FaxTest.main(FaxTest.java:51)

    your client is behind the firewall but the server you're trying to access has an address 10.x.x.x which says that it too is behind a firewall and not on the Internet, or is the server in a DMZ. It sounds more like a networking issue than a java problem at this point. If the server is on some side of a firewall, you may need a some sort of "permit established" config setting added to the firewall. Just a thought.

  • RMI through a firewall

    Has anybody been able to do this. I have an RMI server that will attach on a non-firewalled machine but won't on the machine I really need it on. Can anyone tell me what needs to be done admistratively or programmactically?
    Steve

    I looked into RMI over a firewall once.
    The port 80 solution, called Http Tunnelling, at the time ( 2 years ago ) required a custom servlet intercepting all the RMI calls, then it forwarded the call on to the actual RMI server..... messy.
    In the end I recommened writing an RMI Custom Socket Factory.
    Not as hard as it looks, and source is available.
    It meant that you could have your own properties file which dictated the ports the RMI used. So you might have something like
    rmi_ports=1900-2000
    You parse the properties file, and only attempt to open ports in that range.
    The firewall will off course have to open that range of ports too.
    I never implemented this, but did research it a few years back.
    Maybe there's a more up-to-date solution.... maybe not.
    But that's my 2 cents ( in Euro not dollars ! )
    regards,
    Owen
    http://java.sun.com/j2se/1.5.0/docs/guide/rmi/socketfactory/index.html

  • I am getting a message that says download failed because of internet connectivity/ firewall

    i am getting a message that says download failed because of internet connectivity/ firewall- how do i fix that? I am on vacation in mexico, need to install bridge to edit photos and the creative cloud wont install....

    Hi,
    Please refer to the help document below:
    Troubleshoot download problems
    Regards,
    Sheena

  • Can RMI get through firewall?

    my java applet will have to communicate with SAP server using JCO
    so the applet connects to an RMI server then the RMI server connects to SAP server.
    in between applet and RMI server there is a firewall. will RMI get through firewall?

    The answer is "maybe". It depends on
    o How the service is coded. Probably has to be written to communicate using a fixed port number, rather than randomly assigned. (Most firewalls allow access to only specified ports.)
    o Changing the firewall settings.
    o Whether or not your server tries to call back the client, and whether the client is also behind a fireall. If these two details are both true, then you are probably dead in the water.
    There are HTTP tunelling techniques for getting through firewalls. Haven't used them, but if you look back through this forum you'll probbly find some info.

  • RMI server behind firewall--must use host as name, not IP

    Server is running behind a firewall, which runs such that any machine behind the firewall cannot use the external IP to get back to itself.
    That is:
    - outside IP = 192.171.20.5 (port forwards 1099 to 192.168.1.5:1099)
    - inside IP = 192.168.1.5 (rmi server listens on 1099)
    from the machine inside (192.168.1.5), it is IMPOSSIBLE to create a socket to [outside ip](192.171.20.5), port 1099, and expect it to get back to the machine inside--the firewall prohibits this.
    I -can- use name-based lookups, such that I can edit the hosts file on the inside box to route (myhost.com to 192.168.1.5). So, if everyone's DNS resolves myhost.com -> 192.171.20.5, then clients anywhere can go to myhost.com:1099 and will be redirected to my internal machine (192.168.1.5:1099).
    The problem with this is that the names get translated to IPs and sent back to the client.
    Is there a way to keep the names as names, so that both client (using external real-world DNS entries) and server (using local hosts file) can both resolve to the proper IP addresses?
    I'm starting server, as follows:
    java -Djava.rmi.server.codebase=http://myhost.com/rmi/ -Djava.security.policy=/policypath/policy -Djava.rmi.server.hostname=myhost.com mypkg.myclass
    The client connects and gets this message (from a connection exception):
    java.rmi.ConnectException: Connection refused to host: 192.168.1.5;

    Server is running behind a firewall, which runs such
    that any machine behind the firewall cannot use the
    external IP to get back to itself.I dont really understand this statement.. Machines behind the firewall referring to the external ip would be going to the gateway, not themselves.. Or do you have an internal AND external ip on the machines behind the firewall? Or are we referring to the gateway machine as an internal machine as well as external?
    That is:
    - outside IP = 192.171.20.5 (port forwards 1099 to
    192.168.1.5:1099)
    - inside IP = 192.168.1.5 (rmi server listens on
    1099)looks good, what kinda OS/firewall? If we're talking linux/ipchains (or iptables) with ip masquerading, I may be of some use to you...
    from the machine inside (192.168.1.5), it is
    IMPOSSIBLE to create a socket to [outside
    ip](192.171.20.5), port 1099, and expect it to get
    back to the machine inside--the firewall prohibits
    this.If you're on the internal network, why can't you just go for the internal ip addr? If I'm understanding correctly, you want internal dns requests for myhost.com to resolve to 192.168.1.5, and external dns requests to resolve to 192.171.20.5? That should't be a problem...
    I -can- use name-based lookups, such that I can edit
    the hosts file on the inside box to route (myhost.com
    to 192.168.1.5). So, if everyone's DNS resolves
    myhost.com -> 192.171.20.5, then clients anywhere can
    go to myhost.com:1099 and will be redirected to my
    internal machine (192.168.1.5:1099).the hosts file has nothing to do with routing, it's simply a dns-type thing... If your dns is giving external users a 192.168 address as the ip for myhost.com, they will never get to it. 192.168 is not routable on the internet, i think most inet routes will drop packets from 192.168.x.x or 10.x.x.x.
    Is there a way to keep the names as names, so that
    both client (using external real-world DNS entries)
    and server (using local hosts file) can both resolve
    to the proper IP addresses?As long as your dns is working correctly, java doesn't care if you use ips or host names.. Hostnames are preferable, so when you change your network around, you wont affect your rmi server.
    I'm starting server, as follows:
    java -Djava.rmi.server.codebase=http://myhost.com/rmi/
    -Djava.security.policy=/policypath/policy
    -Djava.rmi.server.hostname=myhost.com mypkg.myclass
    The client connects and gets this message (from a
    connection exception):
    java.rmi.ConnectException: Connection refused to host:
    192.168.1.5;Is your server compiled with the 192.171 ip? That's not gonna work, you have to use the same IP the server is running on. I'm still not clear on your network layout, is 192.171.20.5 and 192.168.1.5 the 2 gateway ip's, or is 192.168.1.5 a physically different machine? I'd be willing to bet that your server is compiled with the external address, and if that's not the same machine, then there's no chance of that working....
    There's more than port forwarding going on.. IIRC, java rmi keeps track of its own ip's.. A client request to an external ip will not connect to a server running on the internal ip, even if you forward the port, rmi itself doesn't recognize the internal as the ip it's trying to get to (even if it is true), so it bombs out.. This can happen if you run the rmi server on a gateway, and compile the server with the external ip, and try to connect to the internal ip.. If you want external machines to connect, you MUST run the server on an external ip.
    Give a little more info, we'll getcha running... I'm also assuming you have full control of your network (ie, firewall/dns)
    doug

  • Strange: just lost use of Built In Internet (LAN) connection!

    Greetings,
    I was just switching from wireless Airport connection to Built In internet (wired/LAN) connection (I do that to insure more reliable large downloads, software updates), and I realized that upon Turning Off Airport, I was not getting automatic connection to the built in NIC, as I do usually. I checked Preferences >>> Network, and observed that the built in connection was "inactive". I am not sure how to activate it again. LAN cable is OK, internet connection and modem OK, etc...
    I'll appreciate refresher!
    - Roger T

    sig, thanks a lot for your prompt reply... I had restarted the system indeed.
    I got to start looking deeper into seldom visited settings... And I found one that fixed the problem.
    I went to "System Preferences" >>> "Network" >>> observed that the "Built In Internet" was INACTIVE >>> clicked on the smal, gear-like button at the bottom, right next to the "+" and "-" buttons. AND, lo and behold, by making the "Service Active", I restored the Built In Internet" connection.
    Man, go figure what disconnected it in the first place! I just drew a blank initially!
    Thanks again... Sometimes, one needs a prod
    - Roget T

  • Suddenly G5 won't grab DHCP add. but will conn. to WiFi - NO INTERNET, LAN

    I've checked the forums here and this exact problem isn't jumping out at me.
    6 months or so ago I replaced my router with a Time Capsule. Everything worked fine for months and months. We had a power outage (I have battery backup UPC) several weeks ago and when the power came back my G5 and my wife's iMac (both Ethernet LAN connected) had lost their LAN DHCP address (192.168.0.x) and were self-assigning their own IP's. The WiFi connection had internet access and after restarting a gigabit ethernet switch on the LAN everything came back.
    For weeks everything was fine. Yesterday after coming home from work my G5 had lost it's DHCP address and internet connectivity. I've tried resetting/restarting everything (hardware and network connections). Here are weird particulars :
    - G5 desktop has self-assigned IP for both ethernet and Airport
    - G5 desktop WILL connect to the Airport network but won't grab a LAN DHCP and can't access internet via WiFi
    - iMac is working fine on both ethernet LAN and WiFi
    - MacBookPro is working fine on both ethernet LAN and WiFi
    - same cable that works on MBP won't work on the G5 (no DHCP assigned)
    Tried safe mode restart. Tried new Network Location. Time Capsule is reachable via Airport Utility on MBP, but not the G5. All computers and the TC are updated to latest software revs and firmware.
    Any ideas ?
    Thanks so much, I'm dead in the water on the desktop.
    Ed

    Thanks Glen. I tried renew the lease. It never got a lease in the first place. Also tried resetting PRAM and Safe Mode boot. No luck on auto DHCP for this machine.
    I do get internet and LAN connectivity if I switch to manual DHCP (I found it's necessary to enter the router address, 192.168.0.1 or it doesn't work).
    So now it's working (on Manual) but it bothers me that I can't pick up a LAN IP from the Time Capsule (on Automatic) like it did everyday for a long time. No software changes were made, just Repair Permissions (Check Disk showed no problems). It's a weird problem as all other appliances (computers, iPhone, ATV, etc) are working fine. Just the G5 (same cable, same everything as far as I know).
    Thanks,
    Ed

  • RMI and a firewall

    I'm having a strange problem getting RMI HTTP Tunnelling to work with a firewall installed. I configured my code to use HTTP Tunnelling a few months ago, and had no major issues. Now that we have begun testing in the production environment with the real firewall, I am getting several errors.
    My network admin has given me an external IP address to use to get to my machine. The firewall forwards all requests to the machine with an internal address (172.16....) on the other side of the firewall. I can successfully locate the registry, and am returned a reference to my object. However, deep with the bowels of the tunnelling code I noticed that all subsequent calls to the new object use the 172 address, so I can't reach the actual object.
    After some digging, I determined the reason for this. The program that registers the objects was started with -Djava.rmi.server.hostname=172.16... I made the change to the server's startup parameters, and verified that all calls to the RMI server use the external address. Now, I am getting the following error:
    java.rmi.NoSuchObjectException: no such object in table
    I refuse to believe that I am the first to set up RMI like this, but I haven't been able to find anything about how to do this correctly. Any ideas on the correct configuration for a system like this?

    Sorry, that's not correct. I have done some more testing, and it looks like the lookup works, but when I actually try to use it, the call fails.
    I was able to open up the port that RMI uses, and I get the same problem. Perhaps the issue is with the port that the object uses: 58494. I'll check with our network guy.

  • Java Rmi Client behind firewall

    What port should be opened to let rmi traffic passing through firewall to weblogic app server?

    Dahan <[email protected]> writes:
    What port should be opened to let rmi traffic passing through firewall to weblogic app server?The port the server is listening on?
    andy

  • Nokia e51 = Internet + Lan Phone

    ello guys i want to hit 3 birds with one stone
    Anyhow here it goes
    I need a internet connection and lanline ability to call via wireless as i have no phone line in my new unit for another 5 months.
    As far as visible solution with no contract
    This is my plan
    -- Nokia e51
    -- Three 3G HSDPA Broadband plan sim on $49 for 4 GB
    -- VOIP application/subscription that will use phone's HSDPA internet
    So basically The Nokia E51 will use the Three 3G sim card as HSDPA MODEM (internet) and will have the ability to use this internet to make phone calls via VOIP application/subscription
    This is for home use only for me and the wife to browse the net and use it when making lan line phone calls not as a mobile phone
    Will this work for me?
    Will it be efficient?
    Or i am asking for too much?
    Please give feedback guys!!

    Well, it seems a good idea by doing this, but the question is, all you need is just a modem, not a phone.
    Do you have any idea why should it be a phone, not a modem?
    Well, to answer your question, e51 got the ability to do all the things you need, except the battery life.

  • Download Error. Unable to reach Adobe servers. Please check your internet connectivity, firewall settings, and then try again.(12175)

    I've searched everywhere, deleted those 2 folders in the username/local/adobe directory, and tried turning off my firewall. Unfortunately, I can't even use a live chat room because I'm trying to try it out first so I'm not a pro member yet.
    Windows 7 64-bit, I use windows firewall and nothing else.

    Here's my PC info.
    I cleared the following data from my Chrome browser
    I disabled my entire firewall
    I ran the Creative Cloud Cleaner Tool, with my browser closed. I chose option 3 followed by option 1. This screenshot is just for reference.
    After all of that, I re-installed Creative Cloud with a brand-new download of the installer. It installed fine, no errors and auto-launched. Made sure my firewall was disabled before signing in.
    And in the end, this is what I got.

  • Ad-hoc internet sharing firewall

    I have an ad-hoc wireless network set up with internet sharing on a Mac mini running OSX 10.6.  I have several machines connected to it, all of which can ping the mini and can access the internet in general.  I can also ping each of these machines from the mini.  However, none of these machines seem to be able to see each other - I can't ping them across the mini's ad-hoc network, and when I ping the broadcast IP (10.0.2.255 in this case), I only get a response from the mini.  What secret configuration options do I need to alter to get the machines on the network to see each other?  I'm a Linux guy, btw, so if the answer involves messing with things at the command line, I'm cool with that.

    To elaborate a bit, a more Mac kinda guy than I am confirmed that internet sharing makes the mini act as a gateway, but not a router, which is obviously what I need.  Is there a convenient way to get it to act as a router, or do I need to spend some quality time with ipfw?

  • Database Replication over the internet through firewall

    We installed database link between two Oracle databases. Does anybody know on whitch TCP port it communicate ? I know only about port 1521. Problem is that we have firewall between computers and we need to enable Oracle communication between them.

    I think SQL*Net uses port 1525.

  • RMI & Windows Xp firewall.

    How i set my windows xp firewall to work correctly with my RMIserver - client application?
    Thank!

    Up!

Maybe you are looking for

  • How can I updated my email on these forums?

    I must have originally made my account under my parent's email before I had ordered my computer some many years ago.   Now, when I post, it turns out that they're getting the emails and forwarding them to me.  I went in to try to change the email and

  • I want to learn web dynpro in UK

    i want to learn web dynpro in UK through remote servers by self learning.WHO provides remote servers.what r the pre requisites for webdynpro for ABAP

  • Problem including a jsp in edit mode

    Hello Somehow i have a problem while including a jsp page while displaying the edit mode. If my doEdot just writes something like "Hello World" into the response it just works fine. But if i try to include a jsp resource the problems start to arise:

  • Bug in cfspreadsheet "update"?

    To those with experience with <cfspreadsheet>, I'd really appreciate your feedback. I'm trying to use the cfspreadsheet tag to generate a two page spreadsheet based on the output of two database queries. SheetOne uses "qryTopicList" and SheetTwo uses

  • Tx2z randomly freezing

    i have owned this laptop for 5days and it freezes 5 odd times a day (sometimes using and other times go to use and is frozen) and flashes caps/num 2 times which hp say bios error i have updated to the latest f.14 and still the same any ideas 2.4ghz 8