Inspired by some user blog posts, we've added a new feature so support for altDD (alternative deployment descriptors) can be done in a test or other environment without much work.

Basically, just set the new "openejb.altdd.prefix" system property or initialcontext property to something like "test", then any descriptors in your META-INF/ directory that start with "test." will override the regular descriptor. So for example with an app like this:

  • META-INF/ejb-jar.xml
  • META-INF/test.ejb-jar.xml
  • META-INF/persistence.xml

    Just initialize your test case like so:

     Properties properties = new Properties();
     properties.setProperty("openejb.altdd.prefix", "test");
     InitialContext initialContext = new InitialContext(properties);

    The logical result will be:

  • META-INF/ejb-jar.xml (via test.ejb-jar.xml)
  • META-INF/persistence.xml
  • META-INF/ (via

    This will work in any environment in which OpenEJB works (embedded, standalone, tomcat, geronimo, etc.).