简体   繁体   中英

Accessing tomcat application from virtualbox using ip address gives null url

I have a deployed my web app in tomcat and is working fine on localhost. But when i try to access it from virtual box (windows) it returns "Requested resource not found"

from localhost the url is -

localhost:8080/finance/entries

works fine

from virtual box url becomes -

localhost:8080/finance/null

Any idea whats causing this?

I have firewall turned off.

localhost is "the machine I'm running on". On VirtualBox it's the operating system that you run within this virtual machine itself. You'll have to find out an actual IP address for your "host" operating system, eg use "ipconfig" or "ifconfig" (one of them should work on whatever OS you're running) and choose one of the IP addresses that are printed.

So: Get the IP address of your "host", then enter it on your "guest". Assuming you'll find an IP of 10.0.0.1 , you'd access 10.0.0.1:8080/finance/entries from your guest operating system (this address will work on your host as well). Only localhost is special, because every system knows how to resolve that - it's "me", and virtual machines introduce quite a bit of split personality for your computer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM