Search code examples
maventomcatintellij-idea

IntelliJ Unable to ping server at localhost:1099


I just get started to use a MacBook Pro Mid 2012 Release and trying to develop with IntelliJ. I use Tomcat 8 server for the deployment.

enter image description here

enter image description here

While I run the Tomcat, I get the following,

enter image description here

This 1099 comes from the JMX port in Run -> Edit Configurations. However, if I changed it to other port (say, 1098) doesn't help either.

I had this info as the output,

/Applications/Tomcat-8.5.15/bin/catalina.sh run
/Applications/Tomcat-8.5.15/bin/catalina.sh: line 366: /Applications/IntelliJ IDEA.app/Contents/bin/java: No such file or directory
Disconnected from server
/Applications/Tomcat-8.5.15/bin/catalina.sh: line 366: exec: /Applications/IntelliJ IDEA.app/Contents/bin/java: cannot execute: No such file or directory

Java related info,

$ which java 
/usr/bin/java

$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Project SDK was provided IntelliJ IDEA IU-171.4694.23, but, tried with the 1.8 as well. No success with both of the SDKs.

enter image description here

enter image description here

I TOOK TO FOLLOWING STEPS SO FAR WITH NO SUCCESS, —————————————————————————————

  1. Provided the permission to run catalina.sh,

Initially, I didn't have the permission to run the Tomcat and compiled the catalina.sh after entering the /bin folder inside the Tomcat directory with the command,

$ chmod a+x catalina.sh
  1. Appended the hostname in the /etc/hosts file,

I get the hostname from the terminal,

$ hostname
macbook-pro

/etc/hosts returns the following (Sublime),

$ subl /etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost       
255.255.255.255 broadcasthost   
::1             localhost

Inserted the macbook-pro information with the localhost,

127.0.0.1   localhost     macbook-pro
  1. Tried to kill the process (which I had success with MacBook Air earlier),

    $ ps -A | grep intellij

    $ ps -A | grep 1099

Every time get the different process info and could not kill the process.

What to do to solve the issue?

Update

I created a new project with the IntelliJ and now it runs fine with Tomcat. The previous project along with the IdeaProjects directory was imported from the other MacBook Air and pasted in the base directory. Though, I'm still unable to understand why that would be an issue.

My project is so far small (LOC < 1000 with 7 sources .java file). So, I'm manually creating the files and pasting the code inside from the main project. I will up for the REAL solution though.


Solution

  • I was also facing similar issue, For me the issue was related to invalid VM Options configuration in Intellij In Intellij Click on Run > Edit Configuration Server Tab You will notice VM Options My VM Options were -Dflyway.enabled=false -Dquratz.cron=0 0 2 1/1 * ?

    When I removed -Dquratz.cron=0 0 2 1/1 * ? Intellij started the server again and the above issue was resolved , Looks like you cannot pass special characthers in VM Options