The rules that the Jndi name adheres to when the JBOSS EAP6 series two client accesses EJBs in the ear

Source: Internet
Author: User

the Jndi syntax of the EJB (the adherence of the syntax is very important throughout the invocation of the remote EJB)


See jboss-as-quickstarts-7.1.1.cr2\ejb-remote\client\src\main\java\org\jboss\as\quickstarts\ejb\remote\client\ Notes in Remoteejbclient.java:


<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" >//The JNDI lookup name for a stateless session beans has the syntax of://EJB:&LT;APPNAME&GT;/&LT;MODULENAME&G  t;/<distinctname>/<beanname>!<viewclassname>//<appName> The application name is the name of  The ear, the EJB is deployed in//(without the. ear).  The If the EJB JAR is not a deployed in a EAR then this is//blank. The app name can also is specified in the EAR ' s application.xml////<moduleName> by the Defaul  T the module name is the name of the EJB jar file (without the//. jar suffix). The module name might is overridden in the ejb-jar.xml///<distinctName>: AS7 allows each deployment t      O has an (optional) distinct name.      This example does is not the use of this so leave it blank. <beanName>: The name of the session been to be INVOked.  <viewclassname&gt: The fully qualified classname of the remote interface. Must include//the whole package name.</span></span>

The JNDI lookup name for a stateful session Bean has the syntax of:

Ejb:<appname>/<modulename>/<distinctname>/<beanname>!<viewclassname>? Stateful

<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;"           >////<appName> The application name is the name of the EAR, the EJB is deployed in//  (without the. ear).  The If the EJB JAR is not a deployed in a EAR then this is//blank. The app name can also is specified in the EAR ' s application.xml////<moduleName> by the Defaul  T the module name is the name of the EJB jar file (without the//. jar suffix). The module name might is overridden in the ejb-jar.xml///<distinctName>: AS7 allows each deployment t      O has an (optional) distinct name.      This example does is not the use of this so leave it blank.      <beanName>: The name of the session been to be invoked.  <viewclassname&gt: The fully qualified classname of the remote interface. Must include//the whole package name.</span></span> 

now we have refined the syntax above, which is the most error-prone place! 1. Access to beans in a pure EJB jar deployment


1.1 JNDI Lookup name for astatelesssession Beans has thesyntax of:

<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" >    ejb:/<modulename>/<distinctname>/<beanname>!<viewclassname>    or    ejb:/ <moduleName>/<distinctName>//<beanName>!<viewClassName>    For example:    "ejb:/ jboss-as-ejb-remote-app/counterbean! "+ RemoteCounter.class.getName ()    " ejb:/jboss-as-ejb-remote-app// counterbean! "+ RemoteCounter.class.getName () </span></span></span>

1.2 JNDI lookup name for astatefullsession beans has the syntax of:
<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" >ejb:/<modulename>/<distinctname>/<beanname>!<viewclassname>?stateful or ejb:/< Modulename>/<distinctname>//<beanname>!<viewclassname>?stateful For example: "ejb:/ jboss-as-ejb-remote-app/counterbean! "+ RemoteCounter.class.getName () +"? Stateful "" ejb:/jboss-as-ejb-remote-app// counterbean! "+ RemoteCounter.class.getName () +"? Stateful "</span></span>

2. Access to the bean contained in the EJB jar in the ear deployment
2.1 JNDI lookup name for astatelesssession Beans has the
Syntax of:
<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" >ejb:<appName>/<moduleName>/<distinctName>/<beanName>!<viewClassName> or EJB: <appName>/<moduleName>/<distinctName>//<beanName>!<viewClassName> For example: "EJB: nms-server-ear/nms-server-ejb/securedremotesession! "+ ISecuredRemoteSession.class.getName ()" ejb:nms-server-ear/ nms-server-ejb//securedremotesession! "+ ISecuredRemoteSession.class.getName () Note: AppName Front has no slash"/"!!! This is the most error-prone place!!! (If you start with a slash, it means that the EJB jar is not deployed in the ear!!!) ) </span></span>

2.2 JNDI lookup name for astatefullsession beans has the syntax of:
<span style= "FONT-SIZE:18PX;" ><span style= "FONT-SIZE:18PX;" >ejb:<appname>/<modulename>/<distinctname>/<beanname>!<viewclassname>? stateful or ejb:<appname>/<modulename>/<distinctname>//<beanname>!<viewclassname>? Stateful Note: <span style= "color: #FF0000;" There is no slash "/"!!! in front of >appname This is the most error-prone place!!! </span> (if you start with a slash, it means that the EJB jar is not deployed in the ear!!!) ) </span></span>

Summary

Read English document Interesting ah, learn English well, the information of the network more reliable AH!

The rules that the Jndi name adheres to when the JBOSS EAP6 series two client accesses EJBs in the ear

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.