TomEE resource properties provider: one more step

I spoke recently ( http://rmannibucau.wordpress.com/2014/08/06/tomee-and-more-advanced-resource-configuration/ ) of the ability to read using a custom API properties for TomEE resources but for enterprise context where you want to control all resources it was surely not enough for big applications.

To make it smoother to use you can now:

Continue reading


TomEE and log4j2

Since few weeks TomEE has some support for log4j2 without using log4j2-log4j compatibility module.

To set it up just add the log4j2 jars you want to tomee (lib/) and add your config – log4j2.xml – in the classloader (lib/ works too).

Side note: you can do it using a conf/jars.txt file and using log4j2 maven coordinates, really more easy ;).

Then in conf/system.properties (or in CATALINA_OPTS) set the system property openejb.log.factory to log4j2:


Then you’ll get the container logs redirected to log4j2.


CDI and ApplicationComposer: finally easy to test deltaspike with AppComposer

OpenEJB/TomEE ApplicationComposer design is to describe a test application with an in memory model close to the xml EE one (Beans for beans.xml, EjbJar for ejb-jar.xml…).

But when it comes to CDI and since it was mainly designed for small apps it is hard to say “I have a CDI dependency/library”.

The more obvious use case is DeltaSpike!

To make it easier we added @Jars recently.

Continue reading


TomEE and more advanced resource configuration

TomEE 2 got two new interesting features (in particular in enterprises) to configure resources: default placeholder values and properties-provider.

Continue reading


TomEE, CDI and JAX-RS @Providers

TomEE trunk is now using CXF 3 as JAX-RS provider.

Providers were generally configured using openejb-jar.xml or just auto discovery (when using good defaults) but now in TomEE 2.x CDI and JAX-RS providers are linked.

It means you can @Inject inside your provider if the provider type is a CDI bean with @Default qualifier.


MDB and mails: yes it works!

Message Driven Beans (MDBs) are often linked to JMS but actually there is no link at all!

Using ironjacamar you can listen on your mail box :).

Continue reading


Get git information in your CDI application easily thanks to DeltaSpike and git-commit-id-plugin

Having SCM information in the project is really interesting to dump them at startup for instance.

There are several ways to do it.

One easy is to use templating-maven-plugin and filter a .java with these information but it has several drawbacks:

Continue reading


Apache TomEE Maven Plugin and web developement, easier reload

When developping a web application one boring task can be to redeploy an application for a css update.

There were some solution in tomee maven plugin (mainly synchronization based on timers) but this is not as smooth as it should be.

That’s why the plugin was enhanced for the coming 1.7.0.

Continue reading


Json API (JavaEE 7) + Java 8: collection to JsonArray

JavaEE 7 brings an API for JSON arrays (the surprising JsonArray ;)), Java 8 brings a stream API and lambdas so now you can combine both to create a JsonArray from a Collection!

Continue reading


TomEE CXF configuration tip: link Services and Resources

TomEE CXF configuration is mainly done in openejb-jar.xml to either use qualified name or service id to reference to more complicated objects.

For instance you can reference jsonProvider in openejb-jar.xml and define it in resources.xml like it:

<Service id="jsonProvider" class-name="org.superbiz.MyJsonProvider">
  rootName = foo

It is also possible to link two services together using $:

Continue reading