OC4J Remote Access

Atlassian - J2EE Support and Software
Search the Knowledge Base
 PATH: Knowledge Base > Content > OrionServer > Docs > Remote AccessDirectory | Content Areas 

Remote Access

by The Orion Team

This article explains how to access remote EJB layers in different configurations using the Orion Application Server.

Introduction
Different Applications on single Server
  • This section describes how to access another applications EJB layer from an application deployed at the same server.

    It involves Orion specific configuration that will lead to that the second application can utilize the classes of the first application as if they were local. It is therefore very important not to include any remote- or home-interfaces belonging to a module in the first application in the second application's modules. Such duplication could lead to ClassCastExceptions being thrown at runtime.

    Figure 1: Using parent attribute to extend applications
    Figure 1: Using parent attribute to extend applications

    This section involves the following steps:

    Step 1: Deploying a.ear on Server A
    Step 2: Deploying b.ear on Server A
    Step 3: Binding web.war to Site A
    Step 4: Edit deployment settings
    Step 5: Testing

    Throughout these steps, we will use the following terms:

    TermDescription
    Server A The Orion Application Server that will host the two applications
    a.ear The J2EE application holding an EJB-module with the EJB to access
    b.ear The J2EE application holding an Web-module containing a Servlet that wants to access the EJB in the application a.ear
    Site A The Web-site the Web-module should be bound to.
    ejb.jar The EJB-module in a.ear, containing a EJB.
    web.war The Web-module in b.ear, containing a Servlet that wants to access the EJB in the application a.ear

    Step 1: Deploying a.ear on Server A
    • In order for an application to be accessible it must be deployed somewhere. The first thing to do is therefore to deploy a.ear on the Server A that will host the applications.



      Tip
      Tip: Manual or Console
      Applications can be deployed manually or by using the Console.


    Step 2: Deploying b.ear on Server A
    • As the described scenario involved two applications on the same server, the client application (b.ear) should also be deployed on Server A.



      Notice
      Note:
      If the Console is used for deploying b.ear, make sure that a.ear is selected as parent of the application and skip step 4 below.


    Step 3: Binding web.war to Site A
    • As the application b.ear holds an Web-module (refered to as web.war) this must be bound to the site (Site A) on Server A.



    Step 4: Edit deployment settings
    • Edit server.xml so that the deployment settings for application a.ear and b.ear to look something like the following:

      • <application name="a" path="/orion/applications/a.ear" auto-start="true" />
        <application name="b" path="/orion/applications/b.ear" parent="a" auto-start="true" />



      Notice
      Note:
      The path specified above is a sample path that you need to replace with your own path to your applications.


    Step 5: Testing
    • You should now be able to use the Servlet in web.war to access the EJBs in ejb.jar.

Same Application on different Servers
  • This section describes how to access the EJB layer on a remote Server using deployment of the same Application on both servers but marking the EJB-module as remote on one of them.

    Figure 2: Using remote attribute to access module on other server.
    Figure 2: Using remote attribute to access module on other server.

    This section involves the following steps:

    Step 1: Deploying a.ear on Server A
    Step 2: Deploying a.ear on Server B
    Step 3: Configure Server A to be accessable
    Step 4: Configure Server B to access Server A
    Step 5: Edit deployment configuration for a.ear on Server B
    Step 6: Testing

    Throughout these steps, we will use the following terms:

    TermDescription
    Server A The Orion Application Server that will deploy the EJB-module
    Server B The Orion Application Server that will bind the Web-module
    a.ear The J2EE application holding a EJB-module and a Web-module to access it
    Site A The Web-site the Web-module should be bound to.
    web.war The Web-module in a.ear, containing a Servlet that wants to access the EJB in the application a.ear
    ejb.jar The EJB-module in a.ear, containing an EJB.

    Step 1: Deploying a.ear on Server A
    • In order for an application to be accessible it must be deployed somewhere. The first thing to do is therefore to deploy a.ear on the Server A that will host the applications EJB-module.



      Tip
      Tip: Manual or Console
      Applications can be deployed manually or by using the Console.


    Step 2: Deploying a.ear on Server B
    • As the described scenario involved one application deployed on two different servers, the application should now also be deployed on Server B.



      Notice
      Note:
      In order for this setup to work, you need to deploy the application using the same deployment-name on both servers.


      Notice
      Note:
      If the Console is used to deploy a.ear on server B, make sure to mark the EJB-module as remote and skip step 5 below.


    Step 3: Configure Server A to be accessable
    • In order for applications on Server B to be able to communicate with applications on Server A, Server A must accept RMI communication.

      Configure Server A to be acessible for RMI requests.



    Step 4: Configure Server B to access Server A
    • In order for applications on Server B to be able to communicate with applications on Server A, Server B must know about Server A.

      Configure Server B to have RMI access to Server B.



    Step 5: Edit deployment configuration for a.ear on Server B
    • Although we deployed a.ear on Server B, we will not want to use its ejb.jar locally. We must therefore edit the Orion specific deployment configuration of the application and mark the EJB-module as remote.

      Edit orion-application.xml so that it looks something like the following:

      • <ejb-module ... remote="true"/>



    Step 6: Testing
    • You should now be able to use the Servlet in web.war on Server B to access the EJBs in ejb.jar on Server A.

Different Applications on different Servers
  • This section describes how to access another applications EJB layer from an application deployed on a remote Server.

    TODO: Describe scenario with different applications on different servers.

To do
  • Things considered for a future version of this document:

    • Describe scenario with different applications on different servers.

Article Feedback & Rating   |   Ask a question about this on our Forums
Yes, this solved my problem. No, this did not solve my problem.
Enter email if you want Atlassian to help you solve it:


  Contributed Annotations     Annotate Page   |   Recent Annotations    
Ranga (2002.May.09 at 16:58 CDT)
Hi,

I would like to know how a JSP/Servlet/EJB from an application (A) would access EJBs in a different application (B) on the same server.
Application C is configured to be the parent of Application A.

Thanks,
Ranga
 
carty (2005.January.29 at 11:33 CST)
Consider the following scenario
Two Applications
a.ear --> has ejb component ejbcomp1
b.ear --> has ejb component ejbcomp2

I would like deploy a.ear in one instance of appserver
and b.ear on different instance of appserver.
How to access ejbcomp1 from ejbcomp2
I tried all context factories and jndi properties.Nothing worked out.
In this forum I am seeing a
"TODO Describe scenario with different applications on different servers" in this forum
Is this design flaw in orion appserver?

 

 

Article Tools
Related Pages
Directory Categories


Keep In Touch

Want to stay in touch with the latest news about J2EE technologies and Orion?

Sign up for the monthly Atlassian newsletter and keep in touch!


JIRA! Issue tracking and project management

Your feedback is very important to us. Please tell us what you think!
© 2001-2004 - Atlassian - All Rights Reserved
Contact Us
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值