How would you deploy multiple environments to the same Jboss (or EJB) server (just ejbs)? I mean 'test', 'demo', 'prod(uction)' etc of the same application (although there may be changes between test and prod if still being worked on) with those environments pointing to different databases.
Apache/tomcat most likely on different box from the one JBOSS running. Looking at having the EJBs for the same app but different implementations on the same JBOSS instance.
Here's my ideas so far - have I gone too far?
The web part is no problem - using tomcat its just a different directory (web application), eg http://url/myAppTest or http://url/myAppDemo with the approp JSP/beans/servlets for the implementation in the directory. But the app calls EJBs in Jboss - problem is test/demo/prod would all call the same EJBs but as mentioned test may be diff to prod. Lets say I have an ejb-jar for each jar file (one jar for each implementation). The EJBs are in different directories - same as was but now under test.x.y.z.beanEJB or prod.x.y.z.beanEJB. The ejb-jar will give a jndi/ejb name of test/orderEJB or prod/orderEJB with a class reference containing the correct path for that environment. Now back to the client... the web-inf xml there will have an environment variable containing value dev, test, prod etc. The servlet will prepend this to the ejb call lookup eg prod/orderEJB. The only problem is the import for the interfaces, I currently have the path, but will have to remove that and just put the interface class name on the import statement and change the classpath when compiling. The database will be easy, environment variable in each jar anyway.
Does that make sense? Or should I look at multiple instances of Jboss, one for test, one for prod etc.
easy on the client, just different directories under tomcat or even diff web servers, but having one ejb server....