} catch (OpenEJBException e) {
Throwable t = e.getCause();
if (t instanceof UnknownModuleTypeException || t instanceof UnsupportedModuleTypeException) {
return null;
}
throw new DeploymentException(e);
}
// did we find a ejb jar?
if (appModule.getEjbModules().size() == 0) {
return null;
}
// get the module
org.apache.openejb.config.EjbModule ejbModule = appModule.getEjbModules().get(0);
// add the ejb-jar.xml altDD plan
if (specDDUrl != null) {
ejbModule.setEjbJar(null);
ejbModule.getAltDDs().put("ejb-jar.xml", specDDUrl);
}
// convert the vendor plan object to the ejbModule altDD map
XmlObject unknownXmlObject = null;
if (plan instanceof XmlObject) {
unknownXmlObject = (XmlObject) plan;
} else if (plan != null) {
try {
unknownXmlObject = XmlBeansUtil.parse(((File) plan).toURL(), XmlUtil.class.getClassLoader());
} catch (Exception e) {
throw new DeploymentException(e);
}
}
if (unknownXmlObject != null) {
XmlCursor xmlCursor = unknownXmlObject.newCursor();
//
QName qname = xmlCursor.getName();
if (qname == null) {
xmlCursor.toFirstChild();
qname = xmlCursor.getName();
}
if (qname.getLocalPart().equals("openejb-jar")) {
ejbModule.getAltDDs().put("openejb-jar.xml", xmlCursor.xmlText());
} else if (qname.getLocalPart().equals("ejb-jar") && qname.getNamespaceURI().equals("http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0")) {
ejbModule.getAltDDs().put("geronimo-openejb.xml", xmlCursor.xmlText());
}
}
// Read in the deploument desiptor files
ReadDescriptors readDescriptors = new ReadDescriptors();
try {
readDescriptors.deploy(appModule);
} catch (OpenEJBException e) {
throw new DeploymentException("Failed parsing descriptors for module: " + moduleFile.getName(), e);
}
// Get the geronimo-openejb.xml tree
boolean standAlone = earEnvironment == null;
GeronimoEjbJarType geronimoEjbJarType = (GeronimoEjbJarType) ejbModule.getAltDDs().get("geronimo-openejb.xml");