views:

312

answers:

2

I have a simple web service deployed on tomcat using Apache Axis.

If i access the webservice as http://localhost:8080/webservices/TransactionService i see the usual message

TransactionService

Hi there, this is an AXIS service!

Perhaps there will be a form for invoking the service here...

showing that the web service is available and ready for use.

However if i access it as http://10.0.0.1:8080/webservices/TransactionService (10.0.0.1 is the actual IP of the machine. I'm accessing it on the same machine as above, machine hosting tomcat) i get:

HTTP Status 404 - /webservices/TransactionService

--------------------------------------------------------------------------------

type: Status report

message: /webservices/TransactionService

description: The requested resource (/webservices/TransactionService) is not available.

--------------------------------------------------------------------------------

Apache Tomcat/5.5

There is nothing in the tomcat logs

If i try deploying on Jetty it all works fine.

Is there any explanation for this? Any pointers most welcome.

+2  A: 

Tomcat can listen on different hostnames/IPs in a different way. Specifically, every host/IP can have its own work directory:

<Host name="localhost" workDir="/workdir">
  ...
</Host>

Application deployed to one workdir won't be available to a host with another workdir.

Check your configuration.

UPDATE: if name is specified as name, not IP, check that that name is resolved to 10.* address too.

Also, one of the hosts is default. It responds to all requests now matter what host they are targeted too, if there is no specific Host. For your setup you may want to leave only that one active.

Vladimir Dyuzhev
A: 

I don't think a change to Tomcat configuration is the answer. I don't have to do such a thing to use my local IP address or localhost.

Could it be as simple as an addition to your hosts file? I've got mine in c:/windows/system32/drivers/etc/hosts, and there's an entry for "127.0.0.1 localhost" in it.

duffymo
he doesn't have problems with localhost, he has them with 10.0.0.1
Vladimir Dyuzhev