You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2014/09/15 20:03:16 UTC

svn commit: r922293 - in /websites/staging/tomee/trunk: cgi-bin/ content/ content/contrib/ content/contrib/debug/

Author: buildbot
Date: Mon Sep 15 18:03:15 2014
New Revision: 922293

Log:
Staging update by buildbot for tomee

Added:
    websites/staging/tomee/trunk/content/contrib/
    websites/staging/tomee/trunk/content/contrib/debug/
    websites/staging/tomee/trunk/content/contrib/debug/debug-intellij.html
    websites/staging/tomee/trunk/content/contrib/debug/idea1.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea10_debug_conf.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea2.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea3.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea4.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea6.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea7.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea8.png   (with props)
    websites/staging/tomee/trunk/content/contrib/debug/idea9.png   (with props)
Modified:
    websites/staging/tomee/trunk/cgi-bin/   (props changed)
    websites/staging/tomee/trunk/content/   (props changed)

Propchange: websites/staging/tomee/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Sep 15 18:03:15 2014
@@ -1 +1 @@
-1625010
+1625098

Propchange: websites/staging/tomee/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Sep 15 18:03:15 2014
@@ -1 +1 @@
-1625010
+1625098

Added: websites/staging/tomee/trunk/content/contrib/debug/debug-intellij.html
==============================================================================
--- websites/staging/tomee/trunk/content/contrib/debug/debug-intellij.html (added)
+++ websites/staging/tomee/trunk/content/contrib/debug/debug-intellij.html Mon Sep 15 18:03:15 2014
@@ -0,0 +1,315 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title></title>
+    <meta name="description" content="Apache TomEE">
+    <meta name="author" content="Apache TomEE">
+    <meta name="google-translate-customization" content="f36a520c08f4c9-0a04e86a9c075ce9-g265f3196f697cf8f-10"></meta>
+    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
+    <META HTTP-EQUIV="Expires" CONTENT="-1">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le styles -->
+    <link href="./../../resources/css/bootstrap.css" rel="stylesheet">
+    <link href="./../../resources/css/prettify.css" rel="stylesheet">
+    <link href="./../../resources/css/bootstrap-mods.css" rel="stylesheet">
+    <link href="./../../resources/css/main.css" rel="stylesheet">
+
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../../resources/images/favicon.ico">
+    <link rel="apple-touch-icon" href="./../../resources/images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="./../../resources/images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="./../../resources/images/apple-touch-icon-114x114.png">
+
+    <script src="./../../resources/js/prettify.js" type="text/javascript"></script>
+    <script src="./../../resources/js/jquery-latest.js"></script>
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <script src="./../../resources/js/common.js"></script>
+    <script src="./../../resources/js/prettyprint.js"></script>
+
+    <script type="text/javascript">
+
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-2717626-1']);
+      _gaq.push(['_setDomainName', 'apache.org']);
+      _gaq.push(['_trackPageview']);
+
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+
+    </script>
+  </head>
+
+  <body>
+
+    <div class="topbar" data-dropdown="dropdown">
+      <div class="fill">
+        <div class="container">
+          <a class="brand" href="./../../index.html">Apache TomEE</a>
+          <ul class="nav">
+              <li class="dropdown">
+                  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
+                  Apache
+                      <b class="caret"></b>
+                  </a>
+                  <ul class="dropdown-menu">
+                     <!-- <li><a href="./../../misc/whoweare.html">Who we are?</a></li> -->
+                     <!-- <li><a href="./../../misc/heritage.html">Heritage</a></li> -->
+                     <li><a href="http://www.apache.org">Apache Home</a></li>
+                     <!-- <li><a href="./../../misc/resources.html">Resources</a></li> -->
+                     <li><a href="./../../misc/contact.html">Contact</a></li>
+                     <li><a href="./../../misc/legal.html">Legal</a></li>
+                     <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+                     <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+                     <li class="divider"/>
+                     <li><a href="http://www.apache.org/security">Security</a></li>
+                  </ul>
+              </li>
+              <li><a href="./../../index.html">Home</a></li>
+              <li><a href="./../../downloads.html">Downloads</a></li>
+              <li><a href="./../../documentation.html">Documentation</a></li>
+              <li><a href="./../../examples-trunk/index.html">Examples</a></li>
+              <li><a href="./../../support.html">Support</a></li>
+              <li><a href="./../../contribute.html">Contribute</a></li>
+              <li><a href="./../../security/index.html">Security</a></li>
+          </ul>
+
+            <!-- Google CSE Search Box Begins  -->
+            <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+                <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+                <INPUT type="hidden" name="cof" value="FORID:0">
+                <INPUT size="18" width="130" style="width:130px" name="q" type="text" placeholder="Search">
+            </FORM>
+            <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+            <!-- Google CSE Search Box Ends -->
+        </div>
+      </div>
+    </div>
+
+    <div class="container">
+    
+
+<div class="page-header">
+    <small><a href="./../../index.html">Home</a>&nbsp;&raquo&nbsp;<a href="./../../contrib/">Contrib</a>&nbsp;&raquo&nbsp;<a href="./../../contrib/debug/">Debug</a></small><br>
+    <h1>
+
+        <div style="float: right; position: relative; bottom: -10px; ">
+            <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+            <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+            <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+            <a data-toggle="modal" href="#edit" class="edit-page" title="Contribute to this Page">contribute</a>
+        </div>
+    </h1>
+</div>
+
+<p><a name='DEBUGIDE'></a></p>
+
+<h1>Debugging an Apache TomEE App in Intellij IDEA</h1>
+
+<p>Stepping through the <a href="http://tomee.apache.org/apache-tomee.html">TomEE</a> source code is a must-to-follow step if you want to understand how TomEE works and later contribute. This is a guide to quickly start your debugging session with TomEE as a TomEE developer.</p>
+
+<p>This guide assumes that:</p>
+
+<ul>
+<li>Linux is the OS</li>
+<li>IntelliJ IDEA 13.1.3 is the IDE</li>
+<li>Maven 3.0.5 or better is installed </li>
+</ul>
+
+<h3>Download the Source Code</h3>
+
+<p>For beginners I will recommend not to start with the trunk, because It is normal to have some blockers or non-stable functionality which may bring your learning to a halt. So first start with the latest stable released source code. Go to trunk once you are ready to do some code modification on TomEE.</p>
+
+<p><a href="http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.7.1/openejb-4.7.1-source-release.zip">Click here to download TomEE 1.7.1 Source code</a></p>
+
+<h3>Build the Source Code</h3>
+
+<p>First extract the zip file named <strong>openejb-4.7.1-source-release.zip</strong> to any location. Lets assume it is your home folder.</p>
+
+<blockquote>
+  <p>unzip openejb-4.7.1-source-release -d ~</p>
+</blockquote>
+
+<p>The above command will create the <strong>openejb-4.7.1</strong> directory in your home directory.</p>
+
+<p>Even though you can do a full build, We will run the following command to do a quick build so that you can have your meal before your hunger kills you.</p>
+
+<blockquote>
+  <p>mvn -Pquick -Dsurefire.useFile=false -DdisableXmlReport=true -DuniqueVersion=false -ff -Dassemble -DskipTests -DfailIfNoTests=false clean install</p>
+</blockquote>
+
+<p>More details about building the product from the source can be found <a href="http://tomee.apache.org/dev/source-code.html">here</a>.</p>
+
+<h3>Deploy TomEE</h3>
+
+<p>The TomEE build builds several distributions (zip &amp; war files) to cater the different needs of different users. Here we discuss about the tomee plus distribution &amp; TomEE war distribution only. TomEE+ is the full feature packed distribution from TomEE.</p>
+
+<p>TomEE+ zip location:</p>
+
+<blockquote>
+  <p>~/openejb-4.7.1/tomee/apache-tomee/target/apache-tomee-plus-1.7.1.zip
+  Unzip the zip into your home directory (or any other location)</p>
+  
+  <p>unzip ~/openejb-4.7.1/tomee/apache-tomee/target/apache-tomee-plus-1.7.1.zip -d ~
+  You will find the directory <strong>apache-tomee-plus-1.7.1</strong> in your home folder. Lets run the TomEE.</p>
+  
+  <p>cd ~/apache-tomee-plus-1.7.1/bin
+  ./catalina.sh run
+  "INFO: Server startup in xxxx ms" is the Green light!</p>
+</blockquote>
+
+<h3>Prepare your IDE</h3>
+
+<p>Lets prepare our IntelliJ IDEA for the debugging session.</p>
+
+<p>Start IntelliJ IDEA and Click the Import Project link</p>
+
+<p>[<img src="idea1.png" alt="" /></p>
+
+<p>Select the ~/openejb-4.7.1 directory and press OK</p>
+
+<p>Select import project from external model &amp; Maven as the external model.</p>
+
+<p>[<img src="idea3.png" alt="" /></p>
+
+<p>Press Next on this screen.</p>
+
+<p>[<img src="idea4.png" alt="" /></p>
+
+<p>Select the main profile.</p>
+
+<p>[<img src="idea6.png" alt="" /></p>
+
+<p>Select the org.apache.openejb:openejb:4.7.1</p>
+
+<p>[<img src="idea7.png" alt="" /></p>
+
+<p>Select the JDK you want to use with.</p>
+
+<p>[<img src="idea8.png" alt="" /></p>
+
+<p>Give the project a name and press Finish.</p>
+
+<p>[<img src="idea9.png" alt="" /></p>
+
+<p>Now your IDE will load the project.</p>
+
+<h3>First Breakpoint</h3>
+
+<p>Next step is to put a breakpoint at the place where the code is triggered. Lets understand how the code is triggered.</p>
+
+<p>TomEE+ is created on top of Tomcat. TomEE registers a Tomcat Lifecycle Listener <strong>"org.apache.tomee.catalina.ServerListener"</strong> on <strong>server.xml</strong> file.</p>
+
+<p>All the Tomcat lifecycle events i.e. before_init, after_init, start, before_stop etc... are received by the <strong>lifecycleEvent</strong> method of the ServerListener.</p>
+
+<p>The execution of TomEE code starts in this lifecycleEvent method. So the first breakpoint should be on the lifecycleEvent method.</p>
+
+<h3>Run TomEE+ in debug mode</h3>
+
+<p>If you simply run <strong>catalina.sh jpda run</strong> in the bin folder of tomee deployment, the server starts in the debug mode but it will quckly pass your breakpoint before you attach your IDE to the server process.</p>
+
+<p>So we set** JPDA_SUSPEND="y"** before we start our debugging. This will notice the server, "Do not proceed until the Debugger tool is attached to the process"</p>
+
+<p>The convenient way of doing this is adding this line to catalina.sh file right after the #!/bin/sh line. </p>
+
+<blockquote>
+  <h1>!/bin/sh</h1>
+  
+  <p>JPDA_SUSPEND="y"
+  Now to time to run TomEE+ on debug mode.</p>
+  
+  <p>~/apache-tomee-plus-1.7.1/bin/catalina.sh jpda run </p>
+</blockquote>
+
+<p>The terminal should hang with the message <strong>"Listening for transport dt_socket at address: 8000"</strong></p>
+
+<h3>Attach IntelliJ IDEA debugger</h3>
+
+<ul>
+<li>Menu Bar &gt; Run &gt; Edit Configurations</li>
+<li>Press the "<strong>+</strong>" button on the top left corner to get the Add new configuration menu</li>
+<li>Select "Remote" from the Add new configuration menu</li>
+<li>Give a name (I gave "TomEE DEBUG") to this new configuration and set the Port to 8000</li>
+<li>Click OK.</li>
+</ul>
+
+<p>[<img src="idea_debug_conf.png" alt="" /></div></p>
+
+<p>To start debugging your TomEE+</p>
+
+<p>Main Menu &gt; Run &gt; Debug TomEE DEBUG</p>
+
+<p>Congratulations! You hit the break point you put at the startup of the TomEE code. Carry on with your debugging session to learn more.</p>
+
+
+
+
+        <div id="edit" class="modal hide fade in" style="display: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documentation!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <script src="./../../resources/js/bootstrap-modal.js"></script>
+
+        <footer>
+            <p>Copyright &copy; 1999-2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+                Apache TomEE, TomEE, Apache, the Apache feather logo, and the Apache TomEE project logo are trademarks of The Apache Software Foundation.
+                All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p>
+        </footer>
+
+    </div> <!-- /container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="./../../resources/js/bootstrap-dropdown.js"></script>
+
+  </body>
+</html>

Added: websites/staging/tomee/trunk/content/contrib/debug/idea1.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea1.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea10_debug_conf.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea10_debug_conf.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea2.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea2.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea3.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea3.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea4.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea4.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea6.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea6.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea7.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea7.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea8.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea8.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/tomee/trunk/content/contrib/debug/idea9.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/tomee/trunk/content/contrib/debug/idea9.png
------------------------------------------------------------------------------
    svn:mime-type = image/png