Application discovery via the classpathPage edited by David BlevinsChanges (1)
Full ContentThis document details the various ways to get OpenEJB to pickup applications you'd like deployed while in an embedded mode. Empty ejb-jar.xml approach (recommended)Simplify the issue of searching for annotated applications by adding an ejb-jar.xml like this to your app: "META-INF/ejb-jar.xml
<ejb-jar/>
Note the filtering is done on URLs in the classpath, so forward slashes should always be used even on OSs using backslash ("\"). There is an openejb.deployments.classpath.exclude property if you wish to work in the opposite direction. The default values for both properties are as follows: openejb.deployments.classpath.include="" //include nothing The exclude and the include is applied separately and the results of each are combined together to create the list of paths OpenEJB will scrape for annotations. 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. TroubleshootingIf 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): Enumeration<URL> ejbJars = this.getClass().getClassLoader().getResources("META-INF/ejb-jar.xml"); while (ejbJars.hasMoreElements()) { URL url = "" System.out.println("app = " + url); }
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
