IntelliJ Unable to ping server at localhost:1099 - maven

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.
While I run the Tomcat, I get the following,
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.
I TOOK TO FOLLOWING STEPS SO FAR WITH NO SUCCESS,
—————————————————————————————
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
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
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.

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

Similar case - just because forgot to add by mistake -D before VM options configuration, i.e:
Instead of DB_USER=User should be -DDB_USER=User
Foolish mistake :)

Check if your Tomcat contains the file setenv.sh ([YOUR_CATALINA_HOME]/bin/setenv.sh) or check catalina.sh; it may redefine the CATALINA_OPTS / JAVA_OPTS variable that IntelliJ uses to set up JMX. Your JMX port config (*-Dcom.sun.management.jmxremote.port*) in the file (setenv.sh / catalina.sh) should be the same as in IntelliJ:
CATALINA_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1 ${CATALINA_OPTS}"

In my case I used ; as separator in VM options in mac os. I added \ to it and error disappeared:
-Dsome.props=prop1\;prop2\;prop3

Related

Cannot access Flink dashboard localhost:8081 on windows

I follow the first steps to install Flink.
I can start the cluster without any problem
$ start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host DESKTOP-....
Starting taskexecutor daemon on host DESKTOP-....
But I don't get any status from
$ ps aux | grep flink
I can also not access the dashboard via localhost:8081.
There is an older post having these issues, but the solution didn't work for me, since the described conf files do no longer exist, apparently.
My JAVA_HOME is set as C:\Progra~1\Java\jdk1.8.0_311 to avoid issues with the space in Program Files.
Can you check the logs in the /logs folder? I'm suspecting that C:\Program Files\ could still cause issues because of the space there.
go to download Flink folder and try bash command
$./bin/start-cluster.sh --daemon bootstrap-server localhost:8081
and run code one more
$ ./bin/flink run examples/streaming/WordCount.jar
if you finished run above code which not issue, go to localhost:8081
This still seems to be problematic. I tried to run from Windows Subsystem for Linux (WSL).
I have the following versions: java 11.0.16 and flink 1.15.2.
sudo apt-get update
sudo apt install openjdk-11-jre-headless
export FLINK_HOME=/mnt/c/Projects/Apache/flink-1.15.2
I set the following in flink-conf.yaml
rest.port: 8081
rest.address: localhost
rest.bind-adress: 0.0.0.0
Whereby I changed the bind address for localhost to 0.0.0.0 this seems to have fixed the problem.
$FLINK_HOME/bin/start-cluster.sh
Now I can access the Flink Web Dashboard.

Running Tomcat from windows 10 bash shell

