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:
java.lang.Boolean
java.lang.Byte
java.lang.Character
java.lang.Double
java.lang.Float
java.lang.Integer
java.lang.Long
java.lang.Short
java.lang.String
OpenEJB 3.0 additional types:
java.lang.Class
java.lang.Enum (any subclass of)
java.io.File
java.math.BigDecimal
java.math.BigInteger
java.net.Inet4Address
java.net.Inet6Address
java.net.InetAddress
java.net.URI
java.net.URL
java.util.ArrayList
java.util.Date
java.util.HashMap
java.util.Hashtable
java.util.IdentityHashMap
java.util.LinkedHashMap
java.util.LinkedHashSet
java.util.LinkedList
java.util.List
java.util.Map
java.util.Properties
java.util.Set
java.util.SortedMap
java.util.TreeMap
java.util.TreeSet
java.util.Vector
java.util.WeakHashMap
java.util.logging.Logger
java.util.regex.Pattern
javax.management.ObjectName
javax.naming.Context
org.apache.commons.logging.Log
org.apache.log4j.Logger
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;
}
Any help with the documentation is greatly appreciated.
All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)
NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.