论坛首页 Java企业应用论坛

两个EAR之间如何互相调用EJB?

浏览 4277 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-04-05  
在做一个PMI系统,需要与PKI系统集成。PKI用的是EJBCA,部署在JBoss4.0.5下面,做成了ejbca.ear
我的应用也是做成一个EAR包,需要调用ejbca.ear中的AuthorizationSession这个ejb

ejbca.ear中的ejb-jar.xml
 <session id="Session_AuthorizationSession">
         <description><![CDATA[Session bean handling interface with ra authorization]]></description>
         <display-name>AuthorizationSessionSB</display-name>

         <ejb-name>AuthorizationSession</ejb-name>

         <home>org.ejbca.core.ejb.authorization.IAuthorizationSessionHome</home>
         <remote>org.ejbca.core.ejb.authorization.IAuthorizationSessionRemote</remote>
         <local-home>org.ejbca.core.ejb.authorization.IAuthorizationSessionLocalHome</local-home>
         <local>org.ejbca.core.ejb.authorization.IAuthorizationSessionLocal</local>
         <ejb-class>org.ejbca.core.ejb.authorization.AuthorizationSessionSession</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
        ......
</session>


ejbca.ear中的jboss.xml
 <session>
         <ejb-name>AuthorizationSessio</ejb-name>
         <jndi-name>AuthorizationSessio</jndi-name>
         <local-jndi-name>AuthorizationSessioLocal</local-jndi-name>

        <method-attributes>
        </method-attributes>
 </session>

  
我自己的EAR包中是这样引用的
        private IAuthorizationSessionRemote getAuthorizationSession() {
		if (authorizationsession == null) {
			try {
				IAuthorizationSessionHome authorizationsessionhome = (IAuthorizationSessionHome) getLocator().getRemoteHome("java:comp/env/ejb/AuthorizationSession", IAuthorizationSessionHome.class);
				authorizationsession = authorizationsessionhome	.create();
			} catch (CreateException e) {
				throw new EJBException(e);
			} catch (RemoteException e) {
				throw new EJBException(e);
			}
		}
		return authorizationsession;
	}

其实就是通过JNDI去寻找,但是老是提示我ejb not found

不知道该如何配置才能找到?
   发表时间:2007-04-06  
AuthenticationSession
AuthorizationSession

笔误?帖子错了?代码错了?
0 请登录后投票
   发表时间:2007-04-06  
不好意思,笔误
0 请登录后投票
   发表时间:2007-04-06  
找到问题所在了,jndi.properties中把127.0.0.1改成192.168.1.XXX就可以了
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics