It is possible to bind and connect to localhost:8080 at the same time - application server will probably compete with some other software on the port
Should I be able to start Tomcat solely within IntelliJ and get the default Tomcat page to be displayed in Safari?
Right now I can only get the result on my MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports) running running 10.13.3 (17D102), if I start Tomcat v9.0.5 from terminal first using (/Library/Tomcat/bin/startup.sh) and then in IntelliJ (Ultimate 2017.3) I get message "It is possible to bind and connect to localhost:8080 at the same time - application server will probably compete with some other software on the port". Based on other posting in this forum that makes sense because Tomcat is already running. At the end of this process Safari (Version 11.0.3 (13604.5.6)) opens and the default Tomcat page is displayed...
However, if I do not start the server outside IntelliJ first and only start it from inside IntelliJ, I do not get message "It is possible to bind and connect to localhost:8080 at the same time - application server will probably compete with some other software on the port".
/Library/Tomcat/bin/catalina.sh run
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
01-Mar-2018 15:19:21.816 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.5
01-Mar-2018 15:19:21.818 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 6 2018 21:42:23 UTC
01-Mar-2018 15:19:21.819 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.5.0
01-Mar-2018 15:19:21.819 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
01-Mar-2018 15:19:21.819 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.13.3
01-Mar-2018 15:19:21.819 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
01-Mar-2018 15:19:21.819 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
01-Mar-2018 15:19:21.820 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 9.0.4+11
01-Mar-2018 15:19:21.820 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
01-Mar-2018 15:19:21.822 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/briangibson/Library/Caches/IntelliJIdea2017.3/tomcat/Tomcat_9_0_5_jsp
01-Mar-2018 15:19:21.829 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/apache-tomcat-9.0.5
01-Mar-2018 15:19:21.831 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
01-Mar-2018 15:19:21.832 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
01-Mar-2018 15:19:21.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/briangibson/Library/Caches/IntelliJIdea2017.3/tomcat/Tomcat_9_0_5_jsp/conf/logging.properties
01-Mar-2018 15:19:21.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
01-Mar-2018 15:19:21.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
01-Mar-2018 15:19:21.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
01-Mar-2018 15:19:21.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
01-Mar-2018 15:19:21.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
01-Mar-2018 15:19:21.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
01-Mar-2018 15:19:21.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
01-Mar-2018 15:19:21.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
01-Mar-2018 15:19:21.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
01-Mar-2018 15:19:21.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/briangibson/Library/Caches/IntelliJIdea2017.3/tomcat/Tomcat_9_0_5_jsp
01-Mar-2018 15:19:21.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Library/Tomcat
01-Mar-2018 15:19:21.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Library/Tomcat/temp
01-Mar-2018 15:19:21.837 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/briangibson/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
01-Mar-2018 15:19:21.908 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
01-Mar-2018 15:19:21.950 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
01-Mar-2018 15:19:21.962 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
01-Mar-2018 15:19:21.963 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
01-Mar-2018 15:19:21.964 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 814 ms
01-Mar-2018 15:19:22.093 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
01-Mar-2018 15:19:22.093 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.5
01-Mar-2018 15:19:22.128 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
01-Mar-2018 15:19:22.150 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
01-Mar-2018 15:19:22.156 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 191 ms
Connected to server
but when Safari opens I get 404.
HTTP Status 404 – Not Found
Type Status Report
Message Not found
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.5
Please sign in to leave a comment.
Hi, could you please provide a project example, I was not able to reproduce the problem with default tomcat project.
I think I have done what you requested. I created a project from scratch, verified it behaves as I described in my initial post and then shared it on GitHub. https://github.com/bravogolfgolf/servlets_and_jsp. Let me know if you need something else. Thanks for your help.
> Should I be able to start Tomcat solely within IntelliJ and get the default Tomcat page to be displayed in Safari?
Yes, by default IntelliJ IDEA doesn't deploy the default web applications installed on Tomcat, it deploys only the web app you are developing and configured per https://www.jetbrains.com/help/idea/developing-a-java-ee-application.html.
If you want the default web apps to be deployed as well, you have to enable this option:
I was so hopeful that was going to work as expected, but alas it did not resolve my issue. I still get the 404. However, when editing the configuration to check the deploy application box I noticed I have no artifacts configured warning. I'm new to all of this. Should I be able to run this configuration as it is above and expect to get the Tomcat default page? If yes, do you have any other suggestions? If no, how would I get to the default page so I can reference the documentation (i.e. is the another url besides http://localhost:8080 I could use to navigate to default tomcat page)?
I've verified that this configuration works fine and will deploy the default Tomcat applications and http://localhost:8080/ will open the standard Tomcat page:
You may need to wait until the default apps start up and then try to refresh the page, check the log in the Run panel:
Once you see the webapps\ROOT] has finished in [14] ms line, you should be able to access http://localhost:8080/.
Patience is a virtue. You were right. I just had to wait. Thanks.