• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat webapp deploys and can be accessed locally, but returns a 404 when accessed remotely

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm a relatively newbie to both Java programming and Apache Tomcat, but I've been asked to deploy two existing webapps to a fresh installation of Tomcat. Post-deployment, both webapps are listed as deployed and running within the Tomcat Manager web UI and are accessible via web browser when connected via RDP to the hosting server. However, when I attempt to access them from a browser session on my workstation, one works without issue, while the other is returning a 404 error. Both of these webapps function properly in another Tomcat environment, so I believe that it may be an issue with how this particular instance of Tomcat is configured. I've searched online for a few hours, but I'm not making any meaningful headway and happened upon this forum during my search. I'm using Apache Tomcat 7.0.57 hosted on a Windows Server 2008 R2 box and attempting to access the webapps through both IE and Firefox. Thank you for taking the time to read this post and I appreciate any troubleshooting tips or ideas that can be offered.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Possible things to check for:

1. Firewall
2. Proxy
3. Possible errors on tthe Tomcat logs?
 
shawn haigler
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the quick reply! There is no firewall between my workstation and the host server. I checked out Firefox's proxy settings and it's currently set to auto-detect proxy settings for my network. I ran through the logs, but nothing seemed to jump out at me. Between the two webapps, WebApp1, the one that is returning the 404s when accessed remotely, does shut down log4j and close Spring root, while WebApp2, the one that works properly, does not; I've included a snippet of that log below. I don't see much of anything in the application log for WebApp1. When I checked to see if WebApp1 was running in Manager, I could see sessions opened for the access attempts that resulted in 404s.

INFO: Set web app root system property: 'WebApp1.root' = [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\WebApp1\]
Dec 01, 2014 3:46:07 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [classpath:log4j.properties]
Dec 01, 2014 3:46:07 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 01, 2014 4:00:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Dec 01, 2014 4:00:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Shutting down log4j
Dec 01, 2014 4:02:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Dec 01, 2014 4:02:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Shutting down log4j
Dec 01, 2014 4:02:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'WebApp2.root' = [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\WebApp2\]
Dec 01, 2014 4:02:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [classpath:log4j.properties]
Dec 01, 2014 4:02:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
 
shawn haigler
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also forgot to mention, the host server is a virtual server running on VMWare. During the initial configuration, I had to re-map the shutdown port in conf\server.xml to resolve a conflict with VMWare that was causing the Apache Tomcat service to stop unexpectedly.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat doesn't know or care whether it's running in a VM, behind a firewall, or the request is coming from a local or remote user.

If you submit a URL from one place and it works, but it returns a 404 when submitted from somewhere else, it's a pretty safe bet that the request is being routed to the wrong server, not that the server itself is at fault.

I'd look closely at the network paths between client and Tomcat and especially at any proxies between the two.
 
shawn haigler
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any idea on why a similar webapp running on the same instance of Tomcat resolves, but the one in question will not?

It's odd; serverurl.com:8080 serves the Tomcat page, serverurl.com:8080/manager/ pulls up the Manager app, serverurl.com:8080/WebApp2/ brings up the functional webapp, and serverurl.com:8080/WebApp1/ serves up a 404 for WebApp1, which is shown as running within Manager and accessible from the host server itself.
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you could try accessing a known page within webapp1, such as "http://serverurl.com:8080/WebApp1/index.jsp"

A "404" means "Resource not found", not "Application Not Found", although if an application isn't there for its resources to be found, a 404 also results.

You could also try renaming WebApp1 - or didn't you say you'd done that? If that fixes it, then I'd say that there's some sort of URL rewriting proxy scrambling your request in between Tomcat and the remote client. You could put an access Valve into Tomcat to log what the actual incoming URLs are.
 
shawn haigler
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the advice! I attempted to rename the WAR file, but that was coming back 404 after it was deployed, too. I decided to undeploy the working webapp and check the URL...it was still coming up after undeploying through Manager! I checked to ensure that the webapp folder had been removed from my webapps\ folder and from the work\Catalina\localhost\ folders and discovered that the webapp was no longer there, but the URL was still resolving. As it turns out, a vendor had logged into my server and installed another instance of Tomcat on top of mine, which is what caused all of the problems that I've been seeing. They had the working webapp deployed within their environment, but not the ones that were coming back with the 404. Interestingly enough, pages accessed from the host server were using my instance of Tomcat and pages accessed from my workstation were using the vendor's instance.

Again, thank you very much for your time and assistance!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic