0

I'm migrating a Spring REST app WAR, that's running fine on a cPanel Tomcat 9 installation, to a Jelastic Tomcat 9 environment. All my content is returning 404's.

My first question is, what to put into the Jelastic Context field, during deployment? I have tried two different names: (1) ROOT- (e.g. ROOT-067) that Jelastic provides, and (2) my preferred webapp name. Both yield same 404 errors. When I study the webapps Directories, in both cases my WAR is correctly unpacked.

My second question is, do I need to modify the Tomcat conf/server.xml or conf/web.xml, that Jelastic generates? I have tried leaving them as originally generated, and making similar changes that I made to both files in the cPanel deployment. With the changed files, the Jelastic deployment fails due to Timeout error after 15 minutes.

Thanks for any and all help!

Bob

BobC
  • 353
  • 2
  • 5
  • 17

1 Answers1

0

Usually you don't have to do any changes in your server.xml / web.xml unless you need to have something very specific in it, did you try to set your context name just as ROOT (without index and a dash)? Could you please provide your environment name and a hosting service provider name? I will contact providers tech guys and we will investigate why that problem occurs. Will be glad to help.

Ihor Kolodyuk
  • 466
  • 2
  • 5
  • 1
    Hello Ihor - Yes, I did try the ROOT context name. In fact, I just removed your HelloWorld app, and deployed my app to ROOT context as the only app present. My WAR is exactly what I have deployed to cPanel. The Tomcat conf files server.xml and web.xml are in the original state supplied by Jelastic. My environment name is env-2853874, at massiveGRID. Here's a test link to my cPanel deployment: https://tanglemydata.com/tanglemydataapp/project_cont/project_testpage. Here's the Jelastic link that fails: https://tanglemydata.dev/tanglemydataapp/project_cont/project_testpage. I appreciate your help, – BobC May 03 '19 at 16:33
  • Dear Bob, please accept my apologies for long silence. It seems that mapping is missing in your war file for some reason, classically it is described in web.xml or in context.xml, but there is nothing that could map that given context to a jsp or a class. Do you mind if I will take your war file to our test lab and will check it there, including different versions of tomcat? Thank you for reporting a problem. – Ihor Kolodyuk May 07 '19 at 21:52
  • 1
    Hello Ihor - no problem on the delay. New environments always take time. As far as a missing mapping, e.g. web.xml or context.xml, Since Java Servlet 3.0, a mapping is not required if a WebApplicationInitializer is present. I am running Spring in this manner, and if you review the massiveGRID catalina.log, you will see that it is working. The current problem of 404s is due IMOH to a lack of HTTP to HTTPS redirect. My WAR is wired only for HTTPS, as a security measure, implementing CORS policy. Please feel free to do whatever is needed to solve. Thanks. – BobC May 08 '19 at 12:24
  • Hi Bob! Thank you for your patience. Looks like your servlet is accessible by the link https://tanglemydata.dev/project_cont/project_testpage that happened because by default Tomcat was using ROOT context. Thank you for the information about programatic mapping ;) Have a good day! – Ihor Kolodyuk May 14 '19 at 09:54
  • Hello Ihor - Yes, I now can access my app. I took my app out of ROOT, and redeployed it in my own container context, and all is working fine. ROOT will be used to deploy my Angular 5 app. I appreciate your team's help in getting this all going. – BobC May 16 '19 at 00:52