I installed tomcat server on windows10 bash shell. Though it says apache is running.. its not opening admin panel in browser. Browser says 'Connection can't be reached'
Have someone tried this ever before? Please share your inputs.
Thank you
I am assuming you are referring to Bash for Windows (Ubuntu) on Windows 10. Yes Tomcat server can be installed and run from Bash for Windows with no need to install Tomcat in the Windows environment.
First, you may want to check if any local server is running on Windows 10 port 8080 - the default port for Tomcat, or whatever port you are configuring Tomcat for.
Second, open BASH for Windows and install Java. I used Oracle Java JDK 8 (http://www.oracle.com/technetwork/java/javase/downloads/index.html) and downloaded the tar.gz file.
Extract the tar.gz and copy to a standard directory like /usr/local/java or in the /opt/ directory for easy access.
Create JAVA_HOME and JRE_HOME environment variables that link to your java location.
I also updated the alternatives to map java, javac, and javaws. You can use this link to assist (http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre)
Then download the tar.gz of Tomcat. Again, I used Tomcat 8.5 for my scenario and extract the files to your chosen directory.
Last, run the startup script located in the bin folder of the tomcat extracted folder. You should have a working Tomcat version.
Use the curl command to validate - curl localhost:8080
If you want to change the admin privileges, edit the tomcat-users.xml file located in the conf folder within the extracted tomcat directory.
Access to the tomcat server can also be done through the Windows system and not just through the Bash for Windows CLI.
Hope this helps!

Intellij not respecting vm settings upon startup

On El Capitan (osx) here with the following in ~/Library/Preferences/IntelliJIdea2016.2/idea.vmptions :
-Xms1280m
-Xmx2000m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
-XX:+UseCompressedOops
-Dide.mac.file.chooser.native=false
However upon restarting Intellij we see the following setting: -Xmx768m . So IJ is ignoring the idea.vmptions file .. ? What is the proper procedure to update those VM settings?
Update I also tried changing the values in
sudo vi /Applications/IntelliJ\ IDEA.app/Contents/bin/idea.vmoptions
That also had no effect: still the same -Xmx768m shows up under ps -ef | grep ntellij
Update The answer from #morfic inroduced a capability from Intelli to use Help | Edit custom VM options. However the values shown there are identical to the ones above (e.g. -Xmx2000m) and not respected.

Error in sonar startup, Unable to start JVM: No such file or directory (2)

I am facing strange issue with sonarqube 5.0.1 , one one of the machine it is not starting. Here is the error log - sonar.log -
--> Wrapper Started as Daemon
Launching a JVM...
Unable to start JVM: No such file or directory (2)
JVM exited while loading the application.
JVM Restarts disabled. Shutting down.
<-- Wrapper Stopped
Machine is x86_64 GNU/Linux - Centos 5.1.
this box has java installed -
$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
The same sonarqube package works on another machine.
Any idea what could be the issue here?
Thanks.
Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path - ‘wrapper.java.command=/path/to/my/jdk/bin/java’
This could be an issue with an environment on a host.. not sure.
Few things that helped me in troubleshooting this -
log level changed to DEBUG in wrapper.conf
comments given in the wrapper.conf!
Thanks all for chiming in! Appreciate your inputs.
1.Just close all running jvm from task manager
2. Change the port of the sonar runner from the properties
I had the same symptoms (wrapper starts then immediately stops).
I tried these steps and finally succeeded (on a windows 10 pc):
1) in wrapper.conf, specified the java command:
wrapper.java.command=C:\Program Files\Java\jdk1.7...\bin\java.exe
That did not help.
2) Finally this fixed the problem. In the windows Services, open the Sonar service and then open Log On tab.
Changed the Log On to myself as follows:
I was facing the same issue on sonar startup. After reading this post , i modified the JDK path in below file and it works.
Modify the JDK path in wrapper.conf
wrapper.java.command=%JAVA_HOME%/bin/java
Install jdk 11
sudo yum install java-11-openjdk -y
sudo alternatives --config java
Select the JDK 11 version
Set the JDK 11 version in wrapper.conf
vi /opt/sonar/conf/wrapper.conf
wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java
Could you verify the Java version on the machine starting?
Java 6 is no more supported http://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite but from your error message, I don't know if this is the problem you meet.
Solution 1
Set java path globally
Solution 2
Go to sonarqube-{version}/conf directory
Edit wrapper.conf file
Replace wrapper.java.command=java with wrapper.java.command= {path-to-your-java-bin-directory}/java
eg: wrapper.java.command=/usr/java/bin/java
Try using a relative path, if your Sonar Folder is located in the same root folder as your jdk. For me my sonar and jdk are both under "Program Files", which has restrictive permission, hence the error.
E.g:
wrapper.java.command=../../../Java/jdk-11.0.4/bin/java

Can't setup remote debugging with JBoss Web 2.1.4 windows and eclipse

I'm unable to find an option to setup remote debugging in JBossWeb 2.1.4 on Windows. It is not installed as a service and there are no .bat scripts where I can edit the JAVA_OPTS environment variable to include:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142
The only thing in the jboss web bin directory are jbossweb.exe files.
I've tried editing the run configuration in eclipse to start the container by running jbossweb.exe and setting the environment variable JAVA_OPTS to the above, but it doesn't listen on port 4142 on startup (ie, there seems to be no effect in adding the environment variable to the run configuration).
Any ideas here?
If you control the server from eclipse with for instance JBoss Tools, you can just click "debug" instead of "start" in the Server pane in order to start up in debug mode.
You can create such bat script by yourself. Just add jboss.bat file to bin subdirectory of JBoss install directory and put there:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142 -jar "D:\JBoss.org\JBoss Web 2.1\bin\bootstrap.jar" start
When you run this script, you will get JBoss running in debug mode. Probably, it won't help you in all situations, but it worked for me.

Resources