Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Localhost Vs IP Address

 
Prateek Sharma
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Westbrook
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic