This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Localhost Vs IP Address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Localhost Vs IP Address" Watch "Localhost Vs IP Address" New topic
Author

Localhost Vs IP Address

Prateek Sharma
Greenhorn

Joined: Jul 20, 2008
Posts: 23
I have an application. which takes the snap (using web camera) on the any network machine when i provide the ip address/username/password of that machine.(It uses JMF)

To access this application I provide http://ipaddress_of_server/ in my browser, In that case it works fine.

But when I work on the server and provide 'localhost' at the place of IP like http://localhost/ in my browser, The JMF (java media framework) part of that application doesnt work.

In short JMF part of the application only works when I provide the ip of the server in browser. If I use 'localhost' it doesn't work.

I'm not sure but I think some how this problem is because of RMI.

Can anybody tell me what may be the reason....

Thanks in Advance

--
Prateek Sharma
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41019
    
  43
I think some how this problem is because of RMI.

Why do you think that? You mention a browser and JMF - where does RMI fit in?


Ping & DNS - my free Android networking tools app
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Did you try 127.0.0.1 in place of localhost and domain-name of the machine in place of ip address of the server?


SCJP, SCWCD.
|Asking Good Questions|
David Westbrook
Greenhorn

Joined: Dec 18, 2008
Posts: 16
i just learned about this stuff a couple days ago, so don't take what i'm saying as golden, but it might be something you haven't thought of.

do you remember setting any port numbers when installing your webserver? did you just install w/defaults?

try http://localhost:8080/

i know when i installed apache, it sets up port 8080 to take stuff in.

explanation (again, keep in mind i just learned this stuff so it might not be completely accurate):

whenever you see http://something you are automatically going to port 80 of that machine. so if you go http://yourServerIP/ it will boomerang a message out, which will come back into your port 80. If your ip is hosting server, then it takes incoming port 80 and sends it to whatever port you specified when installing your webserver. I hope that helps at least to point you in right direction.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Localhost Vs IP Address
 
Similar Threads
deployment
Can not run a servlet class
Executing Netbeans 3.6 web application from another pc
Losing session attribute
Java EE app not working when accessed with the IP address