-
1. Re: Hosting multiple j2ee apps under the same running JBOSS
juhalindfors Jul 29, 2003 8:50 AM (in response to anenwu)You can deploy several datasources as long as you make sure they don't conflict in JNDI names or MBean object names. Then each hosted J2EE application needs to provide a mapping to their corresponding datasource.
For entities, this can be done in jbosscmp-jdbc.xml files. For direct resource lookups (from session beans), you need the correct mappings in ejb-jar.xml and jboss.xml to match the correct JNDI lookup names. There is probably some similar mappings required for servlets.
And of course, finally separate each DB instance by setting different authorization so applications cannot lookup and use each other's datasources.
HTH,
-- Juha -
2. Re: Hosting multiple j2ee apps under the same running JBOSS
manavagiwal Jul 29, 2003 10:22 AM (in response to anenwu)Hi Juha,
Was wondering how would you achieve this seperation.
And of course, finally separate each DB instance by setting different authorization so applications cannot lookup and use each other's datasources. -
3. Re: Hosting multiple j2ee apps under the same running JBOSS
juhalindfors Jul 29, 2003 10:26 AM (in response to anenwu)What I said is incorrect. They can still lookup the different datasources. But set up your databases with separate users/passwords so that they're protected from each other. You can do this at the DB level.
Hope it makes it clearer.
-- Juha -
4. Re: Hosting multiple j2ee apps under the same running JBOSS
anenwu Jul 30, 2003 12:42 AM (in response to anenwu)Thanks Juha,
Do u have any sample of preconfigured jbosscmp-jdbc.xml that I can refer to.
I tried to look into \jboss-3.0.4\docs\dtd\ to get the jbosscmp-jdbc.dtd, but could not find it as well.
And can I say, I will let the registered user responsibility to define their own jbosscmp-jdbc.xml ? meanwhile our responsility is to providing them their own database name, user name, and password ?
As I know, currently, to define db ds, I will only need to copy one of the predefined database-service.xml (for instance : oracle-service.xml, which only pointing to one database) into my jboss/server/host folder.
My question, is it possible for overwriting this ds by the registered user by including their own ds-service.xml (so can connect to their own db instance) into their own jar file (together with ejb-jar, jbosscmp-jdbc) ?
rgds,
Anen Wu -
5. Re: Hosting multiple j2ee apps under the same running JBOSS
juhalindfors Jul 30, 2003 3:14 AM (in response to anenwu)The DTD is in docs/dtd/jbosscmp-jdbc_3_0.dtd.
You can require the users supply their applications as SAR packages, they can add their own datasource configuration inside a SAR.
-- Juha -
6. Re: Hosting multiple j2ee apps under the same running JBOSS
anenwu Jul 31, 2003 12:10 AM (in response to anenwu)Ok Juha.
I havent ever tried SAR yet. But I got ur point already.
Thanks.
Anen Wu