Added: tomee/site/trunk/content/latest/docs/advanced/setup/index.html
URL:
http://svn.apache.org/viewvc/tomee/site/trunk/content/latest/docs/advanced/setup/index.html?rev=1847931&view=auto
==============================================================================
--- tomee/site/trunk/content/latest/docs/advanced/setup/index.html (added)
+++ tomee/site/trunk/content/latest/docs/advanced/setup/index.html Sun Dec 2
00:12:50 2018
@@ -0,0 +1,327 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Apache TomEE</title>
+ <meta name="description"
+ content="Apache TomEE is a lightweight, yet powerful, JavaEE
Application server with feature rich tooling." />
+ <meta name="keywords"
content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian"
/>
+ <meta name="author" content="Luka Cvetinovic for Codrops" />
+ <link rel="icon" href="../../../../favicon.ico">
+ <link rel="icon" type="image/png" href="../../../../favicon.png">
+ <meta name="msapplication-TileColor" content="#80287a">
+ <meta name="theme-color" content="#80287a">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/normalize.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/bootstrap.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/owl.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/animate.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/font-awesome-4.1.0/css/font-awesome.min.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/eleganticons/et-icons.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/jqtree.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/idea.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/cardio.css">
+
+ <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="preloader">
+ <img src="../../../../img/loader.gif" alt="Preloader image">
+ </div>
+ <nav class="navbar">
+ <div class="container">
+ <div class="row"> <div class="col-md-12">
+
+ <!-- Brand and toggle get grouped for better mobile
display -->
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle
collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="sr-only">Toggle
navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <span>
+
+
+ <img src="../../../../img/logo-active.png">
+
+
+ </span>
+ Apache TomEE
+ </a>
+ </div>
+ <!-- Collect the nav links, forms, and other content
for toggling -->
+ <div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav navbar-right
main-nav">
+ <li><a
href="../../../../docs.html">Documentation</a></li>
+ <li><a
href="../../../../community/index.html">Community</a></li>
+ <li><a
href="../../../../security/index.html">Security</a></li>
+ <li><a
href="../../../../download-ng.html">Downloads</a></li>
+ </ul>
+ </div>
+ <!-- /.navbar-collapse -->
+ </div></div>
+ </div>
+ <!-- /.container-fluid -->
+ </nav>
+
+
+ <div id="main-block" class="container section-padded">
+ <div class="row title">
+ <div class="col-md-12">
+ <div class='page-header'>
+
+ <h1>How to Setup TomEE in production</h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+
+ <div class="col-md-12">
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>You can use TomEE as described on <a
href="../../admin/directory-structure.html">Directory Structure</a> page but in
production it is better to
+split TomEE and application binaries and configuration.</p>
+</div>
+<div class="paragraph">
+<p>Idea is to have this kind of layout (the root is the one you prefer):</p>
+</div>
+<div id="filetree" class="paragraph col-md-4">
+<p>[{
+ label: '/some/path',
+ description: 'any location on your file system',
+ children: [
+ {
+ label: 'tomee',
+ description: 'all tomee binaries will be there, note: you often do
the same for the JVM versions you have',
+ children: [
+ {
+ label: 'tomee-1.7.1',
+ description: 'a particular tomee version (just unzip it
there)',
+ children: [
+ { label: 'bin', description: 'the startup
binaries/scripts' },
+ { label: 'conf', description: 'default shared
configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ },
+ {
+ label: 'tomee-1.7.2',
+ description: 'a particular tomee version (just unzip it
there)',
+ children: [
+ { label: 'bin', description: 'the startup
binaries/scripts' },
+ { label: 'conf', description: 'default shared
configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ },
+ {
+ label: 'tomee-7.0.0-M3',
+ description: 'a particular tomee version (just unzip it
there)',
+ children: [
+ { label: 'bin', description: 'the startup
binaries/scripts' },
+ { label: 'conf', description: 'default shared
configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ }
+ ]
+ },
+ {
+ label: 'applications',
+ description: 'all applications',
+ children: [
+ {
+ label: 'application1',
+ description: 'any application instance (ie configuration +
binaries)',
+ children: [
+ { label: 'bin', description: 'provide scripts for this
instance (see under that file layout)' },
+ { label: 'conf', description: 'the instance
configuration, typically what is in tomee/conf when used in standalone' },
+ { label: 'lib', description: 'some additional binaries
like JDBC drivers' },
+ { label: 'logs', description: 'instances logs
location' },
+ { label: 'work', description: 'dedicated work
directory' },
+ { label: 'temp', description: 'instance temporary
folder' },
+ { label: 'webapps', description: 'instance webapp
folder' }
+ ]
+ },
+ {
+ label: 'application2',
+ description: 'any application instance (ie configuration +
binaries)',
+ children: [
+ { label: 'bin', description: 'provide scripts for this
instance (see under that file layout)' },
+ { label: 'conf', description: 'the instance
configuration, typically what is in tomee/conf when used in standalone' },
+ { label: 'lib', description: 'some additional binaries
like JDBC drivers' },
+ { label: 'logs', description: 'instances logs
location' },
+ { label: 'work', description: 'dedicated work
directory' },
+ { label: 'temp', description: 'instance temporary
folder' },
+ { label: 'webapps', description: 'instance webapp
folder' }
+ ]
+ }
+ ]
+ }
+ ]
+}]</p>
+</div>
+<div id="filetreedetail" class="paragraph col-md-8 bs-callout
bs-callout-primary">
+<p>Click on a tree node or open a folder to see the detail there.</p>
+</div>
+<div class="paragraph clearfix">
+<p> </p>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_instance_scripts">Instance scripts</h3>
+<div class="paragraph">
+<p>The idea for instances (applications) scripts is to simply delegate to
tomcat ones but customizing the JVM and TomEE versions.</p>
+</div>
+<div class="paragraph">
+<p>Customizing the version (and locations) is done in
<code>bin/setenv.sh</code> of instances.</p>
+</div>
+<div class="paragraph">
+<p>Here are an example for the common scripts (of course you can write helper
version like restart etc).</p>
+</div>
+<div class="sect3">
+<h4 id="_setenv_sh">setenv.sh</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">#! /bin/sh
+
+# which java
+export JAVA_HOME="/some/path/java/jdk-8u60"
+# which tomee
+export CATALINA_HOME="/some/path/tomee/tomee-7.0.0-M3"
+# where is the application - to let tomcat/tomee finds the configuration
+export CATALINA_BASE="/some/path/application1/"
+# to let tomee be able to kill the instance if shutdown doesn't work (see
shutdown script)
+export CATALINA_PID="/some/path/application1/work/tomee.pid"</code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_startup">startup</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">#!
/bin/bash
+
+proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
+source "$proc_script_base/bin/setenv.sh"
+nohup "$CATALINA_HOME/bin/startup.sh" "$@" >
$proc_script_base/logs/nohup.log &</code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_shutdown">shutdown</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">#!
/bin/bash
+
+proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
+source "$proc_script_base/bin/setenv.sh"
+# we support parameters like timeout and force, typically we would call it
this way: ./shutdown 1200 -force
+"$CATALINA_HOME/bin/shutdown.sh" "$@"</code></pre>
+</div>
+</div>
+</div>
+</div>
+ </div>
+
+ </div>
+ </div>
+<footer>
+ <div class="container">
+ <div class="row">
+ <div class="col-sm-6 text-center-mobile">
+ <h3 class="white">Be simple. Be
certified. Be Tomcat.</h3>
+ <h5 class="light regular
light-white">"A good application in a good server"</h5>
+ <ul class="social-footer">
+ <li><a
href="https://www.facebook.com/ApacheTomEE/"><i class="fa
fa-facebook"></i></a></li>
+ <li><a
href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li>
+ <li><a
href="https://plus.google.com/communities/105208241852045684449"><i class="fa
fa-google-plus"></i></a></li>
+ </ul>
+ </div>
+ <div class="col-sm-6 text-center-mobile">
+ <div class="row opening-hours">
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../latest/docs/documentation.html"
class="white">Documentation</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/docs/admin/configuration/index.html" class="regular
light-white">How to configure</a></li>
+ <li><a
href="../../../../latest/docs/admin/file-layout.html" class="regular
light-white">Dir. Structure</a></li>
+ <li><a
href="../../../../latest/docs/developer/testing/index.html" class="regular
light-white">Testing</a></li>
+ <li><a
href="../../../../latest/docs/admin/cluster/index.html" class="regular
light-white">Clustering</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../examples.html" class="white">Examples</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/examples/simple-cdi-interceptor.html" class="regular
light-white">CDI Interceptor</a></li>
+ <li><a
href="../../../../latest/examples/rest-cdi.html" class="regular
light-white">REST with CDI</a></li>
+ <li><a
href="../../../../latest/examples/ejb-examples.html" class="regular
light-white">EJB</a></li>
+ <li><a
href="../../../../latest/examples/jsf-managedBean-and-ejb.html" class="regular
light-white">JSF</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../community/index.html" class="white">Community</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../community/contributors.html" class="regular
light-white">Contributors</a></li>
+ <li><a
href="../../../../community/social.html" class="regular
light-white">Social</a></li>
+ <li><a
href="../../../../community/sources.html" class="regular
light-white">Sources</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../security/index.html" class="white">Security</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="http://apache.org/security" target="_blank" class="regular
light-white">Apache Security</a></li>
+ <li><a
href="http://apache.org/security/projects.html" target="_blank" class="regular
light-white">Security Projects</a></li>
+ <li><a
href="http://cve.mitre.org" target="_blank" class="regular
light-white">CVE</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row bottom-footer text-center-mobile">
+ <div class="col-sm-12 light-white">
+ <p>Copyright © 1999-2016 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>
+ </div>
+ </div>
+ </div>
+ </footer>
+ <!-- Holder for mobile navigation -->
+ <div class="mobile-nav">
+ <ul>
+ <li><a
hef="../../../../latest/docs/admin/index.html">Administrators</a>
+ <li><a
hef="../../../../latest/docs/developer/index.html">Developers</a>
+ <li><a hef="../../../../latest/docs/advanced/index.html">Advanced</a>
+ <li><a hef="../../../../community/index.html">Community</a>
+ </ul>
+ <a href="#" class="close-link"><i class="arrow_up"></i></a>
+ </div>
+ <!-- Scripts -->
+ <script src="../../../../js/jquery-1.11.1.min.js"></script>
+ <script src="../../../../js/owl.carousel.min.js"></script>
+ <script src="../../../../js/bootstrap.min.js"></script>
+ <script src="../../../../js/wow.min.js"></script>
+ <script src="../../../../js/typewriter.js"></script>
+ <script src="../../../../js/jquery.onepagenav.js"></script>
+ <script src="../../../../js/tree.jquery.js"></script>
+ <script src="../../../../js/highlight.pack.js"></script>
+ <script src="../../../../js/main.js"></script>
+ </body>
+
+</html>
+
Propchange: tomee/site/trunk/content/latest/docs/advanced/setup/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: tomee/site/trunk/content/latest/docs/advanced/shading/index.html
URL:
http://svn.apache.org/viewvc/tomee/site/trunk/content/latest/docs/advanced/shading/index.html?rev=1847931&view=auto
==============================================================================
--- tomee/site/trunk/content/latest/docs/advanced/shading/index.html (added)
+++ tomee/site/trunk/content/latest/docs/advanced/shading/index.html Sun Dec 2
00:12:50 2018
@@ -0,0 +1,511 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Apache TomEE</title>
+ <meta name="description"
+ content="Apache TomEE is a lightweight, yet powerful, JavaEE
Application server with feature rich tooling." />
+ <meta name="keywords"
content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian"
/>
+ <meta name="author" content="Luka Cvetinovic for Codrops" />
+ <link rel="icon" href="../../../../favicon.ico">
+ <link rel="icon" type="image/png" href="../../../../favicon.png">
+ <meta name="msapplication-TileColor" content="#80287a">
+ <meta name="theme-color" content="#80287a">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/normalize.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/bootstrap.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/owl.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/animate.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/font-awesome-4.1.0/css/font-awesome.min.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/eleganticons/et-icons.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/jqtree.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/idea.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/cardio.css">
+
+ <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="preloader">
+ <img src="../../../../img/loader.gif" alt="Preloader image">
+ </div>
+ <nav class="navbar">
+ <div class="container">
+ <div class="row"> <div class="col-md-12">
+
+ <!-- Brand and toggle get grouped for better mobile
display -->
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle
collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="sr-only">Toggle
navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <span>
+
+
+ <img src="../../../../img/logo-active.png">
+
+
+ </span>
+ Apache TomEE
+ </a>
+ </div>
+ <!-- Collect the nav links, forms, and other content
for toggling -->
+ <div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav navbar-right
main-nav">
+ <li><a
href="../../../../docs.html">Documentation</a></li>
+ <li><a
href="../../../../community/index.html">Community</a></li>
+ <li><a
href="../../../../security/index.html">Security</a></li>
+ <li><a
href="../../../../download-ng.html">Downloads</a></li>
+ </ul>
+ </div>
+ <!-- /.navbar-collapse -->
+ </div></div>
+ </div>
+ <!-- /.container-fluid -->
+ </nav>
+
+
+ <div id="main-block" class="container section-padded">
+ <div class="row title">
+ <div class="col-md-12">
+ <div class='page-header'>
+
+ <div class='btn-toolbar pull-right' style="z-index: 2000;">
+ <div class='btn-group'>
+ <a class="btn"
href="../../../../latest/docs/advanced/shading/index.pdf"><i class="fa
fa-file-pdf-o"></i> Download as PDF</a>
+ </div>
+ </div>
+
+ <h1>Fat / Uber jars - Using the Shade Plugin</h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+
+ <div class="col-md-12">
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>Shading the container and the application has some challenges like merging
correctly resources (<code>META-INF/services/</code> typically).</p>
+</div>
+<div class="paragraph">
+<p>Here is a maven shade plugin configuration working for most cases:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-xml"
data-lang="xml"><plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.3</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+
<dependencyReducedPomLocation>${project.build.directory}/reduced-pom.xml</dependencyReducedPomLocation>
+ <transformers>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.tomee.embedded.FatApp</mainClass>
+ </transformer>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+ <resource>META-INF/cxf/bus-extensions.txt</resource>
+ </transformer>
+ <transformer
implementation="org.apache.openwebbeans.maven.shade.OpenWebBeansPropertiesTransformer"
/>
+ </transformers>
+ <filters>
+ <filter> <!-- we don't want JSF to be activated -->
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/faces-config.xml</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-maven</artifactId>
+ <version>1.7.0/version>
+ </dependency>
+ </dependencies>
+</plugin></code></pre>
+</div>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+see <a href="../tomee-embedded/index.html">TomEE Embedded</a> page for more
information about tomee embedded options.
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+this shade uses TomEE Embedded but you can do the same with an <a
href="../applicationcomposer/index.html">Application Composer</a> application.
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+if you have <code>META-INF/web-fragment.xml</code> in your application you
will need to merge them in a single one in the shade. Note that tomcat provides
one
+which can be skipped in this operation since it is there only as a marker for
jasper detection.
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>Then just build the jar:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">mvn clean
package</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>And you can run it:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar
myapp-1.0-SNAPSHOT.jar</code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_fat_jars_with_gradle">Fat Jars with Gradle</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>With gradle you can rely on either jar plugin, fatjar plugin or shadowjar
plugin. Last one is likely the closer to maven shade plugin
+so that’s the one used for next sample:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-groovy" data-lang="groovy">// run
$ gradle clean shadowJar
+import org.apache.openwebbeans.gradle.shadow.OpenWebBeansPropertiesTransformer
+
+buildscript {
+ repositories {
+ mavenLocal()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
+ classpath 'org.apache.openwebbeans:openwebbeans-gradle:1.7.0'
+ }
+}
+
+apply plugin: 'com.github.johnrengelman.shadow'
+
+group 'org.apache.tomee.demo.gradle'
+version '1.0-SNAPSHOT'
+
+apply plugin: 'idea'
+apply plugin: 'java'
+
+sourceCompatibility = 1.8
+
+repositories {
+ mavenLocal()
+ mavenCentral()
+}
+
+dependencies {
+ compileOnly 'org.projectlombok:lombok:1.16.10'
+ compile 'org.apache.tomee:tomee-embedded:7.0.2-SNAPSHOT'
+}
+
+// customize exclusions depending your app
+
+// first the not used dependencies like JSF, JAXWS, JMS ones
+def excludedDependenciesGroups = [
+ // gradle is buggy with poms, scope provided and optional I think
+ 'com.google.code.findbugs',
+ 'com.google.guava',
+ 'javax.annotation',
+ 'javax.ws.rs',
+ 'net.sf.ehcache',
+ 'org.apache.httpcomponents',
+ 'org.ow2.asm',
+ // tomee jaxws, jms, etc...
+ 'commons-codec',
+ 'com.sun.xml.messaging.saaj',
+ 'joda-time',
+ 'junit',
+ 'net.shibboleth.utilities',
+ 'org.apache.activemq',
+ 'org.apache.activemq.protobuf',
+ 'org.apache.myfaces.core',
+ 'org.apache.neethi',
+ 'org.apache.santuario',
+ 'org.apache.ws.xmlschema',
+ 'org.apache.wss4j',
+ 'org.bouncycastle',
+ 'org.cryptacular',
+ 'org.fusesource.hawtbuf',
+ 'org.jasypt',
+ 'org.jvnet.mimepull',
+ 'org.opensaml',
+ 'wsdl4j',
+ 'xml-resolver'
+]
+
+// then cxf+tomee specific dependencies so we need to be more precise than the
group
+// to not exclude everything
+def excludedDependenciesArtifacts = [
+ 'cxf-rt-bindings-soap',
+ 'cxf-rt-bindings-xml',
+ 'cxf-rt-databinding-jaxb',
+ 'cxf-rt-frontend-jaxws',
+ 'cxf-rt-frontend-simple',
+ 'cxf-rt-security-saml',
+ 'cxf-rt-ws-addr',
+ 'cxf-rt-wsdl',
+ 'cxf-rt-ws-policy',
+ 'cxf-rt-ws-security',
+ 'openejb-cxf',
+ 'openejb-webservices',
+ 'tomee-webservices',
+ 'geronimo-connector',
+ 'geronimo-javamail_1.4_mail'
+]
+shadowJar {
+ classifier = 'bundle'
+
+ // merge SPI descriptors
+ mergeServiceFiles()
+ append 'META-INF/cxf/bus-extensions.txt'
+ transform(OpenWebBeansPropertiesTransformer.class)
+
+ // switch off JSF + JMS + JAXWS
+ exclude 'META-INF/faces-config.xml'
+ dependencies {
+ exclude(dependency {
+ excludedDependenciesGroups.contains(it.moduleGroup) ||
+ excludedDependenciesArtifacts.contains(it.moduleName)
+ })
+ }
+
+ // ensure we define the expected Main (if you wrap tomee main use your own
class)
+ manifest {
+ attributes 'Main-Class': 'org.apache.tomee.embedded.FatApp'
+ }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Then run:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code>gradle clean build shadowJar</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>and you’ll get
<code>build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar</code>
ready to run with:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code>java -jar
build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar --as-war
--simple-log=true</code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_fat_wars">Fat Wars</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Fat Wars are executable wars. Note they can be fancy for demos but they
have the drawback to put the server in web resources
+at packaging time (to ensure the war is actually an executable jar) so adding
a filter preventing these files to be read
+can be needed if you don’t already use a web technology doing it (a
servlet bound to /*).</p>
+</div>
+<div class="paragraph">
+<p>Here how to do a fat war:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-xml"
data-lang="xml"><properties>
+ <!-- can be uber (for all), jaxrs, jaxws for lighter ones -->
+ <tomee.flavor>uber</tomee.flavor>
+</properties>
+
+<dependencies>
+ <!-- ...your dependencies as usual... -->
+ <dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>tomee-embedded</artifactId>
+ <classifier>${tomee.flavor}</classifier>
+ <version>7.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+</dependencies>
+
+<build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.tomee.embedded.Main</mainClass>
+ </manifest>
+ </archive>
+ <dependentWarExcludes />
+ <overlays>
+ <overlay>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>tomee-embedded</artifactId>
+ <classifier>${tomee.flavor}</classifier>
+ <type>jar</type>
+ <excludes />
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ </plugins>
+</build></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Then just build the war:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">mvn clean
package</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>And you can run it:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar
myapp-1.0-SNAPSHOT.war</code></pre>
+</div>
+</div>
+</div>
+</div>
+ </div>
+
+ </div>
+ </div>
+<footer>
+ <div class="container">
+ <div class="row">
+ <div class="col-sm-6 text-center-mobile">
+ <h3 class="white">Be simple. Be
certified. Be Tomcat.</h3>
+ <h5 class="light regular
light-white">"A good application in a good server"</h5>
+ <ul class="social-footer">
+ <li><a
href="https://www.facebook.com/ApacheTomEE/"><i class="fa
fa-facebook"></i></a></li>
+ <li><a
href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li>
+ <li><a
href="https://plus.google.com/communities/105208241852045684449"><i class="fa
fa-google-plus"></i></a></li>
+ </ul>
+ </div>
+ <div class="col-sm-6 text-center-mobile">
+ <div class="row opening-hours">
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../latest/docs/documentation.html"
class="white">Documentation</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/docs/admin/configuration/index.html" class="regular
light-white">How to configure</a></li>
+ <li><a
href="../../../../latest/docs/admin/file-layout.html" class="regular
light-white">Dir. Structure</a></li>
+ <li><a
href="../../../../latest/docs/developer/testing/index.html" class="regular
light-white">Testing</a></li>
+ <li><a
href="../../../../latest/docs/admin/cluster/index.html" class="regular
light-white">Clustering</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../examples.html" class="white">Examples</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/examples/simple-cdi-interceptor.html" class="regular
light-white">CDI Interceptor</a></li>
+ <li><a
href="../../../../latest/examples/rest-cdi.html" class="regular
light-white">REST with CDI</a></li>
+ <li><a
href="../../../../latest/examples/ejb-examples.html" class="regular
light-white">EJB</a></li>
+ <li><a
href="../../../../latest/examples/jsf-managedBean-and-ejb.html" class="regular
light-white">JSF</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../community/index.html" class="white">Community</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../community/contributors.html" class="regular
light-white">Contributors</a></li>
+ <li><a
href="../../../../community/social.html" class="regular
light-white">Social</a></li>
+ <li><a
href="../../../../community/sources.html" class="regular
light-white">Sources</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../security/index.html" class="white">Security</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="http://apache.org/security" target="_blank" class="regular
light-white">Apache Security</a></li>
+ <li><a
href="http://apache.org/security/projects.html" target="_blank" class="regular
light-white">Security Projects</a></li>
+ <li><a
href="http://cve.mitre.org" target="_blank" class="regular
light-white">CVE</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row bottom-footer text-center-mobile">
+ <div class="col-sm-12 light-white">
+ <p>Copyright © 1999-2016 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>
+ </div>
+ </div>
+ </div>
+ </footer>
+ <!-- Holder for mobile navigation -->
+ <div class="mobile-nav">
+ <ul>
+ <li><a
hef="../../../../latest/docs/admin/index.html">Administrators</a>
+ <li><a
hef="../../../../latest/docs/developer/index.html">Developers</a>
+ <li><a hef="../../../../latest/docs/advanced/index.html">Advanced</a>
+ <li><a hef="../../../../community/index.html">Community</a>
+ </ul>
+ <a href="#" class="close-link"><i class="arrow_up"></i></a>
+ </div>
+ <!-- Scripts -->
+ <script src="../../../../js/jquery-1.11.1.min.js"></script>
+ <script src="../../../../js/owl.carousel.min.js"></script>
+ <script src="../../../../js/bootstrap.min.js"></script>
+ <script src="../../../../js/wow.min.js"></script>
+ <script src="../../../../js/typewriter.js"></script>
+ <script src="../../../../js/jquery.onepagenav.js"></script>
+ <script src="../../../../js/tree.jquery.js"></script>
+ <script src="../../../../js/highlight.pack.js"></script>
+ <script src="../../../../js/main.js"></script>
+ </body>
+
+</html>
+
Propchange: tomee/site/trunk/content/latest/docs/advanced/shading/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: tomee/site/trunk/content/latest/docs/advanced/tomee-embedded/index.html
URL:
http://svn.apache.org/viewvc/tomee/site/trunk/content/latest/docs/advanced/tomee-embedded/index.html?rev=1847931&view=auto
==============================================================================
--- tomee/site/trunk/content/latest/docs/advanced/tomee-embedded/index.html
(added)
+++ tomee/site/trunk/content/latest/docs/advanced/tomee-embedded/index.html Sun
Dec 2 00:12:50 2018
@@ -0,0 +1,788 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Apache TomEE</title>
+ <meta name="description"
+ content="Apache TomEE is a lightweight, yet powerful, JavaEE
Application server with feature rich tooling." />
+ <meta name="keywords"
content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian"
/>
+ <meta name="author" content="Luka Cvetinovic for Codrops" />
+ <link rel="icon" href="../../../../favicon.ico">
+ <link rel="icon" type="image/png" href="../../../../favicon.png">
+ <meta name="msapplication-TileColor" content="#80287a">
+ <meta name="theme-color" content="#80287a">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/normalize.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/bootstrap.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/owl.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/animate.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/font-awesome-4.1.0/css/font-awesome.min.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/eleganticons/et-icons.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/jqtree.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/idea.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/cardio.css">
+
+ <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="preloader">
+ <img src="../../../../img/loader.gif" alt="Preloader image">
+ </div>
+ <nav class="navbar">
+ <div class="container">
+ <div class="row"> <div class="col-md-12">
+
+ <!-- Brand and toggle get grouped for better mobile
display -->
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle
collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="sr-only">Toggle
navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <span>
+
+
+ <img src="../../../../img/logo-active.png">
+
+
+ </span>
+ Apache TomEE
+ </a>
+ </div>
+ <!-- Collect the nav links, forms, and other content
for toggling -->
+ <div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav navbar-right
main-nav">
+ <li><a
href="../../../../docs.html">Documentation</a></li>
+ <li><a
href="../../../../community/index.html">Community</a></li>
+ <li><a
href="../../../../security/index.html">Security</a></li>
+ <li><a
href="../../../../download-ng.html">Downloads</a></li>
+ </ul>
+ </div>
+ <!-- /.navbar-collapse -->
+ </div></div>
+ </div>
+ <!-- /.container-fluid -->
+ </nav>
+
+
+ <div id="main-block" class="container section-padded">
+ <div class="row title">
+ <div class="col-md-12">
+ <div class='page-header'>
+
+ <div class='btn-toolbar pull-right' style="z-index: 2000;">
+ <div class='btn-group'>
+ <a class="btn"
href="../../../../latest/docs/advanced/tomee-embedded/index.pdf"><i class="fa
fa-file-pdf-o"></i> Download as PDF</a>
+ </div>
+ </div>
+
+ <h1>TomEE Embedded</h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+
+ <div class="col-md-12">
+ <div id="preamble">
+<div class="sectionbody">
+<div class="paragraph">
+<p>TomEE Embedded is based on Tomcat embedded and starts a real TomEE in the
launching JVM. It is also
+able to deploy the classpath as a webapp and to use either
<code>META-INF/resources</code> or a folder as web resources.</p>
+</div>
+<div class="paragraph">
+<p>Here is a basic programmatic usage based on
<code>org.apache.tomee.embedded.Container</code> class:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-java" data-lang="java">try (final
Container container = new Container(new
Configuration()).deployClasspathAsWebApp()) {
+ System.out.println("Started on http://localhost:" +
container.getConfiguration().getHttpPort());
+
+ // do something or wait until the end of the application
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>All EE features are then accessible directly in the same JVM.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_tomee_embedded_configuration">TomEE Embedded Configuration</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The default configuration allows to start tomee without issue but you can
desire to customize some of them.</p>
+</div>
+<table class="tableblock frame-all grid-all spread table table-bordered">
+<colgroup>
+<col style="width: 33.3333%;">
+<col style="width: 33.3333%;">
+<col style="width: 33.3334%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Name</th>
+<th class="tableblock halign-left valign-top">Default</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">httpPort</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">8080</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">http
port</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">stopPort</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">8005</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">shutdown
port</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">host</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">localhost</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">host</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">dir</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">where to
create a file hierarchy for tomee (conf, temp, …​)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">serverXml</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">which
server.xml to use</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keepServerXmlAsThis</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">false</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">don’t adjust ports/host from the configuration and
keep the ones in server.xml</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">properties</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">container
properties</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">quickSession</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">true</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">use Random
instead of SecureRandom (for dev)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">skipHttp</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">false</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">don’t use the http connector</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">httpsPort</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">8443</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
potr</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">ssl</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">false</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">activate
https</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">withEjbRemote</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">false</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">use
EJBd</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystoreFile</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
keystore location</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystorePass</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
keystore password</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystoreType</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">JKS</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
keystore type</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">clientAuth</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
client auth</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keyAlias</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">https
alias</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">sslProtocol</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">SSL
protocol for https connector</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">webXml</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">default
web.xml to use</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">loginConfig</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">which
LoginConfig to use, relies on
<code>org.apache.tomee.embedded.LoginConfigBuilder</code> to create it</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">securityConstraints</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">add some
security constraints, use
<code>org.apache.tomee.embedded.SecurityConstaintBuilder</code> to build
them</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">realm</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">which
realm to use (useful to switch to <code>JAASRealm</code> for instance) without
modifying the application</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">deployOpenEjbApp</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">false</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">should
internal openejb application be delpoyed</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">users</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">a map of
user/password</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">roles</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">a map of
role/users</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">tempDir</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">${java.io.tmpdir}/tomee-embedded_${timestamp}</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">tomcat
needs a docBase, in case you don’t provide one one will be created
there</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">webResourceCached</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">true</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">should web
resources be cached by tomcat (set false in frontend dev)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">configuration-location</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">location
(classpath or file) to a .properties to configure the server
+[pre-task</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Runnable
or org.apache.tomee.embedded.LifecycleTask implementations to execute before
the container starts</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">classes-filter</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">implementation of a custom xbean Filter to ignore not
desired classes during scanning</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">basic</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>Note: passing to <code>Container</code> constructor a
<code>Configuration</code> it will start the container automatically but using
<code>setup(Configuration)</code>
+to initialize the configuration you will need to call <code>start()</code>.</p>
+</div>
+<div class="paragraph">
+<p>You can also pass through the properties <code>connector.xxx</code> and
<code>connector.attributes.xxx</code> to customize connector(s)
+configuration directly.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2
id="_standalone_applications_or_tomee_embedded_provided_main_string">Standalone
applications or TomEE Embedded provided main(String[])</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Deploying an application in a server is very nice cause the application is
generally small and it allows to update the
+container without touching the application (typically insanely important in
case of security issues for instance).</p>
+</div>
+<div class="paragraph">
+<p>However sometimes you don’t have the choice so TomEE Embedded
provides a built-in <code>main(String[])</code>. Here are its options:</p>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+this is still a TomEE so all system properties work (for instance to create a
resource).
+</td>
+</tr>
+</table>
+</div>
+<table class="tableblock frame-all grid-all spread table table-bordered">
+<colgroup>
+<col style="width: 33.3333%;">
+<col style="width: 33.3333%;">
+<col style="width: 33.3334%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Name</th>
+<th class="tableblock halign-left valign-top">Default</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--path</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">location
of application(s) to deploy</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--context</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Context
name for applications (same order than paths)</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-p or
--port</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">8080</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">http
port</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-s or
--shutdown</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">8005</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">shutdown
port</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-d or
--directory</p></td>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">./.apache-tomee</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">tomee work
directory</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-c or
--as-war</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">deploy
classpath as a war</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-b or
--doc-base</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">where web
resources are for classpath deployment</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--renaming</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">for fat
war only, is renaming of the context supported</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--serverxml</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">the
server.xml location</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--tomeexml</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">the
server.xml location</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">--property</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">a list of
container properties (values follow the format x=y)</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>Note that since 7.0.0 TomEE provides 3 flavors (qualifier) of
tomee-embedded as fat jars:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>uber (where we put all request features by users, this is likely the most
complete and the biggest)</p>
+</li>
+<li>
+<p>jaxrs: webprofile minus JSF</p>
+</li>
+<li>
+<p>jaxws: webprofile plus JAX-WS</p>
+</li>
+</ul>
+</div>
+<div class="paragraph">
+<p>These different uber jars are interesting in mainly 2 cases:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>you do a war shade (it avoids to list a bunch of dependencies but still get
a customized version)</p>
+</li>
+<li>
+<p>you run your application using <code>--path</code> option</p>
+</li>
+</ul>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+if you already do a custom shade/fatjar this is not really impacting since you
can depend on <code>tomee-embedded</code> and exclude/include what you want.
+</td>
+</tr>
+</table>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_fatapp_a_shortcut_main">FatApp a shortcut main</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p><code>FatApp</code> main (same package as tomee embedded <code>Main</code>)
just wraps the default main ensuring:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Ì`--as-war` is used</p>
+</li>
+<li>
+<p>Ì`--single-classloader` is used</p>
+</li>
+<li>
+<p><code>--configuration-location=tomee-embedded.properties</code> is set if
<code>tomee-embedded.properties</code> is found in the classpath</p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_configuration_location">configuration-location</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p><code>--configuration-location</code> option allows to simplify the
configuration of tomee embedded through properties.</p>
+</div>
+<div class="paragraph">
+<p>Here are the recognized entries (they match the configuration, see
org.apache.tomee.embedded.Configuration for the detail):</p>
+</div>
+<table class="tableblock frame-all grid-all spread">
+<colgroup>
+<col style="width: 50%;">
+<col style="width: 50%;">
+</colgroup>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">Name</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">http</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">https</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">stop</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">host</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">dir</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">serverXml</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keepServerXmlAsThis</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">quickSession</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">skipHttp</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">ssl</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">http2</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">webResourceCached</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">withEjbRemote</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">deployOpenEjbApp</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystoreFile</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystorePass</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keystoreType</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">clientAuth</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">keyAlias</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">sslProtocol</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">webXml</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">tempDir</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">classesFilter</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">conf</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">properties.x (set container properties x with the associated
value)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">users.x
(for default in memory realm add the user x with its password - the
value)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock">roles.x
(for default in memory realm add the role x with its comma separated users -
the value)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">connector.x (set the property x on the connector)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">realm=fullyqualifiedname,realm.prop=xxx (define a custom
realm with its configuration)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">login=,login.prop=xxx (define a
org.apache.tomee.embedded.LoginConfigBuilder == define a LoginConfig)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">securityConstraint=,securityConstraint.prop=xxx (define a
org.apache.tomee.embedded.SecurityConstaintBuilder == define webapp
security)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p
class="tableblock">configurationCustomizer.alias=,configurationCustomizer.alias.class=class,configurationCustomizer.alias.prop=xxx
(define a ConfigurationCustomizer)</p></td>
+<td class="tableblock halign-left valign-top"></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>Here is a sample to add BASIC security on <code>/api/*</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code># security configuration
+securityConstraint =
+securityConstraint.authConstraint = true
+securityConstraint.authRole = **
+securityConstraint.collection = api:/api/*
+
+login =
+login.realmName = app
+login.authMethod = BASIC
+
+realm = org.apache.catalina.realm.JAASRealm
+realm.appName = app
+
+properties.java.security.auth.login.config =
configuration/login.jaas</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>And here a configuration to exclude jackson packages from scanning and use
log4j2 as main logger (needs it as dependency):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code>properties.openejb.log.factory = log4j2
+properties.openejb.container.additional.include =
com.fasterxml.jackson,org.apache.logging.log4j</code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_application_runner">Application Runner</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>SInce TomEE 7.0.2, TomEE provide a light ApplicationComposer integration
for TomEE Embedded (all features are not yet supported but the main ones are):
+<code>org.apache.tomee.embedded.TomEEEmbeddedApplicationRunner</code>. It
relies on the definition of an <code>@Application</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-java"
data-lang="java">@Application
+@Classes(context = "app")
+@ContainerProperties(@ContainerProperties.Property(name = "t", value = "set"))
[email protected](MyTask.class) // can start a
ftp/sftp/elasticsearch/mongo/... server before tomee
[email protected](SetMyProperty.class)
+public class TheApp {
+ @RandomPort("http")
+ private int port;
+
+ @RandomPort("http")
+ private URL base;
+
+ @org.apache.openejb.testing.Configuration
+ public Properties add() {
+ return new PropertiesBuilder().p("programmatic", "property").build();
+ }
+
+ @PostConstruct
+ public void appStarted() {
+ // ...
+ }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Then just start it with:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-java"
data-lang="java">TomEEEmbeddedApplicationRunner.run(TheApp.class, "some arg1",
"other arg");</code></pre>
+</div>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<code>@Classes(values)</code> and <code>@Jars</code> are supported too which
can avoid a huge scanning if you run with a lot of not CDI dependencies which
would boost the startup of your application.
+</td>
+</tr>
+</table>
+</div>
+</div>
+</div>
+ </div>
+
+ </div>
+ </div>
+<footer>
+ <div class="container">
+ <div class="row">
+ <div class="col-sm-6 text-center-mobile">
+ <h3 class="white">Be simple. Be
certified. Be Tomcat.</h3>
+ <h5 class="light regular
light-white">"A good application in a good server"</h5>
+ <ul class="social-footer">
+ <li><a
href="https://www.facebook.com/ApacheTomEE/"><i class="fa
fa-facebook"></i></a></li>
+ <li><a
href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li>
+ <li><a
href="https://plus.google.com/communities/105208241852045684449"><i class="fa
fa-google-plus"></i></a></li>
+ </ul>
+ </div>
+ <div class="col-sm-6 text-center-mobile">
+ <div class="row opening-hours">
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../latest/docs/documentation.html"
class="white">Documentation</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/docs/admin/configuration/index.html" class="regular
light-white">How to configure</a></li>
+ <li><a
href="../../../../latest/docs/admin/file-layout.html" class="regular
light-white">Dir. Structure</a></li>
+ <li><a
href="../../../../latest/docs/developer/testing/index.html" class="regular
light-white">Testing</a></li>
+ <li><a
href="../../../../latest/docs/admin/cluster/index.html" class="regular
light-white">Clustering</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../examples.html" class="white">Examples</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/examples/simple-cdi-interceptor.html" class="regular
light-white">CDI Interceptor</a></li>
+ <li><a
href="../../../../latest/examples/rest-cdi.html" class="regular
light-white">REST with CDI</a></li>
+ <li><a
href="../../../../latest/examples/ejb-examples.html" class="regular
light-white">EJB</a></li>
+ <li><a
href="../../../../latest/examples/jsf-managedBean-and-ejb.html" class="regular
light-white">JSF</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../community/index.html" class="white">Community</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../community/contributors.html" class="regular
light-white">Contributors</a></li>
+ <li><a
href="../../../../community/social.html" class="regular
light-white">Social</a></li>
+ <li><a
href="../../../../community/sources.html" class="regular
light-white">Sources</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../security/index.html" class="white">Security</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="http://apache.org/security" target="_blank" class="regular
light-white">Apache Security</a></li>
+ <li><a
href="http://apache.org/security/projects.html" target="_blank" class="regular
light-white">Security Projects</a></li>
+ <li><a
href="http://cve.mitre.org" target="_blank" class="regular
light-white">CVE</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row bottom-footer text-center-mobile">
+ <div class="col-sm-12 light-white">
+ <p>Copyright © 1999-2016 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>
+ </div>
+ </div>
+ </div>
+ </footer>
+ <!-- Holder for mobile navigation -->
+ <div class="mobile-nav">
+ <ul>
+ <li><a
hef="../../../../latest/docs/admin/index.html">Administrators</a>
+ <li><a
hef="../../../../latest/docs/developer/index.html">Developers</a>
+ <li><a hef="../../../../latest/docs/advanced/index.html">Advanced</a>
+ <li><a hef="../../../../community/index.html">Community</a>
+ </ul>
+ <a href="#" class="close-link"><i class="arrow_up"></i></a>
+ </div>
+ <!-- Scripts -->
+ <script src="../../../../js/jquery-1.11.1.min.js"></script>
+ <script src="../../../../js/owl.carousel.min.js"></script>
+ <script src="../../../../js/bootstrap.min.js"></script>
+ <script src="../../../../js/wow.min.js"></script>
+ <script src="../../../../js/typewriter.js"></script>
+ <script src="../../../../js/jquery.onepagenav.js"></script>
+ <script src="../../../../js/tree.jquery.js"></script>
+ <script src="../../../../js/highlight.pack.js"></script>
+ <script src="../../../../js/main.js"></script>
+ </body>
+
+</html>
+
Propchange:
tomee/site/trunk/content/latest/docs/advanced/tomee-embedded/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: tomee/site/trunk/content/latest/docs/contrib/debug/debug-intellij.html
URL:
http://svn.apache.org/viewvc/tomee/site/trunk/content/latest/docs/contrib/debug/debug-intellij.html?rev=1847931&view=auto
==============================================================================
--- tomee/site/trunk/content/latest/docs/contrib/debug/debug-intellij.html
(added)
+++ tomee/site/trunk/content/latest/docs/contrib/debug/debug-intellij.html Sun
Dec 2 00:12:50 2018
@@ -0,0 +1,266 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Apache TomEE</title>
+ <meta name="description"
+ content="Apache TomEE is a lightweight, yet powerful, JavaEE
Application server with feature rich tooling." />
+ <meta name="keywords"
content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian"
/>
+ <meta name="author" content="Luka Cvetinovic for Codrops" />
+ <link rel="icon" href="../../../../favicon.ico">
+ <link rel="icon" type="image/png" href="../../../../favicon.png">
+ <meta name="msapplication-TileColor" content="#80287a">
+ <meta name="theme-color" content="#80287a">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/normalize.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/bootstrap.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/owl.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/animate.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/font-awesome-4.1.0/css/font-awesome.min.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../fonts/eleganticons/et-icons.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/jqtree.css">
+ <link rel="stylesheet" type="text/css" href="../../../../css/idea.css">
+ <link rel="stylesheet" type="text/css"
href="../../../../css/cardio.css">
+
+ <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="preloader">
+ <img src="../../../../img/loader.gif" alt="Preloader image">
+ </div>
+ <nav class="navbar">
+ <div class="container">
+ <div class="row"> <div class="col-md-12">
+
+ <!-- Brand and toggle get grouped for better mobile
display -->
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle
collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="sr-only">Toggle
navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <span>
+
+
+ <img src="../../../../img/logo-active.png">
+
+
+ </span>
+ Apache TomEE
+ </a>
+ </div>
+ <!-- Collect the nav links, forms, and other content
for toggling -->
+ <div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav navbar-right
main-nav">
+ <li><a
href="../../../../docs.html">Documentation</a></li>
+ <li><a
href="../../../../community/index.html">Community</a></li>
+ <li><a
href="../../../../security/index.html">Security</a></li>
+ <li><a
href="../../../../download-ng.html">Downloads</a></li>
+ </ul>
+ </div>
+ <!-- /.navbar-collapse -->
+ </div></div>
+ </div>
+ <!-- /.container-fluid -->
+ </nav>
+
+
+ <div id="main-block" class="container section-padded">
+ <div class="row title">
+ <div class="col-md-12">
+ <div class='page-header'>
+
+ <h1>null</h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+
+ <div class="col-md-12">
+ <a name='DEBUGIDE'></a>
+<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 it is recommended not to start with the trunk, because it is
common to have some blockers or non-stable functionality which could bring your
learning to a halt. So first start with the latest stable released source code.
Move 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 & war files) to cater
the different needs of different users. Here we discuss about the tomee plus
distribution & 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</p>
+</blockquote>
+<p>Unzip the zip into your home directory (or any other location)</p>
+<blockquote>
+ <p>unzip
~/openejb-4.7.1/tomee/apache-tomee/target/apache-tomee-plus-1.7.1.zip -d ~</p>
+</blockquote>
+<p>You will find the directory <strong>apache-tomee-plus-1.7.1</strong> in
your home folder. Lets run the TomEE.</p>
+<blockquote>
+ <p>cd ~/apache-tomee-plus-1.7.1/bin <br /><br/>./catalina.sh run <br /></p>
+</blockquote>
+<p>"INFO: Server startup in xxxx ms" is the Green light!</p>
+<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" /></p>
+<p>Select the ~/openejb-4.7.1 directory and press OK</p>
+<p>Select import project from external model & Maven as the external
model.</p>
+<p><img src="idea3.png" /></p>
+<p>Press Next on this screen.</p>
+<p><img src="idea4.png" /></p>
+<p>Select the main profile.</p>
+<p><img src="idea6.png" /></p>
+<p>Select the org.apache.openejb:openejb:4.7.1</p>
+<p><img src="idea7.png" /></p>
+<p>Select the JDK you want to use with.</p>
+<p><img src="idea8.png" /></p>
+<p>Give the project a name and press Finish.</p>
+<p><img src="idea9.png" /></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
tell 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>
+ <p>#!/bin/sh<br/>JPDA_SUSPEND="y"</p>
+ <p>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 > Run > Edit Configurations</li>
+ <li>Press the "**+**" 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="idea10.png" /></div></p>
+<p>To start debugging your TomEE+</p>
+<p>Main Menu > Run > 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>
+
+ </div>
+ </div>
+<footer>
+ <div class="container">
+ <div class="row">
+ <div class="col-sm-6 text-center-mobile">
+ <h3 class="white">Be simple. Be
certified. Be Tomcat.</h3>
+ <h5 class="light regular
light-white">"A good application in a good server"</h5>
+ <ul class="social-footer">
+ <li><a
href="https://www.facebook.com/ApacheTomEE/"><i class="fa
fa-facebook"></i></a></li>
+ <li><a
href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li>
+ <li><a
href="https://plus.google.com/communities/105208241852045684449"><i class="fa
fa-google-plus"></i></a></li>
+ </ul>
+ </div>
+ <div class="col-sm-6 text-center-mobile">
+ <div class="row opening-hours">
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../latest/docs/documentation.html"
class="white">Documentation</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/docs/admin/configuration/index.html" class="regular
light-white">How to configure</a></li>
+ <li><a
href="../../../../latest/docs/admin/file-layout.html" class="regular
light-white">Dir. Structure</a></li>
+ <li><a
href="../../../../latest/docs/developer/testing/index.html" class="regular
light-white">Testing</a></li>
+ <li><a
href="../../../../latest/docs/admin/cluster/index.html" class="regular
light-white">Clustering</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../examples.html" class="white">Examples</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../latest/examples/simple-cdi-interceptor.html" class="regular
light-white">CDI Interceptor</a></li>
+ <li><a
href="../../../../latest/examples/rest-cdi.html" class="regular
light-white">REST with CDI</a></li>
+ <li><a
href="../../../../latest/examples/ejb-examples.html" class="regular
light-white">EJB</a></li>
+ <li><a
href="../../../../latest/examples/jsf-managedBean-and-ejb.html" class="regular
light-white">JSF</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../community/index.html" class="white">Community</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="../../../../community/contributors.html" class="regular
light-white">Contributors</a></li>
+ <li><a
href="../../../../community/social.html" class="regular
light-white">Social</a></li>
+ <li><a
href="../../../../community/sources.html" class="regular
light-white">Sources</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3
text-center-mobile">
+ <h5><a
href="../../../../security/index.html" class="white">Security</a></h5>
+ <ul
class="list-unstyled">
+ <li><a
href="http://apache.org/security" target="_blank" class="regular
light-white">Apache Security</a></li>
+ <li><a
href="http://apache.org/security/projects.html" target="_blank" class="regular
light-white">Security Projects</a></li>
+ <li><a
href="http://cve.mitre.org" target="_blank" class="regular
light-white">CVE</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row bottom-footer text-center-mobile">
+ <div class="col-sm-12 light-white">
+ <p>Copyright © 1999-2016 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>
+ </div>
+ </div>
+ </div>
+ </footer>
+ <!-- Holder for mobile navigation -->
+ <div class="mobile-nav">
+ <ul>
+ <li><a
hef="../../../../latest/docs/admin/index.html">Administrators</a>
+ <li><a
hef="../../../../latest/docs/developer/index.html">Developers</a>
+ <li><a hef="../../../../latest/docs/advanced/index.html">Advanced</a>
+ <li><a hef="../../../../community/index.html">Community</a>
+ </ul>
+ <a href="#" class="close-link"><i class="arrow_up"></i></a>
+ </div>
+ <!-- Scripts -->
+ <script src="../../../../js/jquery-1.11.1.min.js"></script>
+ <script src="../../../../js/owl.carousel.min.js"></script>
+ <script src="../../../../js/bootstrap.min.js"></script>
+ <script src="../../../../js/wow.min.js"></script>
+ <script src="../../../../js/typewriter.js"></script>
+ <script src="../../../../js/jquery.onepagenav.js"></script>
+ <script src="../../../../js/tree.jquery.js"></script>
+ <script src="../../../../js/highlight.pack.js"></script>
+ <script src="../../../../js/main.js"></script>
+ </body>
+
+</html>
+
Propchange:
tomee/site/trunk/content/latest/docs/contrib/debug/debug-intellij.html
------------------------------------------------------------------------------
svn:eol-style = native