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
>