Tomcat server.xml / tomee tomee.xml per-app configuration

hello!

so i just got a new deployment project for a big tomee application, and in
tomee, things like the datasource must be configured in tomee.xml (which is
like the server.xml from tomcat)

so… if i want to have two apps each with a separate datasource, i have to
find some way to inject the datasource information into the tomee.xml for
both.

i want to have a generic tomee cookbook (which will be almost identical to
the tomcat cookbook), then i want to have separate application cookbooks.

when i add both to the same machine, i want both of their datasources to
show up in tomee.xml, and when just one is there, just one should show up…

so…

any ideas?

Maybe you could have a databag with an item for each application, and the
configuration of each app inside its item.

If I remember well the tomcat cookbook uses a databag to configure the
users. You could take it as an example and see if it could work in your
case.
El 14/02/2013 23:34, "Jesse Campbell" hikeit@gmail.com escribió:

hello!

so i just got a new deployment project for a big tomee application, and in
tomee, things like the datasource must be configured in tomee.xml (which is
like the server.xml from tomcat)

so... if i want to have two apps each with a separate datasource, i have
to find some way to inject the datasource information into the tomee.xml
for both.

i want to have a generic tomee cookbook (which will be almost identical to
the tomcat cookbook), then i want to have separate application cookbooks.

when i add both to the same machine, i want both of their datasources to
show up in tomee.xml, and when just one is there, just one should show up...

so...

any ideas?

having a data bag sort of goes against the way the current application
cookbook is designed to work... seems like a step backwards, unfortunately.

On Fri, Feb 15, 2013 at 3:40 AM, Ignasi ignasi.barrera@gmail.com wrote:

Maybe you could have a databag with an item for each application, and the
configuration of each app inside its item.

If I remember well the tomcat cookbook uses a databag to configure the
users. You could take it as an example and see if it could work in your
case.
El 14/02/2013 23:34, "Jesse Campbell" hikeit@gmail.com escribió:

hello!

so i just got a new deployment project for a big tomee application, and
in tomee, things like the datasource must be configured in tomee.xml (which
is like the server.xml from tomcat)

so... if i want to have two apps each with a separate datasource, i have
to find some way to inject the datasource information into the tomee.xml
for both.

i want to have a generic tomee cookbook (which will be almost identical
to the tomcat cookbook), then i want to have separate application cookbooks.

when i add both to the same machine, i want both of their datasources to
show up in tomee.xml, and when just one is there, just one should show up...

so...

any ideas?

Not at all.

I do recommend using a data bag to store application specific data like its repository, revision, and other details. Load the item up in the recipe that uses the application LWRP, and use its values to populate the resource.

--
Joshua Timberman

On Friday, February 15, 2013 at 9:55, Jesse Campbell wrote:

having a data bag sort of goes against the way the current application cookbook is designed to work... seems like a step backwards, unfortunately.

On Fri, Feb 15, 2013 at 3:40 AM, Ignasi <ignasi.barrera@gmail.com (mailto:ignasi.barrera@gmail.com)> wrote:

Maybe you could have a databag with an item for each application, and the configuration of each app inside its item.
If I remember well the tomcat cookbook uses a databag to configure the users. You could take it as an example and see if it could work in your case.
El 14/02/2013 23:34, "Jesse Campbell" <hikeit@gmail.com (mailto:hikeit@gmail.com)> escribió:

hello!

so i just got a new deployment project for a big tomee application, and in tomee, things like the datasource must be configured in tomee.xml (which is like the server.xml from tomcat)

so... if i want to have two apps each with a separate datasource, i have to find some way to inject the datasource information into the tomee.xml for both.

i want to have a generic tomee cookbook (which will be almost identical to the tomcat cookbook), then i want to have separate application cookbooks.

when i add both to the same machine, i want both of their datasources to show up in tomee.xml, and when just one is there, just one should show up...

so...

any ideas?

Oh.
Good point!

Okay that's what I'll do then :slight_smile:
On Feb 16, 2013 9:32 AM, "Joshua Timberman" joshua@opscode.com wrote:

Not at all.

I do recommend using a data bag to store application specific data like
its repository, revision, and other details. Load the item up in the recipe
that uses the application LWRP, and use its values to populate the
resource.

--
Joshua Timberman

On Friday, February 15, 2013 at 9:55, Jesse Campbell wrote:

having a data bag sort of goes against the way the current application
cookbook is designed to work... seems like a step backwards, unfortunately.

On Fri, Feb 15, 2013 at 3:40 AM, Ignasi ignasi.barrera@gmail.com wrote:

Maybe you could have a databag with an item for each application, and the
configuration of each app inside its item.

If I remember well the tomcat cookbook uses a databag to configure the
users. You could take it as an example and see if it could work in your
case.
El 14/02/2013 23:34, "Jesse Campbell" hikeit@gmail.com escribió:

hello!

so i just got a new deployment project for a big tomee application, and in
tomee, things like the datasource must be configured in tomee.xml (which is
like the server.xml from tomcat)

so... if i want to have two apps each with a separate datasource, i have
to find some way to inject the datasource information into the tomee.xml
for both.

i want to have a generic tomee cookbook (which will be almost identical to
the tomcat cookbook), then i want to have separate application cookbooks.

when i add both to the same machine, i want both of their datasources to
show up in tomee.xml, and when just one is there, just one should show up...

so...

any ideas?