| <!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="/" title="Apache TomEE"> |
| <span> |
| |
| |
| <img |
| src="../../img/apache_tomee-logo.svg" |
| onerror="this.src='../../img/apache_tomee-logo.jpg'" |
| height="50" |
| > |
| |
| |
| </span> |
| </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 class="btn btn-accent accent-orange no-shadow" 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>JNDI Names</h1> |
| </div> |
| </div> |
| </div> |
| <div class="row"> |
| |
| <div class="col-md-12"> |
| <h1 id="_whats_my_beans_jndi_name_there_are_two_things_to_keep_in_mind" class="sect0">What’s My Bean’s JNDI Name? There are two things to keep in mind</h1> |
| <div class="paragraph"> |
| <p>before you start reading:</p> |
| </div> |
| <div class="paragraph"> |
| <p>1 OpenEJB provides a default JNDI name to your EJB.<br> |
| 2 You can customize the JNDI name.</p> |
| </div> |
| <div class="sect1"> |
| <h2 id="_default_jndi_name_the_default_jndi_name_is_in_the_following_format">Default JNDI name The default JNDI name is in the following format:</h2> |
| <div class="sectionbody"> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-json" data-lang="json">{deploymentId}{interfaceType.annotationName}</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Lets try and understand the above format. Both <em>deploymentId</em> and |
| <em>interfaceType.annotationName</em> are pre-defined variables. There are |
| other pre-defined variables available which you could use to customize |
| the JNDI name format.</p> |
| </div> |
| </div> |
| </div> |
| <h1 id="_jndi_name_formatting" class="sect0">JNDI Name Formatting</h1> |
| <div class="paragraph"> |
| <p>The <em>openejb.jndiname.format</em> property allows you to supply a template |
| for the global JNDI names of all your EJBs. With it, you have complete |
| control over the structure of the JNDI layout can institute a design |
| pattern just right for your client apps. See the |
| <a href="service-locator.html">Service Locator</a> doc for clever ways to use |
| the JNDI name formatting functionality in client code.</p> |
| </div> |
| <div class="paragraph"> |
| <p>variable</p> |
| </div> |
| <div class="paragraph"> |
| <p>description</p> |
| </div> |
| <div class="paragraph"> |
| <p>moduleId</p> |
| </div> |
| <div class="paragraph"> |
| <p>Typically the name of the ejb-jar file or the id value if specified</p> |
| </div> |
| <div class="paragraph"> |
| <p>ejbType</p> |
| </div> |
| <div class="paragraph"> |
| <p>STATEFUL, STATELESS, BMP_ENTITY, CMP_ENTITY, or MESSAGE_DRIVEN</p> |
| </div> |
| <div class="paragraph"> |
| <p>ejbClass</p> |
| </div> |
| <div class="paragraph"> |
| <p>for a class named org.acme.superfun.WidgetBean results in |
| org.acme.superfun.WidgetBean</p> |
| </div> |
| <div class="paragraph"> |
| <p>ejbClass.simpleName</p> |
| </div> |
| <div class="paragraph"> |
| <p>for a class named org.acme.superfun.WidgetBean results in WidgetBean</p> |
| </div> |
| <div class="paragraph"> |
| <p>ejbClass.packageName</p> |
| </div> |
| <div class="paragraph"> |
| <p>for a class named org.acme.superfun.WidgetBean results in |
| org.acme.superfun</p> |
| </div> |
| <div class="paragraph"> |
| <p>ejbName</p> |
| </div> |
| <div class="paragraph"> |
| <p>The ejb-name as specified in xml or via the 'name' attribute in an |
| @Stateful, <code>@Stateless</code>, or <code>@MessageDriven</code> annotation</p> |
| </div> |
| <div class="paragraph"> |
| <p>deploymentId</p> |
| </div> |
| <div class="paragraph"> |
| <p>The unique system id for the ejb. Typically the ejbName unless specified |
| in the openejb-jar.xml or via changing the openejb.deploymentId.format</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType</p> |
| </div> |
| <div class="paragraph"> |
| <p>see interfaceType.annotationName</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType.annotationName</p> |
| </div> |
| <div class="paragraph"> |
| <p>Following the EJB 3 annotations <code>@RemoteHome</code>, <code>@LocalHome</code>, <code>@Remote</code> and |
| @Local RemoteHome (EJB 2 EJBHome) LocalHome (EJB 2 EJBLocalHome) Remote |
| (EJB 3 Business Remote) Local (EJB 3 Business Local) Endpoint (EJB |
| webservice endpoint)</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType.annotationNameLC</p> |
| </div> |
| <div class="paragraph"> |
| <p>This is the same as interfaceType.annotationName, but all in lower case.</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType.xmlName</p> |
| </div> |
| <div class="paragraph"> |
| <p>Following the ejb-jar.xml descriptor elements , , , , and : home (EJB 2 |
| EJBHome) local-home (EJB 2 EJBLocalHome) business-remote (EJB 3 Business |
| Remote) business-local (EJB 3 Business Local) service-endpoint (EJB |
| webservice endpoint)</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType.xmlNameCc</p> |
| </div> |
| <div class="paragraph"> |
| <p>Camel-case version of interfaceType.xmlName: Home (EJB 2 EJBHome) |
| LocalHome (EJB 2 EJBLocalHome) BusinessRemote (EJB 3 Business Remote) |
| BusinessLocal (EJB 3 Business Local) ServiceEndpoint (EJB webservice |
| endpoint)</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceType.openejbLegacyName</p> |
| </div> |
| <div class="paragraph"> |
| <p>Following the OpenEJB 1.0 hard-coded format: (empty string) (EJB 2 |
| EJBHome) Local (EJB 2 EJBLocalHome) BusinessRemote (EJB 3 Business |
| Remote) BusinessLocal (EJB 3 Business Local) ServiceEndpoint (EJB |
| webservice endpoint)</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceClass</p> |
| </div> |
| <div class="paragraph"> |
| <p>(business) for a class named org.acme.superfun.WidgetRemote results in |
| org.acme.superfun.WidgetRemote (home) for a class named |
| org.acme.superfun.WidgetHome results in org.acme.superfun.WidgetHome</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceClass.simpleName</p> |
| </div> |
| <div class="paragraph"> |
| <p>(business) for a class named org.acme.superfun.WidgetRemote results in |
| WidgetRemote (home) for a class named org.acme.superfun.WidgetHome |
| results in WidgetHome</p> |
| </div> |
| <div class="paragraph"> |
| <p>interfaceClass.packageName</p> |
| </div> |
| <div class="paragraph"> |
| <p>for a class named org.acme.superfun.WidgetRemote results in |
| org.acme.superfun</p> |
| </div> |
| <h1 id="_setting_the_jndi_name" class="sect0">Setting the JNDI name</h1> |
| <div class="paragraph"> |
| <p>It’s possible to set the desired jndi name format for the whole server |
| level, an ejb-jar, an ejb, an ejb’s "local" interface |
| (local/remote/local-home/home), and for an individual interface the ejb |
| implements. More specific jndi name formats act as an override to any |
| more general formats. The most specific format dictates the jndi name |
| that will be used for any given interface of an ejb. It’s possible to |
| specify a general format for your server, override it at an ejb level |
| and override that further for a specific interface of that ejb.</p> |
| </div> |
| <div class="sect1"> |
| <h2 id="_via_system_property">Via System property</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The jndi name format can be set on a server level via a <em>system |
| property</em>, for example:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-java" data-lang="java">$ ./bin/openejb start |
| -Dopenejb.jndiname.format=\{ejbName}/\{interfaceClass}"</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>As usual, other ways of specifying system properties are via the |
| conf/system.properties file in a standalone server, or via the |
| InitialContext properties when embedded.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_via_properties_in_the_openejb_jar_xml">Via properties in the openejb-jar.xml</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>It’s possible to set the openejb.jndiname.format for an ejb-jar jar in a |
| META-INF/openejb-jar.xml file as follows:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <properties> |
| openejb.deploymentId.format = {ejbName} |
| openejb.jndiname.format = {deploymentId}{interfaceType.annotationName} |
| </properties> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_via_the_tag_for_a_specific_ejb">Via the tag for a specific ejb</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The following sets the name specifically for the interface |
| org.superbiz.Foo.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <jndi name="foo" interface="org.superbiz.Foo"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Or more generally…​</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <jndi name="foo" interface="Remote"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Or more generally still…​</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <jndi name="foo"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The 'name' attribute can still use templates if it likes, such as:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <jndi name="ejb/{interfaceClass.simpleName}" interface="org.superbiz.Foo"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_multiple_tags">Multiple tags</h3> |
| <div class="paragraph"> |
| <p>Multiple tags are allowed making it possible for you to be as specific |
| as you need about the jndi name of each interface or each logical group |
| of iterfaces (Local, Remote, LocalHome, RemoteHome).</p> |
| </div> |
| <div class="paragraph"> |
| <p>Given an ejb, FooBean, with the following interfaces: - business-local: |
| org.superbiz.LocalOne - business-local: org.superbiz.LocalTwo - |
| business-remote: org.superbiz.RemoteOne - business-remote: |
| org.superbiz.RemoteTwo - home: org.superbiz.FooHome - local-home: |
| org.superbiz.FooLocalHome</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following four examples would yield the same jndi names. The |
| intention with these examples is to show the various ways you can |
| isolate specific interfaces or types of interfaces to gain more specific |
| control on how they are named.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <jndi name="LocalOne" interface="org.superbiz.LocalOne"/> |
| <jndi name="LocalTwo" interface="org.superbiz.LocalTwo"/> |
| <jndi name="RemoteOne" interface="org.superbiz.RemoteOne"/> |
| <jndi name="RemoteTwo" interface="org.superbiz.RemoteTwo"/> |
| <jndi name="FooHome" interface="org.superbiz.FooHome"/> |
| <jndi name="FooLocalHome" interface="org.superbiz.FooLocalHome"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Or</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <!-- applies to LocalOne and LocalTwo --> |
| <jndi name="{interfaceClass.simpleName}" interface="Local"/> |
| |
| <!-- applies to RemoteOne and RemoteTwo --> |
| <jndi name="{interfaceClass.simpleName}" interface="Remote"/> |
| |
| <!-- applies to FooHome --> |
| <jndi name="{interfaceClass.simpleName}" interface="RemoteHome"/> |
| |
| <!-- applies to FooLocalHome --> |
| <jndi name="{interfaceClass.simpleName}" interface="LocalHome"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Or</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <!-- applies to RemoteOne, RemoteTwo, FooHome, and FooLocalHome --> |
| <jndi name="{interfaceClass.simpleName}"/> |
| |
| <!-- these two would count as an override on the above format --> |
| <jndi name="LocalOne" interface="org.superbiz.LocalOne"/> |
| <jndi name="LocalTwo" interface="org.superbiz.LocalTwo"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>or</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlight"><code class="language-xml" data-lang="xml"><openejb-jar> |
| <ejb-deployment ejb-name="FooBean"> |
| <!-- applies to LocalOne, LocalTwo, RemoteOne, RemoteTwo, FooHome, and FooLocalHome --> |
| <jndi name="{interfaceClass.simpleName}"/> |
| </ejb-deployment> |
| </openejb-jar></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <h1 id="_changing_the_default_setting" class="sect0">Changing the Default Setting</h1> |
| <div class="paragraph"> |
| <p><em>You are responsible for ensuring the names don’t conflict.</em></p> |
| </div> |
| <div class="sect1"> |
| <h2 id="_conservative_settings">Conservative settings</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>A very conservative setting such as</p> |
| </div> |
| <div class="paragraph"> |
| <p>"{deploymentId}/{interfaceClass}"</p> |
| </div> |
| <div class="paragraph"> |
| <p>would guarantee that each and every single interface is bound to JNDI. |
| If your bean had a legacy EJBObject interface, three business remote |
| interfaces, and two business local interfaces, this pattern would result |
| in<br> |
| <em>six</em> proxies bound into JNDI.<br></p> |
| </div> |
| <div class="paragraph"> |
| <p>Bordeline optimistic:<br></p> |
| </div> |
| <div class="paragraph"> |
| <p>The above two settings would work if you the interface wasn’t shared by |
| other beans.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="_pragmatic_settings">Pragmatic settings</h3> |
| <div class="paragraph"> |
| <p>A more middle ground setting such as |
| "{deploymentId}/\{interfaceType.annotationName}" would guarantee that |
| at least one proxy of each interface type is bound to JNDI. If your bean |
| had a legacy EJBObject interface, three business remote interfaces, and |
| two business local interfaces, this pattern would result in <em>three</em> |
| proxies bound into JNDI: one proxy dedicated to your EJBObject |
| interface; one proxy implementing all three business remote interfaces; |
| one proxy implementing the two business local interfaces.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Similarly pragmatic settings would be<br></p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_optimistic_settings">Optimistic settings</h3> |
| <div class="paragraph"> |
| <p>A very optimistic setting such as "{deploymentId}" would guarantee only |
| one proxy for the bean will be bound to JNDI. This would be fine if you |
| knew you only had one type of interface in your beans. For example, only |
| business remote interfaces, or only business local interfaces, or only |
| an EJBObject interface, or only an EJBLocalObject interface.</p> |
| </div> |
| <div class="paragraph"> |
| <p>If a bean in the app did have more than one interface type, one business |
| local and one business remote for example, by default OpenEJB will |
| reject the app when it detects that it cannot bind the second interface. |
| This strict behavior can be disabled by setting the |
| <em>openejb.jndiname.failoncollision</em> system property to <em>false</em>. When this |
| property is set to false, we will simply log an error that the second |
| proxy cannot be bound to JNDI, tell you which ejb is using that name, |
| and continue loading your app.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Similarly optimistic settings would be:<br></p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_advanced_details_on_ejb_3_0_business_proxies_the_simple_part">Advanced Details on EJB 3.0 Business Proxies (the simple part)</h3> |
| <div class="paragraph"> |
| <p>If you implement your business interfaces, your life is simple as your |
| proxies will also implement your business interfaces of the same type. |
| Meaning any proxy OpenEJB creates for a business local interface will |
| also implement your other business local interfaces. Similarly, any |
| proxy OpenEJB creates for a business remote interface will also |
| implement your other business remote interfaces.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_advanced_details_on_ejb_3_0_business_proxies_the_complicated_part">Advanced Details on EJB 3.0 Business Proxies (the complicated part)</h3> |
| <div class="paragraph"> |
| <p><em>Who should read?</em><br> |
| Read this section of either of these two apply to you:<br> |
| - You do not implement your business interfaces in your bean class<br> |
| - One or more of your business remote interfaces extend from |
| javax.rmi.Remote</p> |
| </div> |
| <div class="paragraph"> |
| <p>If neither of these two items describe your apps, then there is no need |
| to read further. Go have fun.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_not_implementing_business_interfaces">Not implementing business interfaces</h3> |
| <div class="paragraph"> |
| <p>If you do not implement your business interfaces it may not be possible |
| for us to implement all your business interfaces in a single interface. |
| Conflicts in the throws clauses and the return values can occur as |
| detailed <a href="multiple-business-interface-hazzards.html">here</a> . When |
| creating a proxy for an interface we will detect and remove any other |
| business interfaces that would conflict with the main interface.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_business_interfaces_extending_javax_rmi_remote">Business interfaces extending javax.rmi.Remote</h3> |
| <div class="paragraph"> |
| <p>Per spec rules many runtime exceptions (container or connection related) |
| are thrown from javax.rmi.Remote proxies as java.rmi.RemoteException |
| which is not a runtime exception and must be throwable via the proxy as |
| a checked exception. The issue is that conflicting throws clauses are |
| actually removed for two interfaces sharing the same method signature. |
| For example two methods such as these:<br> |
| - InterfaceA: void doIt() throws Foo;<br> |
| - InterfaceB: void doIt() throws RemoteException;</p> |
| </div> |
| <div class="paragraph"> |
| <p>can be implemented by trimming out the conflicting throws clauses as |
| follows:<br> |
| - Implementation: void doIt()\{}</p> |
| </div> |
| <div class="paragraph"> |
| <p>This is fine for a bean class as it does not need to throw the RMI |
| required javax.rmi.RemoteException. However if we create a proxy from |
| these two interfaces it will also wind up with a 'doIt()\{}' method that |
| cannot throw javax.rmi.RemoteException. This is very bad as the |
| container does need to throw RemoteException to any business interfaces |
| extending java.rmi.Remote for any container related issues or connection |
| issues. If the container attempts to throw a RemoteException from the |
| proxies 'doIt()\{}' method, it will result in an |
| UndeclaredThrowableException thrown by the VM.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The only way to guarantee the proxy has the 'doIt() throws |
| RemoteException \{}' method of InterfaceB is to cut out InterfaceA when |
| we create the proxy dedicated to InterfaceB.</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| </div> |
| </div> |
| <div style="margin-bottom: 30px;"></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> |
| </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/" 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 © 1999-2021 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> |
| |