{"id":12172,"date":"2014-07-14T17:19:31","date_gmt":"2014-07-14T15:19:31","guid":{"rendered":"https:\/\/blog.trifork.com\/?p=12172"},"modified":"2014-07-14T17:19:31","modified_gmt":"2014-07-14T15:19:31","slug":"how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/","title":{"rendered":"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left;margin-right: 10px\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/intellijidea.jpg\" alt=\"Intellij Idea\" width=\"100\" height=\"100\">This post would look into how to tackle and debug issues in scenarios where they only occur in production (or other remote environment) but not in development environment. As anybody who has been in this kind of situation would acknowledge, trying to pinpoint the cause of these kind of &#8220;issues&#8221; might quickly end up being a practice at taking shots in the dark: a very time-consuming and inefficient process.<\/p>\n<p>It was this kind of situation I recently found myself, where, I had to rectify certain issues that were occurring in the production environment but could not be reproduced on the development machine.<\/p>\n<p>Fortunately enough, the said issues could be reproduced in the testing environments (which is as close to the production environment as possible). But having the issues reproducible in the test environment was good In that it confirms the issues needed to be fixed, but it was of little help in actually tracking the issues down, finding the cause and fixing it. Relying just on log outputs was not enough&#8230;What if I could debug the test environment from my machine?<\/p>\n<p><!--more--><br \/>\nIt was at this stage that I thought about remote debugging and if there exist the possibility of having an application run in a remote JVM and still be able to intercept its execution from the copy of the source code running on a local IDE: sounds just like what would get the job done.<\/p>\n<p>And sure this is very possible. I looked into what is needed; the set up and all. It did not sound complicated. So, together with the help of a colleague, Thijs Schnitger, was able to get it up and running without much hassles.<\/p>\n<p>This post thus describes the procedure of setting up the ability to remotely debug a JVM application from within an IDE. The post outlines the procedure using IntelliJ IDEA as the IDE, and the remote application to be debugged would be web application running on Tomcat. The steps outlined below should apply with any remote JVM application and any IDE, although the exact steps may differ, the general idea would remain same. The post also gives a brief overview of the technologies that makes remote debugging possible.<\/p>\n<h2>The Configuration Instructions<\/h2>\n<p>The process of getting remote debugging working involves two steps.<\/p>\n<ol>\n<li>Starting Tomcat with remote debugging enabled and<\/li>\n<li>having your IDE, in our case IntelliJ IDEA, to be able to debug the remote tomcat application.<\/li>\n<\/ol>\n<p>There are couple of ways to get the first part done and it slightly differs depending on which OS environment your Tomcat instance is running on. But, regardless of the method used, the main idea behind the configuration remains the same; which is: pass specific start up options to the JVM that would enable remote debugging.<\/p>\n<p>The JVM start up arguments needed to have remote debugging activated can be set via <em>JPDA_OPTS<\/em>, <em>CATALINA_OPTS<\/em> and <em>JAVA_OPTS<\/em> although using <em>JAVA_OPTS<\/em> is not usually advised, reason being that the setting specified via <em>JAVA_OPTS<\/em>, is exposed to all JVM applications, but with <em>CATALINA_OPTS<\/em> the settings defined is limited only to Tomcat.<\/p>\n<h3>USING JPDA_OPTS<\/h3>\n<p>Using the <em>JPDA_OPTS<\/em>, option you would have the needed start-up argument set in a file named setenv.sh (or setenv.bat if on windows). Create the file if it does not exist already. Have it in the <em>CATALINA_HOME\/bin<\/em> directory. And add this to the content:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&lt;br&gt;\nexport JPDA_OPTS=&amp;amp;quot;-agentlib:jdwp=transport=dt_socket, address=1043, server=y, suspend=n&amp;amp;quot;&lt;br&gt;\n<\/pre><\/p>\n<p>and if on Windows:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&lt;br&gt;\nset JPDA_OPTS=&amp;amp;quot;-agentlib:jdwp=transport=dt_socket, address=1043, server=y, suspend=n&amp;amp;quot;&lt;br&gt;\n<\/pre><\/p>\n<p>What these settings basically do is to enable remote debugging and configure available options: specifying the communication protocol between the running application and the debugger, (ie <em>transport=dt_socket<\/em>) the port at which the remote application should debugged (<em>ie address=1403<\/em>). The <em>server=y<\/em> setting indicates that this JVM would be the one to be debugged while <em>suspend=n<\/em> is used to tell the JVM to execute right away and not wait for an attached debugger. If set to &#8220;y&#8221; then the application would be suspended and not run until a debugger is attached.<\/p>\n<p>A good situation where you would want to have <em>suspend=y&nbsp;<\/em>is when debugging an issue that prevents an application from starting successfully, having <em>suspend=y<\/em> would make sure that the JVM waits for the remote debugger to connect before attempting to start and run the application.<\/p>\n<p>Although the settings can be put directly inside <em>catalina.sh<\/em> (or<em> catalina.bat<\/em>) it is always preferable to have extra configurations in the <em>setenv.*<\/em> file. It would be automatically be picked up by Tomcat.<\/p>\n<p>Note that another options you may encounter that may be used to enable remote debugging is:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=1043, suspend=n<\/pre><\/p>\n<p>The difference between this and the recommended setting is that the<em> -Xdebug<\/em> and <em>-Xrunjdwp<\/em> option is the old way of enabling remote debugging; it applies to JVM prior to JAVA 5.0 (JAVA 1.5.0) while -agentlib:jdwp option applies to JAVA 5.0 and beyond&#8230;And with this configuration in place, you can then start Tomcat via the command line arguments:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$CATALINA_HOME\/bin\/catalina.sh jpda start<\/pre><\/p>\n<h3>USING JAVA_OPTS OR CATALINA_OPTS<\/h3>\n<p>If you have Tomcat running as a windows service, then configuring Tomcat to start up with ability to be debugged remotely is done by simply specifying the start up arguments in the run properties.<\/p>\n<p>Open up the Apache Tomcat properties dialog box, and under the Java tab add the required start up option:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n<\/pre><\/p>\n<p><em>Make sure that each entry is on a new line and there are no spaces between the options<\/em><\/p>\n<p>With this added to the options, starting the Tomcat service would have remote debugging enabled.<\/p>\n<p>If per chance you are not running Tomcat on Windows as a service, to enable remote debugging, you need to specify the required options in the setenv.bat file:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">set CATALINA_OPTS=&amp;amp;quot;-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n&amp;amp;quot;<\/pre><\/p>\n<p>If you are running on linux you have:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">export CATALINA_OPTS=&amp;amp;quot;-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n&amp;amp;quot;<\/pre><\/p>\n<p>Start Tomcat like you would normally then do by running the <code>catalina.bat<\/code> or <code>catalina.sh<\/code> script.<\/p>\n<h3>STARTING TOMCAT WITH JPDA<\/h3>\n<p>Another way of running Tomcat with remote debugging is to use the JPDA switch, to start Tomcat; this would automactically have remote debugging enabled with its&nbsp;options set to default values.<\/p>\n<p>For example, this:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">catalina jpda start<\/pre><\/p>\n<p>would start Tomcat with the following settings:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n<\/pre><\/p>\n<p>But what if you want to change any of these default settings and still use the JPDA start switch? This can be done by setting the appropiate environment variable for the options as required by Tomcat. The environment variables are:<\/p>\n<p>JPDA_TRANSPORT: to specify JPDA transport used<br \/>\nJPDA_ADDRESS: to specify port for remote debugging<br \/>\nJPDA_SUSPEND: to specify if to suspend JVM after startup<\/p>\n<p>so running:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;export&amp;amp;amp;amp;amp;amp;amp;amp;nbsp;JPDA_ADDRESS=&amp;amp;quot;8080&amp;amp;quot; <\/pre><\/p>\n<p>and then<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">catalina jpda start<\/pre><\/p>\n<p>would have remote debugging possible on port 8080.<\/p>\n<h3>Configuring IntelliJ IDEA<\/h3>\n<p>With the remote JVM running the Tomcat started with the required start up arguments, the next thing to do is to configure the debugger in IntelliJ IDEA.<\/p>\n<p>There are two ways to this configuration: <em>The Remote Tomcat<\/em> settings options or <em>Remote settings<\/em> option.<\/p>\n<p><strong>Using The Remote Tomcat Settings Option.<\/strong><\/p>\n<p>Click on Run \u279d Edit Configuration:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12187 size-full\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug.png\" alt=\"intellij-remote-debug\" width=\"591\" height=\"242\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug.png 591w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-300x123.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The <em>Edit Configuration&#8230;<\/em> settings dialog box, pops up.<\/p>\n<p>Click on the <strong>+<\/strong> button on the top left \u279d Tomcat Server \u279d Remote. As shown below:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12190\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-2.png\" alt=\"intellij-remote-debug-2\" width=\"610\" height=\"512\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-2.png 864w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-2-300x252.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-2-768x644.png 768w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Next is to fill in the required settings.<\/p>\n<p>On the <strong>Server<\/strong> tab, specify the <em>host details<\/em> and the <em>port<\/em> the <em>remote<\/em> Tomcat is running on:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12193\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-3.png\" alt=\"intellij-remote-debug-3\" width=\"610\" height=\"383\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-3.png 778w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-3-300x189.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-3-768x483.png 768w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Then switch to the <strong>Startup\/Connection<\/strong> tab, where you would specify the details of the remote JVM needed to be debugged from intellij IDEA.<\/p>\n<p>Click on <strong>Debug<\/strong> and specify the port you specified while configuring the Tomcat; <em>1043<\/em> in our case.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12195\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-4.png\" alt=\"intellij-remote-debug-4\" width=\"610\" height=\"377\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-4.png 781w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-4-300x186.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-4-768x475.png 768w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>And that is it. Click on <strong>Ok<\/strong> to save your changes, then start the debugging session by pressing the debug icon or by using the keyboard shortcut <em>(shift + f9)<\/em><\/p>\n<p>If all the configuration is set up correctly, you should see a notice that the IDE has successfully connected to the target VM in the Debug tab in the bottom console:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12197\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-5.png\" alt=\"intellij-remote-debug-5\" width=\"610\" height=\"383\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-5.png 654w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-5-300x189.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Using the Remote settings option<\/strong><\/p>\n<p>Open the Edit Configuration settings as done in the previous option but instead of selecting the Remote Tomcat, select the Remote option:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12199 size-full\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-6.png\" alt=\"intellij-remote-debug-6\" width=\"352\" height=\"690\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-6.png 352w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-6-153x300.png 153w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The Remote settings dialog box appears where you can specify the required configuration; remote host, port, project etc:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-12201\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7.png\" alt=\"intellij-remote-debug-7\" width=\"610\" height=\"394\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7.png 1102w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7-300x194.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7-1024x662.png 1024w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/intellij-remote-debug-7-768x496.png 768w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>As you can see from above, the interesting thing about the Remote option is that, apart from allowing you to configure intelliJ IDEA, it also list the various configurations required to start up the remote JVM in other for remote debugging to work. Might come in handy.<\/p>\n<p>Specify the required settings, click <strong>Ok<\/strong> to save changes, and start the debugging session. You should also see the notice that IntelliJ has successfully connected to the remote VM.<\/p>\n<p>Once this is done, you should then open the source code of the application you have running on the remote Tomcat, put a breakpoint where required and you can go ahead and start debugging as if the application is running on your local machine.<\/p>\n<p>So that is it with the configuration, the next question is, what makes all these fit and work together?<\/p>\n<p>Let us take a quick work through of the technology at play that makes remote debugging JVM possible.<\/p>\n<h2>How Remote JVM Debugging Works<\/h2>\n<p>It all starts with what is referred to as Agents.<\/p>\n<p>The JVM, which runs the complied <code>.class<\/code> sources has a feature that allows externally libraries (written in either Java or C++) to be injected into the JVM, just about runtime. These external libraries are referred to as Agents and they have the ability to modify the content of the .class files been run. These Agents have access to functionality of the JVM that is not accessible from within a regular Java code running inside the JVM and they can be used to do interesting stuff like injecting and modify the running source code, profiling etc. Tools like JRebel makes use of this piece of functionality to achieve their magic.<\/p>\n<p>And to pass an Agent Lib to a JVM, you do so via start up arguments, using the <em>-agentlib:libname[=options]<\/em> format.<\/p>\n<p>So in the configuration we had above:<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&lt;br&gt;\n-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n&lt;br&gt;\n<\/pre><\/p>\n<p>We were actually passing an Agent Lib named jdwp to the JVM running Tomcat. The jdwp is a JVM specific, optional implementation of the JDWP (Java Debug Wire Protocol) that is used for defining communication between a debugger and a running JVM. It&#8217;s implementation, if present is supplied as a native library of the JVM as either jdwp.so or jdwp.dll<\/p>\n<p>So what does it do?<\/p>\n<p>In simple terms, the jdwp agent we pass is basically serving the function of being a link between the JVM instance running an application and a Debugger (which can be located either remote or local). Since it is an Agent Library, It does have the ability to intercept the running code, create a bridge between the JVM and a debugger, and have the functionality of a debugger applied on the JVM.<\/p>\n<p>Since in the JVM architecture, the debugging functionality is not found within the JVM itself but is abstracted away into external tools (that are aptly referred to as debuggers), these tools can either reside on the local machine running the JVM being debugged or be run from am external machine. It is this de-coupled, modular architecture that allows us to have a JVM running on a remote machine and using the JDWP, have a remote debugger be able to communicate with it.<\/p>\n<p>When IntelliJ IDEA was configured above, what was actually been done is to specify to the debugger tool within IntelliJ IDEA the host where the running JVM it needs to debug resides and the port through which it should connect with.<\/p>\n<p>All the specification that outlines this modular architecture is contained in what is referred to as the Java Platform, Debugger Architecture, JPDA (this explains the JPDA in the JPDA_OPTS method used above) and you can read a much detailed overview of it here: <a title=\"Java Platform Debugger Architecture Overview\" href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/technotes\/guides\/jpda\/architecture.html\" target=\"_blank\" rel=\"noopener\">Java Platform Debugger Architecture Overview<\/a>.<\/p>\n<p>&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bit.ly\/3BAo305\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"256\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\" alt=\"\" class=\"wp-image-20303\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png 1024w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-300x75.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-768x192.png 768w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1536x384.png 1536w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-2048x512.png 2048w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1920x480.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This post would look into how to tackle and debug issues in scenarios where they only occur in production (or other remote environment) but not in development environment. As anybody who has been in this kind of situation would acknowledge, trying to pinpoint the cause of these kind of &#8220;issues&#8221; might quickly end up being [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":19044,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[337,31,10],"tags":[387,186,11,388,389,216],"class_list":["post-12172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-from-the-trenches","category-java","category-development","tag-debug","tag-intellij","tag-java","tag-jpda_opts","tag-remote","tag-tomcat"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog<\/title>\n<meta name=\"description\" content=\"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-14T15:19:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1145\" \/>\n\t<meta property=\"og:image:height\" content=\"477\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dadepo Aderemi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dadepo Aderemi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/\",\"url\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/\",\"name\":\"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg\",\"datePublished\":\"2014-07-14T15:19:31+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/f275c60bdcc2d9e5358c3bad1b6016c9\"},\"description\":\"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.\",\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage\",\"url\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg\",\"contentUrl\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg\",\"width\":1145,\"height\":477,\"caption\":\"IntelliJ IDEA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/f275c60bdcc2d9e5358c3bad1b6016c9\",\"name\":\"Dadepo Aderemi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5824931dc959461b2703d8d4322891ef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5824931dc959461b2703d8d4322891ef?s=96&d=mm&r=g\",\"caption\":\"Dadepo Aderemi\"},\"sameAs\":[\"http:\/\/www.trifork.nl\"],\"url\":\"https:\/\/trifork.nl\/blog\/author\/dadepoa\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog","description":"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/","og_locale":"en_US","og_type":"article","og_title":"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog","og_description":"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.","og_url":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/","og_site_name":"Trifork Blog","article_published_time":"2014-07-14T15:19:31+00:00","og_image":[{"width":1145,"height":477,"url":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg","type":"image\/jpeg"}],"author":"Dadepo Aderemi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dadepo Aderemi","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/","url":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/","name":"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage"},"thumbnailUrl":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg","datePublished":"2014-07-14T15:19:31+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/f275c60bdcc2d9e5358c3bad1b6016c9"},"description":"This post looks at how to tackle and debug issues in scenarios where they only occur in production but not in development environment.","breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#primaryimage","url":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg","contentUrl":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2014\/07\/IntelliJIDEA-new.jpg","width":1145,"height":477,"caption":"IntelliJ IDEA"},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Remotely Debug Application Running on Tomcat From Within Intellij IDEA"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/f275c60bdcc2d9e5358c3bad1b6016c9","name":"Dadepo Aderemi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5824931dc959461b2703d8d4322891ef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5824931dc959461b2703d8d4322891ef?s=96&d=mm&r=g","caption":"Dadepo Aderemi"},"sameAs":["http:\/\/www.trifork.nl"],"url":"https:\/\/trifork.nl\/blog\/author\/dadepoa\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/12172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=12172"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/12172\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media\/19044"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=12172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=12172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=12172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}