Using enterprise JavaBeans applications that call local EJB components in another application

The Enterprise JavaBeans (EJB) specification requires that local client views are supported for EJB components that are packaged within the same application. This includes local homes, local business interfaces, and the no-interface view. Local client views are also supported for EJB components that are not packaged within the same application, but additional configuration is required.

Pourquoi et quand exécuter cette tâche

The product supports access to local client views to EJB components packaged within a separate application with some restrictions:
  • The local interface and all parameter, return, and exception types that are used by the local interface must be visible to the class loader of both the calling application and the target EJB application. You can ensure that they are visible by either using a shared library that is associated with a server class loader or by using a common library reference with both applications.
  • When the target EJB application is stopped, any cached references to the EJB must be refreshed by restarting the calling application. The simplest solution is to restart the calling application whenever you restart a target EJB application on which it relies.

Procédure

Add the configuration to the server.xml file; for example:
<library id="ejbInterfaceLib">
        <file name="${server.config.dir}/lib/ejbInterfaceLib.jar"/>
    </library>
    <webApplication id="ejbClient" location="ejbClient.war">
        <classloader commonLibraryRef="ejbInterfaceLib"/>
    </webApplication>
    <ejbApplication id="ejbApp" location="ejbApp.ear">
        <classloader commonLibraryRef="ejbInterfaceLib"/>
    </ejbApplication>

Icône indiquant le type de rubrique Rubrique Tâche

Nom du fichier : twlp_ejb_local.html