...
The value of this property is a regular expression and therefore can be absolute or relative. For example the path "/Users/dblevins/work/swizzle/swizzle-stream/target/classes" which contains the class files of an application you wish to test could be included in any of the following values to the "openejb.deployments.classpath.include" property:
- "file:///Users/dblevins/work/swizzle/swizzle-stream/target/classes/" (an absolute path)
- "file:///Users/dblevins/work/swizzle/.*" (relative)
- ".*swizzle-stream.*" (very relative)
- ".*(swizzle-stream|swizzle-jira|acme-rocket-app).*" (including several paths)
Note the filtering is done on URLs in the classpath, so forward slashes should always be used even on OSs using backslash ("\").
...
Note by default these settings will only affect which jars OpenEJB will scan for annotated components when no descriptor is found. If you would like to use these settings to also filter out jars that do contain descriptors, set the openejb.deployments.classpath.filter.descriptors property to true. The default is false.
Troubleshooting
If you're having trouble determining if the META-INF/ejb-jar.xml file for your ejb module is in the classpath, a little debug code like this in your test setup will help you see what OpenEJB sees (which may be nothing):
Code Block |
---|
Enumeration<URL> ejbJars = this.getClass().getClassLoader().getResources("META-INF/ejb-jar.xml");
while (ejbJars.hasMoreElements()) {
URL url = ejbJars.nextElement();
System.out.println("app = " + url);
}
|