it is possible but need to take care of some few things FYI trunk should support a bit more separation of resources.xml
*Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/2/18 Witold Szczerba <[email protected]> > Hi, > I am sorry, did not have time to create a demo webapps showing that the > WEB-INF/resources.xml are global, but I saw your recent answer in another > thread confirming this issue. > For now I have setup separate TomEE instance for development continuous > builds. > > As far as I remember, I had the same issue years ago with Glassfish. It > seems the JEE servers just do not like being shared by many instances of > the same application, do they? > > Regards, > Witold Szczerba > --- > Sent from my mobile phone. > On Feb 16, 2013 10:08 AM, "Romain Manni-Bucau" <[email protected]> > wrote: > > > Please reproduce in a project this behavior and we can have a look (i > have > > some ideas) > > Le 16 févr. 2013 04:27, "Witold Szczerba" <[email protected]> a > écrit > > : > > > > > Hi, > > > I am having hard time deploying the same application twice into same > > > instance under different context paths. > > > > > > First thing I did was to uncomment the following lines in > > > system.properties: > > > > > > #openejb.deploymentId.format = {appId}/{ejbJarId}/{ejbName} > > > #openejb.jndiname.format = {deploymentId}{interfaceType.annotationName} > > > > > > ,so that the same EJBs from both instances no longer tries to step on > > each > > > other. > > > > > > The problem is with JDBC connection pools though. The documentation: > > > http://tomee.apache.org/configuring-datasources.html > > > says to register resource id="resource1" in tomee.xml and then we can > > > write: > > > > > > @Statelesspublic class FooBean { > > > @Resource(name="resource1") > > > DataSource dataSource;} > > > > > > Since there is no application specific mappings between resource ID and > > > JNDI names available for EJBs inside that application, I would have to > > > filter all the .java files in each application replacing the resource > > name > > > with proper ID - which is, of course, not an option. > > > > > > I tried something else: instead of declaring the resources in > tomee.xml, > > I > > > have moved it to WEB-INF/resources.xml. The result is super strange: > now > > > both applications share the same database and it is the database > declared > > > in the web app which was deployed the last. > > > > > > Am I missing something? Am I trying to do stuff which are not supposed > to > > > work, i.e. should I install separate TomEE instance for every instance > of > > > my application? > > > > > > Thanks, > > > Witold Szczerba > > > > > >
