标签:
参见jboss-as-quickstarts-7.1.1.CR2\ejb-remote\client\src\main\java\org\jboss\as\quickstarts\ejb\remote\client\RemoteEJBClient.java 中的注释:
<span style="font-size:18px;"><span style="font-size:18px;"> // The JNDI lookup name for a stateless session bean has the syntax of: // ejb:<appName>/<moduleName>/<distinctName>/<beanName>!<viewClassName> // <appName> The application name is the name of the EAR that the EJB is deployed in // (without the .ear). If the EJB JAR is not deployed in an EAR then this is // blank. The app name can also be specified in the EAR's application.xml // // <moduleName> By the default the module name is the name of the EJB JAR file (without the // .jar suffix). The module name might be overridden in the ejb-jar.xml // // <distinctName> : AS7 allows each deployment to have an (optional) distinct name. // This example does not use this so leave it blank. // // <beanName> : The name of the session been to be invoked. // // <viewClassName>: The fully qualified classname of the remote interface. Must include // the whole package name.</span></span>
// 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 that the EJB is deployed in // (without the .ear). If the EJB JAR is not deployed in an EAR then this is // blank. The app name can also be specified in the EAR's application.xml // // <moduleName> By the default the module name is the name of the EJB JAR file (without the // .jar suffix). The module name might be overridden in the ejb-jar.xml // // <distinctName> : AS7 allows each deployment to have an (optional) distinct name. // This example does not use this so leave it blank. // // <beanName> : The name of the session been to be invoked. // // <viewClassName>: The fully qualified classname of the remote interface. Must include // the whole package name.</span></span>
<span style="font-size:18px;"><span style="font-size:18px;"><span style="font-size:18px;"> ejb:/<moduleName>/<distinctName>/<beanName>!<viewClassName> 或者 ejb:/<moduleName>/<distinctName>//<beanName>!<viewClassName> 比如: "ejb:/jboss-as-ejb-remote-app/CounterBean!" + RemoteCounter.class.getName() "ejb:/jboss-as-ejb-remote-app//CounterBean!" + RemoteCounter.class.getName()</span></span></span>
<span style="font-size:18px;"><span style="font-size:18px;">ejb:/<moduleName>/<distinctName>/<beanName>!<viewClassName>?stateful 或者 ejb:/<moduleName>/<distinctName>//<beanName>!<viewClassName>?stateful 比如: "ejb:/jboss-as-ejb-remote-app/CounterBean!" + RemoteCounter.class.getName()+"?stateful" "ejb:/jboss-as-ejb-remote-app//CounterBean!" + RemoteCounter.class.getName()+"?stateful"</span></span>
<span style="font-size:18px;"><span style="font-size:18px;">ejb:<appName>/<moduleName>/<distinctName>/<beanName>!<viewClassName> 或者 ejb:<appName>/<moduleName>/<distinctName>//<beanName>!<viewClassName> 比如: "ejb:nms-server-ear/nms-server-ejb/SecuredRemoteSession!" + ISecuredRemoteSession.class.getName() "ejb:nms-server-ear/nms-server-ejb//SecuredRemoteSession!" + ISecuredRemoteSession.class.getName() 注意: appName 前面没有 斜线 "/"!!! 这是最容易出错的地方!!! (如果以斜线开头,表明是ejb jar不是在 ear中部署的!!!)</span></span>
<span style="font-size:18px;"><span style="font-size:18px;">ejb:<appName>/<moduleName>/<distinctName>/<beanName>!<viewClassName>?stateful 或者 ejb:<appName>/<moduleName>/<distinctName>//<beanName>!<viewClassName>?stateful 注意: <span style="color:#FF0000;">appName 前面没有 斜线 "/"!!! 这是最容易出错的地方!!!</span> (如果以斜线开头,表明是ejb jar不是在 ear中部署的!!!)</span></span>
看英文文档耐人寻味啊,好好学习英语吧,外网的资料更加的可靠啊!
JBOSS EAP6 系列二 客户端访问位于EAR中的EJB时,jndi name要遵守的规则
标签:
原文地址:http://blog.csdn.net/lishehe/article/details/43067715