Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

What can cause a .war file not to show/load?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've uploaded my .war file to /webapps. I'm able to see it in the path, but if I got to //localhost:8080/Test it's not pulling up....or if I got to the localhost/manager.

Any tips to look for?
 
Ricky Jay
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw, sorry if i posted this in the wrong spot. I'm new here and didn't quite know where this one fell. Thanks.

 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat? Resin? Websphere? Fred's Fabulous Server?
 
Ricky Jay
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 6.0
Mysql
JDK update 17 i think.

I set the context path="<name of my war file>"

I'm able to load it in Netbeans, but not on tomcat.
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Ricky Jay
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the error I'm getting. The .war file is in /webapps and I have other .war files visible when i go to tomcat manager....this one is not showing.

HTTP Status 404 - /MyApp

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

type Status report

message /MyApp

description The requested resource (/MyApp) is not available.


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

Apache Tomcat/6.0.24
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would start by looking in the tomcat logs. Tomcat is very good about logging any problems it is having when trying to deploy a web application.
I would:
  • Stop Tomcat
  • Delete all the logs in tomcat/logs
  • Remove the war file and the directory it created (if it did) from tomact/webapps
  • Start Tomcat
  • While watching the logs, copy the war file to the webapps directory again


  • This way you won't have to sift through any older issues to find out what is actually causing the problem.
     
    Ricky Jay
    Ranch Hand
    Posts: 62
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I'll try this. Thanks for the reply.

    It never created a directory/folder from my .war file. Does that matter or aid in the troubleshooting? my helloworld.war did.

     
    Ricky Jay
    Ranch Hand
    Posts: 62
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This is what I got when I did the steps above.

     
    Ricky Jay
    Ranch Hand
    Posts: 62
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
     
    Ranch Hand
    Posts: 470
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Typical causes of this error are that the XML is not valid.
     
    Ricky Jay
    Ranch Hand
    Posts: 62
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I don't know what happened, but I recreated the project under a different name in net beans and it works.

    I just copied the files out of the orginal and pasted them in the new one too...strange. The only thing I could think of is that my project name/war file was the same name as my database. This may have cause conflicts in xml.
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I have almost the same issue. My Spring application is being started by Tomcat on my own laptop, but on the Amazon Linux server EC2 in catalina.out I have this:

    22-Sep-2020 09:39:14.986 INFO [http-nio-8080-exec-48] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war]
    22-Sep-2020 09:39:24.263 INFO [http-nio-8080-exec-48] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    22-Sep-2020 09:39:24.407 INFO [http-nio-8080-exec-48] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war] has finished in [9,421] ms

    On local computer there is java 8, Tomcat 9. The same is on the EC2
     
    Master Rancher
    Posts: 4669
    49
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    According to those logs it deployed.
     
    Saloon Keeper
    Posts: 22508
    151
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Dave Tolls wrote:According to those logs it deployed.


    Also according to the logs, it deployed under the context path /mobile-app-ws-0.0.1-SNAPSHOT.

    Meaning that you'd have URLs in the format of http://my.server:8080/mobile-app-ws-0.0.1-SNAPSHOT/index.jsp.

    Tomcat deploys WARS by default using the WAR's name as its context path. So to get a simpler/more meaningful context path, you either have to rename the WAR before you deploy it or use an alternative deployment scheme.

    I usually use the second option. I put the WAR outside of Tomcat - for example as /opt/com/javaranch/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war. Then I create a Context file in TOMCAT_HOME/conf/Catalina/localhost/mywebapp.xml. It will point to the WAR file under /opt/com/javaranch/webapps. Don't create the Context in TOMCAT_HOME/conf/server.xml!

    The webapp will be deployed under the name of its Context file, so that would deploy my webapp as http://my.server:8080/mywebapp Note that a name within the Context will be ignored. It's the name of the Context xml file (minux the "xml" suffix) that Tomcat deploys under.
     
    Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
    the value of filler advertising in 2020
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic