1

I have searched everywhere for this. I'm sure I have read the information correctly but can't seem to get a full understanding of it.

I used this tutorial to get things going (https://www.jetbrains.com/help/idea/2016.3/creating-and-running-your-first-web-application.html). I do everything step by step but when it comes to running my web app, The localhost shows the official page of Tomcat and not my index.jsp that I have created. I've tried every path combination to try to get my index to show but I have had no luck.

I have done a lot of googling on this and it seems to be that when I run tomcat it reads the files from the webapps/ROOT folder instead of my project folder. How can I get my intellij or tomcat to read the files from my project? I keep reading that its my run configurations but everything looks good to me, and no one really shows what to actually do.

I wouldn't be asking unless I have tried doing this my self for hours. I'm sorry if it is really simple I just can't see it and would really appreciate your help. Thanks in advance

Structure (Ignore error messages)

Configuration

Artifacts

Deployment tab

I always get routed to this web

Artifact deployed successfully

Chang Yea Moon
  • 189
  • 1
  • 1
  • 10
  • maybe post pics of your current run configurations/project structure? – janDro Jun 18 '18 at 19:28
  • @janDro I have edited the post. – Chang Yea Moon Jun 18 '18 at 19:38
  • @ChangYeaMoon your screenshots do not show the artifacts configuration and the deployment tab with the context specified. – CrazyCoder Jun 18 '18 at 19:57
  • @CrazyCoder Okay, I added those now – Chang Yea Moon Jun 18 '18 at 20:05
  • @ChangYeaMoon please share the [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). Do you use the vanilla Tomcat installation or did you modify any of Tomcat configs/startup scripts? – CrazyCoder Jun 18 '18 at 20:06
  • @CrazyCoder Sorry just added now, and how do I share that? I just followed the link I provided. It is as minimal as it can get with code, and by following the tutorial i believe I have eliminated any issues that aren't relevant to the problem. I just want a way for tomcat to read the index.jsp file in my project file and not the index.jsp in it's ROOT folder. – Chang Yea Moon Jun 18 '18 at 20:09
  • @ChangYeaMoon deployment fails for some reason, check the server logs: https://stackoverflow.com/a/45666862/104891. – CrazyCoder Jun 18 '18 at 20:12
  • @CrazyCoder Sorry what is vanilla Tomcat? I used brew to install tomcat – Chang Yea Moon Jun 18 '18 at 20:12
  • @ChangYeaMoon "vanilla" means unmodified. MCVE means a zipped project directory that one can download, open on his machine and try to reproduce the problem you have. Try to download Tomcat .tar.gz, unpack it, configure in IntelliJ IDEA the unpacked location and use it instead of the Tomcat you've installed via brew. If the issue persists, share the server logs as described [here](https://stackoverflow.com/a/45666862/104891). – CrazyCoder Jun 18 '18 at 20:13
  • @CrazyCoder Sorry for the confusion the artifact error was from a past attempt at something else. I don't get any errors. I have also already using the unpacked location and get the same results. Do you want the server logs from CATALINA_BASE/logs? – Chang Yea Moon Jun 18 '18 at 20:19

1 Answers1

0

It looks like you already have Tomcat service started on port 8080, therefore IntelliJ IDEA cannot start another instance and perform the deployment.

You need to shut down the service running on port 8080 so that IDE can start its own copy of the server and perform the configuration/deployment on start.

brew services stop tomcat should help in your case.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904