From fbcee7ea2d0abb42d319c7ae1449aedd15e53a4d Mon Sep 17 00:00:00 2001 From: Greg Poulos Date: Tue, 14 Feb 2023 12:25:28 -0800 Subject: [PATCH] remove sections on debugging with IntelliJ and Eclipse --- .../asciidoc/old_docs/debugging/chapter.adoc | 8 --- .../debugging/debugging-with-eclipse.adoc | 54 ---------------- .../debugging/debugging-with-intellij.adoc | 64 ------------------- .../debugging/enable-remote-debugging.adoc | 13 +--- 4 files changed, 3 insertions(+), 136 deletions(-) delete mode 100644 documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-eclipse.adoc delete mode 100644 documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-intellij.adoc diff --git a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/chapter.adoc b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/chapter.adoc index 410e026a66c..2852a53b7ad 100644 --- a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/chapter.adoc +++ b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/chapter.adoc @@ -14,12 +14,4 @@ [[advanced-debugging]] == Debugging -=== Options - -Given how flexible Jetty is in how it can be configured and deployed into development and production, there exists a wealth of different options for debugging your application in you favorite environment. -In this section we will gather up some of these different options available and explain how you can use them. -If you would like to contribute to this section simply fork the repository and contribute the information, or open a github issue with the information and we'll bring it over. - include::enable-remote-debugging.adoc[] -include::debugging-with-intellij.adoc[] -include::debugging-with-eclipse.adoc[] diff --git a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-eclipse.adoc b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-eclipse.adoc deleted file mode 100644 index f8015e8da6d..00000000000 --- a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-eclipse.adoc +++ /dev/null @@ -1,54 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License v. 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 -// which is available at https://www.apache.org/licenses/LICENSE-2.0. -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -[[debugging-with-eclipse]] -=== Debugging With Eclipse - -There are a number of options available to debug your application in Eclipse. - -If not done already prepare your application for remote debugging as described here: xref:enable-remote-debugging[] - -==== Linking with Eclipse - -Next we need to link the Eclipse project with the deployed webapp. - -1. Within Eclipse, right-click on the project containing the webapp deployed into jetty and select *Debug -> Debug Configurations* and create a new configuration of **Remote Java Application**. -Make sure the port you choose is the same as the one you added in xref:enable-remote-debugging[]. -+ -image:debug-eclipse-1.png[image,width=576] - -2. Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your Eclipse instance. -+ -image:debug-eclipse-2.png[image,width=576] - -3. Accessing that servlet within your browser, pointed at your remote debug configurated jetty-home, should transition your Eclipse instance to the standard Debug view. -+ -image:debug-eclipse-3.png[image,width=576] - -[[eclipse-within-eclipse]] -==== Within Eclipse - -Since Jetty can be incredibly simple to embed, many people choose to create a small `main` method which they can launch directly within Eclipse in order to more easily debug their entire application. -The best place to get started on this approach is to look through xref:embedding-jetty[] and the xref:embedded-examples[] sections. - -Once you have a main method defined in order to launch your application, right-click on the source file and select**Debug As -> Java Application**. -In your *Console* tab within Eclipse you should see your application startup and once it has completed startup you should be able to configure breakpoints and hit the Jetty instance as normal via your web browser. - -____ -[TIP] -You can easily configure logging through a `jetty-logging.properties` -file. If this file is on your classpath then Jetty will use it for -configuring logging, we use this approach extensively throughout Jetty -development and it makes life ever so much easier. You can see this in -action in the xref:configuring-jetty-stderrlog[] section. -____ diff --git a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-intellij.adoc b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-intellij.adoc deleted file mode 100644 index d622900d512..00000000000 --- a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/debugging-with-intellij.adoc +++ /dev/null @@ -1,64 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License v. 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 -// which is available at https://www.apache.org/licenses/LICENSE-2.0. -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -[[debugging-with-intellij]] -=== Debugging With IntelliJ - -There are a number of options available to debug your application in IntelliJ. - -If not done already prepare your application for remote debugging as described here: xref:enable-remote-debugging[] - -==== Linking with IntelliJ - -Next we need to link the IntelliJ project with the deployed webapp. - -1. Within IntelliJ, open the project containing the webapp deployed into jetty that you want to debug. Select**Run -> Edit Configurations**. -Add a new configuration by clicking the "+" icon. Choose **Remote**. -Make sure the port you choose is the same as the one you added in xref:enable-remote-debugging[]. -+ -image:intellij_new_remote_config.png[image,width=800] - -2. Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your IntelliJ instance. -To set a breakpoint, simply open the servlet or any other class you want to debug and click left to the line you want to set the breakpoint at (where the red dot is on the next screenshot). -The red dot and red background on the line mark the breakpoint. -+ -image:intellij_set_breakpoint.png[image,width=800] - -3. Accessing that servlet within your browser, pointed at your remote debug configured jetty-home, should transition your IntelliJ instance to the standard debugger view. -+ -image:intellij_debug_view.png[image,width=800] - -[[intellij-within-intellij]] -==== Within IntelliJ - -Since Jetty can be incredibly simple to embed, many people choose to create a small `main` method which they can launch directly within IntelliJ in order to more easily debug their entire application. -The best place to get started on this approach is to look through xref:embedding-jetty[] and the xref:embedded-examples[] sections. - -Once you have a main method defined in order to launch your application, open the source file and right-click the main method. -Select *Debug* or simply hit CTRL+SHIFT+D. -In your *Console* tab within IntelliJ you should see your application startup and once it has completed startup you should be able to configure breakpoints and hit the Jetty instance as normal via your web browser. -The same thing works for unit tests. -Instead of the main method run debug on the test method you want to debug. - -image:intellij_select_debug.png[image,width=800] - -Debugging in IntelliJ is extremely powerful. -For example it's possible to have conditional breakpoints that only trigger a break if the configured conditions are met. -Have a look at the various tutorials in the internet or the http://www.jetbrains.com/idea/webhelp/getting-help.html[IntelliJ documentation] for further details. - -____ -[TIP] -You can easily configure logging through a `jetty-logging.properties` file. -If this file is on your classpath then Jetty will use it for configuring logging, we use this approach extensively throughout Jetty development and it makes life ever so much easier. -You can see this in action in the xref:configuring-jetty-stderrlog[] section. -____ diff --git a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/enable-remote-debugging.adoc b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/enable-remote-debugging.adoc index d760c0b02b1..71372aa5375 100644 --- a/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/enable-remote-debugging.adoc +++ b/documentation/jetty-documentation/src/main/asciidoc/old_docs/debugging/enable-remote-debugging.adoc @@ -35,10 +35,10 @@ Via command line:: + [source, screen, subs="{sub-order}"] .... - + $ java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar start.jar - + .... Via `start.ini`:: @@ -74,7 +74,7 @@ Via `start.ini`:: # -XX:+PrintCommandLineFlags # -XX:+DisableExplicitGC - + ---- + Uncomment any other jvm environmental options you so desire for your debugging session. @@ -86,10 +86,3 @@ Uncomment any other jvm environmental options you so desire for your debugging s Listening for transport dt_socket at address: 9999 ---- - -===== Linking with your IDE - -Refer to the documentation for your ide: - -* xref:debugging-with-intellij[] -* xref:debugging-with-eclipse[]