I have a JBoss application that I build into a Jar file and place in the server/default/deploy directory of my JBoss installation. The applications deploys perfectly. What I want to do is have two versions of my application deployed on the same JBoss server. The code will be intentical except that one will connect to a test database and the other will connect to a production/live database.
How can I achieve this? (I.E. how do a deploy a second instance of the same application and how can I get my client to call objects from a specific instance )?
Current my client just creates the context to the server and calls the EJBs by name: PortableRemoteObject.narrow( homeRef, homeClass ); But I'd like some sort of way of telling it to get the test version or the production version.
Is there a relatively easy way to do this ( short of passing in a parameter to each EJB call telling it which database to connect to ).