• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

127.0.0.1 GET 404 on webapp resources

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

i don't know if this question is already answered somewere, but i'm scratching my head since 2 weeks and can't find a solution.

I deployed a war file in webapps folder. (lets say mywebapp.war)

All is fine in tomcat manager, app is started.

Now in server.xml i configured <Host name="mywebapp" appBase="webapps/mywebapp" unpackWARs="true" autoDeploy="true"/>

context is in context.xml and contains a connetion to postgres db. (this also seems to be fine)

when i put localhost:8080/mywebapp/login.jsp it loads me only some part of the page beacause 127.0.0.1 cannot find imgs js css and all other folders inside mywebapp folder.

localhost log shows it gets 404 for all folder and subfolder contained in mywebapp.

Can you please help? i'm running out of ideas!

thanks.
Jack
 
Saloon Keeper
Posts: 28319
210
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
Welcome to the JavaRanch, Jack!

Why did you modify server.xml?
 
jack enn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Tim,

i'm not a tomcat expert as you might imagine :-)

putted <host> in server.xml because of readings i made in google...they tell to create a host tag for webapp and inside put context aso..

i'm wrong, isn't it??

can you please help?? Got big pressure around for this!

thanks
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
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
Si, you are wrong. You do not have to modify server.xml. The "appBase" attribute of the Hosts element refers to the directory that that Host expects to find its webapps (WARs) in. Tomcat can host more than one app at a time. So change it back to appBase="webapps" and copy the WAR to the TOMCAT_HOME/webapps directory. Note that when unpackWARs is true, Tomcat will unzip ("explode") a WAR file into a directory of the same name and once that is done it will ignore the WAR file itself, even if you replace it with a newer version.

The default Context path for a war named "xyz.war" is assigned as "xyz", so the application will have a base URL of 'http://localhost:8080/xyz/'.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic