blob: d3c3b50fd1e653025a2485e07ffe222cac5049a6 [file] [log] [blame]
<!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/security.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 main-block">
<div class="row title">
<div class="col-md-12">
<div class='page-header'>
<h1>New in OpenEJB 3.0</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="sect1">
<h2 id="_ejb_3_0">EJB 3.0</h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenEJB 3.0 supports the EJB 3.0 specification as well as the prior EJB
2.1, EJB 2.0, and EJB 1.1. New features in EJB 3.0 include:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Annotations instead of xml</p>
</li>
<li>
<p>No home interfaces</p>
</li>
<li>
<p>Business Interfaces</p>
</li>
<li>
<p>Dependency Injection</p>
</li>
<li>
<p>Intercpetors</p>
</li>
<li>
<p>Java Persistence API</p>
</li>
<li>
<p>Service Locator (ala SessionContext.lookup)</p>
</li>
<li>
<p>POJO-style beans</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>EJB 2.x features since OpenEJB 1.0 also include: - MessageDriven Beans -
Container-Managed Persistence (CMP) 2.0 - Timers</p>
</div>
<div class="paragraph">
<p>The two aspects of EJB that OpenEJB does not yet support are: - Web
Services (JAX-WS, JAX-RPC) - CORBA</p>
</div>
<div class="paragraph">
<p>JAX-WS and CORBA support will be added in future releases. Support for
the JAX-RPC API is not a planned feature.</p>
</div>
</div>
</div>
<h1 id="_extensions_to_ejb_3_0" class="sect0">Extensions to EJB 3.0</h1>
<div class="sect1">
<h2 id="_cmp_via_jpa">CMP via JPA</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Our CMP implementation is a thin layer over the new Java Persistence API
(JPA). This means when you deploy an old style CMP 1.1 or CMP 2.1 bean
it is internally converted and ran as a JPA bean. This makes it possible
to use both CMP and JPA in the same application without any coherence
issues that can come from using two competing persistence technologies
against the same data. Everything is ultimately JPA in the end.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_extended_dependency_injection">Extended Dependency Injection</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Dependency Injection in EJB 3.0 via <code>@Resource</code> is largely limited to
objects provided by the container, such as DataSources, JMS Topics and
Queues. It is possible for you to supply your own configuration
information for injection, but standard rules allow for only data of
type String, Character, Boolean, Integer, Short, Long, Double, Float and
Byte. If you needed a URL, for example, you&#8217;d have to have it injected
as a String then convert it yourself to a URL. This is just plain silly
as the conversion of Strings to other basic data types has existed in
JavaBeans long before Enterprise JavaBeans existed.</p>
</div>
<div class="paragraph">
<p>OpenEJB 3.0 supports injection of any data type for which you can supply
a JavaBeans PropertyEditor. We include several built-in PropertyEditors
already such as Date, InetAddress, Class, File, URL, URI, Map, List and
more.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-java" data-lang="java">import java.net.URI;
import java.io.File;
import java.util.Date;
@Stateful
public class MyBean {
@Resource URI blog;
@Resource Date birthday;
@Resource File homeDirectory;
}</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_meta_inf_env_entries_properties">The META-INF/env-entries.properties</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Along the lines of injection, one of the last remaining things in EJB 3
that people need an ejb-jar.xml file for is to supply the value of
env-entries. Env Entries are the source of data for all user supplied
data injected into your bean; the afore mentioned String, Boolean,
Integer, etc. This is a very big burden as each env-entry is going to
cost you 5 lines of xml and the complication of having to figure out how
to add you bean declaration in xml as an override of an existing bean
and not accidentally as a new bean. All this can be very painful when
all you want is to supply the value of a few <code>@Resource</code> String fields in
you bean class.</p>
</div>
<div class="paragraph">
<p>To fix this, OpenEJB supports the idea of a
META-INF/env-entries.properties file where we will look for the value of
things that need injection that are not container controlled resources
(i.e. datasources and things of that nature). You can configure you ejbs
via a properties file and skip the need for an ejb-jar.xml and it&#8217;s 5
lines per property madness.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-properties" data-lang="properties">blog = http://acme.org/myblog
birthday = locale=en_US style=MEDIUM Mar 1, 1954
homeDirectory = /home/esmith/</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_support_for_glassfish_descriptors">Support for GlassFish descriptors</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Unit testing EJBs with OpenEJB is a major feature and draw for people,
even for people who may still use other app servers for final deployment
such as Geronimo or GlassFish. The descriptor format for Geronimo is
natively understood by OpenEJB as OpenEJB is the EJB Container provider
for Geronimo. However, OpenEJB also supports the GlassFish descriptors
so people using GlassFish as their final server can still use OpenEJB
for testing EJBs via plain JUnit tests in their build and only have one
set of vendor descriptors to maintain.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_javaee_5_ear_and_application_client_support">JavaEE 5 EAR and Application Client support</h2>
<div class="sectionbody">
<div class="paragraph">
<p>JavaEE 5 EARs and Application Clients can be deployed in addition to ejb
jars. EAR support is limited to ejbs, application clients, and
libraries; WAR files and RAR files will be ignored. Per the JavaEE 5
spec, the META-INF/application.xml and META-INF/application-client.xml
files are optional.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_application_validation_for_ejb_3_0">Application Validation for EJB 3.0</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Incorrect usage of various new aspects of EJB 3.0 are checked for and
reported during the deployment process preventing strange errors and
failures.</p>
</div>
<div class="paragraph">
<p>As usual validation failures (non-compliant issues with your
application) are printed out in complier-style "all-at-once" output
allowing you to see and fix all your issues in one go. For example, if
you have 10 <code>@PersistenceContext</code> annotations that reference an invalid
persistence unit, you get all 10 errors on the <em>first</em> deploy rather
than one failure on the first deploy with 9 more failed deployments to
go.</p>
</div>
<div class="paragraph">
<p>Validation output comes in three levels. The most verbose level will
tell you in detail what you did wrong, what the options are, and what to
do next&#8230;&#8203; even including valid code and annotation usage tailored to
your app that you can copy and paste into your application. Very ideal
for beginners and people using OpenEJB in a classroom setting.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_most_configurable_jndi_names_ever">Most configurable JNDI names ever</h2>
<div class="sectionbody">
</div>
</div>
<h1 id="_general_improvements" class="sect0">General Improvements</h1>
<div class="sect1">
<h2 id="_online_deployment_mark_security_service_mark_connection_pooling">Online Deployment <mark> Security Service </mark> Connection Pooling ##</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Configuration Overriding <mark> Flexible JNDI Name Formatting </mark> Cleaner
Embedding <mark> Tomcat 6 Support </mark> Business locals remotable</p>
</div>
<div class="paragraph">
<p>If you want to make business local interfaces remotable, you can set
this property:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-properties" data-lang="properties"> openejb.remotable.businessLocals=true</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then you can lookup your business local interfaces from remote clients.</p>
</div>
<div class="paragraph">
<p>You&#8217;d still have to ensure that the you pass back and forth is
serializable.</p>
</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="../../latest/examples/" 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 &copy; 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>