1 Reply Latest reply on Aug 3, 2002 11:38 PM by nhebert

    Deploying Same App on Same JBoss

    jgoetsch

      Question: How do you design an application that can be released multiple times on the same JBoss instance?

      I am planning on creating a website and ejbs for a web application. This application will have different customers that need their own instance of the application. All the code will remain the same, but will access a different Dataset/Database.

      I understand context in the Servlet Engine architecture, but how do you move that concept into EJBs? I have programmed a site not using EJBs, and all I needed to do is change 3 configurations: DB Info, Logging Info, and a Directory. I was then able to run on the same server under different contexts.

      I was using a home grown framework that was doing a lot of what Application servers do, so I figured it would be best to switch over to a more Standards compliant environment.

      I have thought of a couple ways to get the job done, but I will not explain them now, because I have a feeling that it will limit the discussion rather than promoting new ideas. I will gladly explain my ideas at a later point, or when asked.

      I assume that there will be questions, so I will be available to answer any questions.

      Thanks,
      Jeffrey

        • 1. Re: Deploying Same App on Same JBoss
          nhebert

          Jeffery,

          If I understand what you are saying,
          Try using the Environment Naming Context (ENC) and
          EJB References.

          This way you can deploy the very same EJBs using
          different names that can be set at deploy time.

          Example: Xejb referrs to Yejb. Inside Xejb I would
          use "java:comp/env/ejb/Yejb" when I look it up and
          have an EJB reference to it in the ejb-jar.xml
          deployment descriptor

          Think of using "java:comp/env/ejb/?" as an alias.

          Then at deploy time in jboss.xml I could give Xejb
          any JNDI name and map its use of "java:comp/env/ejb/Yejb"
          to anything I like.

          The same holds true for resource names like databases.

          I can refer to "java:comp/env/jdbc/DataBase" in my code
          and map its resource reference to anything I like at
          deploy time.

          All this without having to change any code.

          In general, directly coding JNDI references from the
          gobal namespace in your EJBs, Servlets, etc is not a
          very good idea.

          Hope this helps.

          Cheers,

          Noel.