1 Reply Latest reply on Jan 3, 2008 7:06 PM by wayne baylor

    Test and Production deployment

    Bryan Oliver Newbie

      I want to build two Jar files of EJBs and deploy them to one JBoss AS. They essentially will contain the same EJBs, but the EJBs in one Jar file will connect to a test database and the other EJBs in the other Jar file will connect to a production database.

      How can I achieve this deploying to one instance of JBoss? I know how to setup the two data sources in JBoss but how do deploy these two Jar files to JBoss and have the client make a call to jboss to return the correct EJBs ( test or production )?

      Any ideas?

        • 1. Re: Test and Production deployment
          wayne baylor Apprentice

          probably not possible in jar format. you might have a chance if you assigned different jndi names, but then you'd have different descriptors for each jar--which you want to avoid i'm guessing.

          if you pack each jar into an ear and use jboss's default JNDI naming (which includes the name of the ear), then you could do it. so, if you had production.jar in prod.ear and test.jar in test.ear, then your client could use the following to lookup the beans:
          1) Production: context.lookup("prod/MyBeanName/remote");
          2) Test: context.lookup("test/MyBeanName/remote");

          assuming they're remote interfaces of course.