Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot start app on tomcat with intellij

I am trying to run my web app with IDEA intellij and tomcat server. I downloaded tomcat server, paste it in program files, made CATALINA_HOME and edit path to %CATALINA_HOME%\bin; . My run config:

enter image description here

When I start tomcat server from bin/startup.bat and try to run project I got error Error running event: Address localhost:8080 already in use.

When I don't start tomcat with bat file first I got an error: Application server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099. When I run that bat script from tomcat and go to localhost:8080 i see tomcat start window.

like image 432
Spasoje Petronijević Avatar asked Mar 11 '23 06:03

Spasoje Petronijević


1 Answers

  1. check if you're using JDK 8 with Tomcat 9
  2. in your "Run Configuration", go to the tab "Deployment" and ensure that you've selected the correct war and chose a deployment path. For convenience, add the deployment path to the URL in the "After launch" section on the tab "Server"
  3. in your screenshot, on the tab "Server", I see there is no action defined in the section "Before launch". Did you delete it? By default, there are two entries like Build and Build 'simpleServlet:war' artifact. Add these entries by clicking on +
  4. before you start your web app via IntelliJ, ensure that Tomcat isn't running: open a browser and enter the URLhttp://localhost:8080 . There must be an error message "no connection" or similar. If you see the welcome page, stop Tomcat.
  5. run your application via IntelliJ enter image description here

enter image description here

like image 107
JimHawkins Avatar answered Mar 21 '23 08:03

JimHawkins