浏览 4278 次
锁定老帖子 主题:两个EAR之间如何互相调用EJB?
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-04-05
我的应用也是做成一个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 不知道该如何配置才能找到? 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-04-06
AuthenticationSession
AuthorizationSession 笔误?帖子错了?代码错了? |
|
返回顶楼 | |
发表时间:2007-04-06
不好意思,笔误
|
|
返回顶楼 | |
发表时间:2007-04-06
找到问题所在了,jndi.properties中把127.0.0.1改成192.168.1.XXX就可以了
|
|
返回顶楼 | |