You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Reinis Vicups <to...@orbit-x.de> on 2013/04/22 13:03:49 UTC

Consistent config question

Hello,

I find myself struggling with creating a consistent configuration for my 
application.

What I mean, for me building JavaEE Applications mean JavaEE, TomEE, 
OpenEjb, OpenJpa, OpenWebbeans, some Jsf impl., 
openejb.ApplicationComposer/Arquillian/JUnit, maven.

AND, I need to be able to execute my app in two modes - 1. productive, 
2. test.

What I currently am struggling with, is to build a consistent and clear 
configuration for my application. I see that my config is distributed among

- maven plugins;
- JavaEE config files in META-INF in both src/main and src/test
- tomee.xml;
- openejb.xml;
- unittestcode (for ApplicationComposer/Arquillian)
- jvm -D properties

Why is it this way? Well, because I am unable to make it work in one place!

Just yesterday I had the case where I needed some openejb.* property to 
be set. jvm -D didn't worked for me, then I tried to figure out how to 
put it into openejb.xml (since in docu was written that I should place 
it there), then I recalled that tomee.xml has also some openejb.* 
properties, but then I recalled that I don't have tomee but rather 
embeded(?) openejb container launched by ApplicationComposer, so I ended 
adding openejb.* property to @Config method of my unittest ran with 
ApplicationComposer.

Another case was with JPA entities. I don't know what of my config is 
superfluous, but currently I have my entities added to
- @Module public PersistenceUnit persistenceConfig()
- persistence.xml
- openjpa-maven-plugin
This is just too much config for my taste :)

Does any of you guys have a clear picture in your mind on how config for 
the two modes (productive and test) shall be done and what things go 
where? Would you care to share this picture with me?

kind regards
Reinis

Re: Consistent config question

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

maybe start by listing the props you use

personally i like to use conf/system.properties for all global
configuration (datasources can go here too), application.properties for
specific configuration of apps (asynchronous pool can go here), then
standard descriptors (persistence.xml...) are in WEB-INF because the spec
defined it (but a lot can be configured from outside the app using
conf/system.properties). Finally for my tests i just override
conf/system.properties

*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/4/22 Reinis Vicups <to...@orbit-x.de>

> Hello,
>
> I find myself struggling with creating a consistent configuration for my
> application.
>
> What I mean, for me building JavaEE Applications mean JavaEE, TomEE,
> OpenEjb, OpenJpa, OpenWebbeans, some Jsf impl., openejb.ApplicationComposer/
> **Arquillian/JUnit, maven.
>
> AND, I need to be able to execute my app in two modes - 1. productive, 2.
> test.
>
> What I currently am struggling with, is to build a consistent and clear
> configuration for my application. I see that my config is distributed among
>
> - maven plugins;
> - JavaEE config files in META-INF in both src/main and src/test
> - tomee.xml;
> - openejb.xml;
> - unittestcode (for ApplicationComposer/**Arquillian)
> - jvm -D properties
>
> Why is it this way? Well, because I am unable to make it work in one place!
>
> Just yesterday I had the case where I needed some openejb.* property to be
> set. jvm -D didn't worked for me, then I tried to figure out how to put it
> into openejb.xml (since in docu was written that I should place it there),
> then I recalled that tomee.xml has also some openejb.* properties, but then
> I recalled that I don't have tomee but rather embeded(?) openejb container
> launched by ApplicationComposer, so I ended adding openejb.* property to
> @Config method of my unittest ran with ApplicationComposer.
>
> Another case was with JPA entities. I don't know what of my config is
> superfluous, but currently I have my entities added to
> - @Module public PersistenceUnit persistenceConfig()
> - persistence.xml
> - openjpa-maven-plugin
> This is just too much config for my taste :)
>
> Does any of you guys have a clear picture in your mind on how config for
> the two modes (productive and test) shall be done and what things go where?
> Would you care to share this picture with me?
>
> kind regards
> Reinis
>