簡體   English   中英

WebLogic上不同JVM /服務器上的遠程EJB注入

[英]Remote EJB injection on different JVM/Servers on WebLogic

不同的WebLogic服務器上有兩個Ear應用程序:

1)app1.ear

2)app2.ear

問題是如何將app2.ear中定義的bean注入app1.ear中定義的bean? 我應該在ejb-jar.xml和weblogic-jar.xml中編寫配置嗎? 如果是,怎么辦?

我在app1部分上寫了這樣的東西(UserService在app2中定義):

<weblogic-enterprise-bean>
    <ejb-name>UserManagementServiceRemote</ejb-name>
    <ejb-reference-description>
        <ejb-ref-name>tadUserService</ejb-ref-name>
        <jndi-name>t3://192.168.137.99:7001/UserService#com.abc.remote.UserService</jndi-name>
    </ejb-reference-description>
</weblogic-enterprise-bean>

而在app1中,它是通過以下方式注入的:

@Stateless(name = "UserManagementService", mappedName = "UserManagementService")
public class UserManagementServiceImpl implements UserManagementServiceLocal, UserManagementServiceRemote, Serializable {

@EJB(name = "tadUserService")
private UserService tadUserService;
.
.
.

但這是行不通的。 WebLogic說:

Caused By: weblogic.application.naming.ReferenceResolutionException: [J2EE:160200]Error resolving ejb-ref "tadUserService" from module "tps-business-14.1.2.jar" of application "_appsdir_tps-ear-14.1.2_ear". The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the "com.transwide.twadmin.business.uma.remote.UserService" interface. Link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.

任何幫助,將不勝感激。

您可以在WebLogic控制台中使用“服務”->“外部JNDI提供程序”菜單項,以將遠程服務器JNDI區域添加到WebLogic中。 然后,您可以從該服務器中將遠程bean查找為本地bean。 嘗試使用JNDI查找,而不是@EJB注入。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM