Overview
As noted in the Injection of env-entry Example, the EJB 3.0 supported env-entry types are fairly limited. Also the use of several <env-entry> tags in an ejb-jar.xml can get a bit verbose.
OpenEJB does not restrict you to just these data types or require you to use an ejb-jar.xml to declare them.
- @Resource can be used on any you for which there is java.beans.PropertyEditor
- You may install your own PropertyEditors and package them with your app.
- Java Generics are supported (e.g. List<URI> myURIs)
- You may use a META-INF/env-entries.properties file as an alternative to an ejb-jar.xml
See Built-in Type Converters for a full list of supported env-entry types.
The source for this example is the "custom-injection" directory located in the openejb-examples.zip available on the download page.
The Code
Bean Class
Error formatting macro: snippet: java.lang.NullPointerException
The META-INF/env-entries.properties file
Error formatting macro: snippet: java.lang.NullPointerException