Solved

Unable to open debugger port in Intellij idea

Posted on 2016-09-15
6
322 Views
Last Modified: 2016-10-06
HI,
when i try to run a remote debugging configuration on intellij idea its gives the following error :
Screen-Shot-2016-09-15-at-3.55.11-PM.pngThe configuration is :
Screen-Shot-2016-09-15-at-3.55.21-PM.pngI tried changing the port number also but didnt work.
I am starting my java application with :
sudo java -DFLOCK_APPS_CONFIG=config.samp -jar target/flock-notes.jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=12345

Although i am running this program on local machine but i creating a remote debug config on intellij this is because i am running my server on port 443 and for that i need to start the intellij with root permissions. which i want to avoid so i starting it from command line. and for debuggin purpose creating a debug configuration on intellij ...

Why this port error could be there.. This was not happening earlier but somehow it started happening now.

Thanks
0
Comment
Question by:Rohit Bajaj
  • 3
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 41800766
After starting your java app from the command line, try the following command and post back what it returns...

sudo netstat -ano | grep 12345

Open in new window

1
 

Author Comment

by:Rohit Bajaj
ID: 41801093
HI,
There is no ouput and o seems to be not an option :
 
DDVMACRO:~ ro$ netstat -an | grep 12345
DDVMACRO:~ ro$ netstat -ano | grep 12345
netstat: illegal option -- o
Usage:	netstat [-AaLlnW] [-f address_family | -p protocol]
	netstat [-gilns] [-f address_family]
	netstat -i | -I interface [-w wait] [-abdgRtS]
	netstat -s [-s] [-f address_family | -p protocol] [-w wait]
	netstat -i | -I interface -s [-f address_family | -p protocol]
	netstat -m [-m]
	netstat -r [-Aaln] [-f address_family]
	netstat -rs [-s]

Open in new window

0
 
LVL 35

Expert Comment

by:mccarl
ID: 41804353
Ok, the -o option is not really needed anyway. But the fact that you have no output means that for whatever reason your java app is not listening on that port. Can you double check the command line that you are starting it with and also make sure that it is really running? Until you get some output from the above command, IntelliJ will not work either.
0
 

Author Comment

by:Rohit Bajaj
ID: 41804958
There was a problem with my command. Although the application was running but it was not listening to 12345 . The following did the trick :
sudo java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=12345 -DFLOCK_APPS_CONFIG=config.sample -jar target/flock-notes.jar
Basically the arguments should have been provided earlier.

Also what is 12345 in this case ? Is it the socket number ?
Thanks
0
 
LVL 35

Expert Comment

by:mccarl
ID: 41805072
12345 is the port number. Just like your web server listens on port 80 (or 443 for https) and your ftp server listens on port 21. The debugging agent inside your Java app is listening for connections on port 12345.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Embarcadero C++ Builder XE10.1 Berlin red arrow Indicator 2 53
web application structure 18 96
maven module vs maven project 3 46
ejb example issues 3 20
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question