Discussions

EJB programming & troubleshooting: How to deploy multiple instance of the same application

  1. Hi,

    I must deploy to the same application server two (and possibly more in the future) instance of the same EJB application composed by some EJB and a struts web application on the server side and a Swing GUI on the client side.

    The various instances must point to different databases (with the same table structure).

    It is easy to change the datasource used by CMP but what about JNDI names used on the client and on the struts app.?

    For intra-EJB calls there must be no problem because local references via java:/comp has local visibility but remote clients uses "public" JNDI names.

    So what is the best way to distinguish remote access between the instances ? Maybe some "instance" JNDI prefix ?

    Thank you
  2. Andrea:

      Once u have decided to deploy more than one instance off application. a separate container space will work for you and hence u really dont need to bother about intra-EJB calls. If your application is running smooth now then it will run smooth with multiple instances and u will have multiple container spaces.

      You will have to check with the vendor hirarchy. and then decide on how u r gonna place multiple instances of application. Weblogic 6.x supported domain structure and you can create multiple domains or give different name for the application in ur config.xml and this shall help you run multiple instances of application.

    Hope this helps
    Regards
    Chetan
  3. Thank you for your comments.

    I'm using JBoss 3.2.2. It is not clear to me, however, how remote clients can eventually distinguish between the applications using domains on application server that supports them.

    Maybe different JNDI service TCP port ?
    Or is a domain a "prefix" that is automatically added to JNDI names ?
  4. Andrea:

        Check this tutorial
    JNDI Tutorial. This will help you understand the concept and decide on solution.

    Hope this helps
    Regards
    Chetan