When attempting to debug I get the following error:
could not establish debug connection to localhost : 10123
Failed to connect to remote VM. Connection refused.
Connection refused: connect
I use the following command to start the instance: java -Xms2048m -Xmx2024m -agentlib:jdwp=transport=dt_socket,address=10123,server=y,suspend=n -jar aem-author-p4502.jar
My debug port is 10123 and I have "resolve sources when connecting" unchecked.
The server is up an running. Other folks have pointed to articles on this page, but they appear to not be here.
Please help
Thanks,
Glenn
Solved! Go to Solution.
Views
Replies
Total Likes
I am using below steps to debug -
Go to bin folder in crx-quickstart and change the line 25 in start.bat by adding the highlighted part here (address port number can be any number of your choice)
if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=10123
Change line no. 44 by adding this
set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar,debug
Save the file.
Once saved open the command prompt, go to \crx-quickstart\bin and type “start.bat”, once it’s done you’ll see another window of cmd being opened and the server will start in debug mode as seen below
Check if the server is started or not by opening localhost:4502 in the browser
Setting up the debug config in eclipse
Go to Run -> Debug Configurations -> Remote Java Application
Set up a new configuration like seen below by selecting the project (mostly it’ll be core) and click Debug
Eclipse by default will suspend execution on uncaught exceptions which will debug the code which we haven’t even selected. This will waste our time. So please do this to avoid it
Go to Windows - > Preferences -> Java -> Debug and uncheck “Suspend execution on uncaught exceptions”
Set debug points in your code and explore! Try this and let me know whether it helps or not.
I am using below steps to debug -
Go to bin folder in crx-quickstart and change the line 25 in start.bat by adding the highlighted part here (address port number can be any number of your choice)
if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=10123
Change line no. 44 by adding this
set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar,debug
Save the file.
Once saved open the command prompt, go to \crx-quickstart\bin and type “start.bat”, once it’s done you’ll see another window of cmd being opened and the server will start in debug mode as seen below
Check if the server is started or not by opening localhost:4502 in the browser
Setting up the debug config in eclipse
Go to Run -> Debug Configurations -> Remote Java Application
Set up a new configuration like seen below by selecting the project (mostly it’ll be core) and click Debug
Eclipse by default will suspend execution on uncaught exceptions which will debug the code which we haven’t even selected. This will waste our time. So please do this to avoid it
Go to Windows - > Preferences -> Java -> Debug and uncheck “Suspend execution on uncaught exceptions”
Set debug points in your code and explore! Try this and let me know whether it helps or not.
@geverett , the above mentioned solution by @DEBAL_DAS is appropriate and should work, however make sure :
Thanks.
I followed the above recommendations, and still I'm getting an error trying to connect.
My start.bat has the lines:
if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx4096m -XX:MaxPermSize=256M -Djava.awt.headless=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=10123
and
set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar,debug
After starting the server, when I click on the debug option I get the following error.
Views
Replies
Total Likes
Are you trying to define a new server like below one -
I didn't add server explicitly. After making necessary change in start.bat file I just opened the command prompt, go to \crx-quickstart\bin and type “start.bat” and press enter.
Views
Replies
Total Likes
Here you could see I am able to debug -
Views
Replies
Total Likes