The following built-in types are supported for @Resource injection in EJBs via elements in a META-INF/ejb-jar.xml or via plain properties in a META-INF/env-entries.properties file.

EJB 3.0 required types:

OpenEJB 3.0 additional types:

To use an OpenEJB additional type in xml, simply declare it as java.lang.String and it will be converted on the fly to the field/setter type used by the bean class. For example:

package org.superbiz.foo;

import java.util.Date;

@Stateless
public class MyBean {

    @Resource
    private Date myDate;
}

Works with an ejb-jar.xml as follows:

<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
metadata-complete="false">
  <enterprise-beans>
    <session>
      <ejb-name>MyBean</ejb-name>
      <env-entry>
  <env-entry-name>org.superbiz.foo.MyBean/myDate</env-entry-name>
  <env-entry-value>2008-04-19</env-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
      </env-entry>
    </session>
  </enterprise-beans>
</ejb-jar>

Or with an env-entries.properties file as follows:

org.superbiz.foo.MyBean/myDate = 2008-04-19