Examples of NestedJarFile


Examples of org.apache.geronimo.deployment.util.NestedJarFile

                            throw new DeploymentException("Could not find a module builder for module: " + moduleXml);
                        }

                        moduleLocations.add(modulePath);

                        NestedJarFile moduleFile;
                        try {
                            moduleFile = new NestedJarFile(earFile, modulePath);
                        } catch (IOException e) {
                            throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                        }

                        Module module = builder.createModule(altVendorDDs.get(modulePath),
                                moduleFile,
                                modulePath,
                                getAltSpecDDURL(earFile, moduleXml),
                                environment,
                                moduleContextInfo,
                                earName,
                                naming, idBuilder);

                        if (module == null) {
                            throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
                        }

                        modules.add(module);
                    }
                } else {
                    //no application.xml available, must inspect ear to locate and process modules
                    Enumeration<JarEntry> entries = earFile.entries();
                    while (entries.hasMoreElements()) {
                        ModuleBuilder builder;
                        Object moduleContextInfo = null;
                        String moduleTypeName;
                        ZipEntry entry = entries.nextElement();
                        if (entry.getName().endsWith(".war")) {
                            if (getWebConfigBuilder() == null) {
                                throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + entry.getName());
                            }
                            builder = getWebConfigBuilder();
                            moduleTypeName = "a war";
                            moduleContextInfo = entry.getName().split(".war")[0];
                        } else if (entry.getName().endsWith(".rar")) {
                            if (getConnectorConfigBuilder() == null) {
                                throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + entry.getName());
                            }
                            builder = getConnectorConfigBuilder();
                            moduleTypeName = "a connector";
                        } else if (entry.getName().endsWith(".jar") && !isLibraryEntry(application, entry)) {
                            try {
                                NestedJarFile moduleFile = new NestedJarFile(earFile, entry.getName());
                                Manifest mf = moduleFile.getManifest();

                                if (mf.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS) != null) {
                                    if (getAppClientConfigBuilder() == null) {
                                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + entry.getName());
                                    }
                                    builder = getAppClientConfigBuilder();
                                    moduleTypeName = "an application client";
                                } else {
                                    //ask the ejb builder if its an ejb module
                                    builder = getEjbConfigBuilder();
                                    if (builder == null) {
//                                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + entry.getName());
                                        continue;
                                    }

                                    Module module = builder.createModule(altVendorDDs.get(entry.getName()),
                                            moduleFile,
                                            entry.getName(),
                                            null,
                                            environment,
                                            moduleContextInfo,
                                            earName,
                                            naming, idBuilder);

                                    if (module != null) {
                                        moduleLocations.add(entry.getName());
                                        modules.add(module);
                                    }
                                    continue;
                                }
                                //TODO if no ejb-jar.xml inspect classes for EJB component annotations to identify as EJBJar module
                            } catch (IOException e) {
                                throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                            }
                        } else {
                            continue;
                        }

                        moduleLocations.add(entry.getName());

                        NestedJarFile moduleFile;
                        try {
                            moduleFile = new NestedJarFile(earFile, entry.getName());
                        } catch (IOException e) {
                            throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                        }

                        Module module = builder.createModule(altVendorDDs.get(entry.getName()),
                                moduleFile,
                                entry.getName(),
                                null,
                                environment,
                                moduleContextInfo,
                                earName,
                                naming, idBuilder);

                        if (module == null) {
                            throw new DeploymentException("Module was not " + moduleTypeName + ": " + entry.getName());
                        }

                        modules.add(module);
                    }
                }
            }

            //all the modules in the geronimo plan should have been found by now.
            if (!moduleLocations.containsAll(altVendorDDs.keySet())) {
                HashSet<String> missingModules = new HashSet<String>(altVendorDDs.keySet());
                missingModules.removeAll(moduleLocations);
                throw new DeploymentException("Geronimo ear plan contains modules that are not in the ear: " + missingModules);
            }
            //deploy the extension modules
            for (GerExtModuleType gerExtModule : gerApplication.getExtModuleArray()) {
                String moduleName;
                ModuleBuilder builder;
                Object moduleContextInfo = null;
                String moduleTypeName;

                if (gerExtModule.isSetEjb()) {
                    moduleName = gerExtModule.getEjb().getStringValue();
                    builder = getEjbConfigBuilder();
                    if (builder == null) {
                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + moduleName);
                    }
                    moduleTypeName = "an EJB";
                } else if (gerExtModule.isSetWeb()) {
                    moduleName = gerExtModule.getWeb().getStringValue();
                    if (getWebConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + moduleName);
                    }
                    builder = getWebConfigBuilder();
                    moduleTypeName = "a war";
                    //ext modules must use vendor plan to set context-root
                } else if (gerExtModule.isSetConnector()) {
                    moduleName = gerExtModule.getConnector().getStringValue();
                    if (getConnectorConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + moduleName);
                    }
                    builder = getConnectorConfigBuilder();
                    moduleTypeName = "a connector";
                } else if (gerExtModule.isSetJava()) {
                    moduleName = gerExtModule.getJava().getStringValue();
                    if (getAppClientConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + moduleName);
                    }
                    builder = getAppClientConfigBuilder();
                    moduleTypeName = "an application client";
                } else {
                    throw new DeploymentException("Could not find a module builder for module: " + gerExtModule);
                }
                //dd is included explicitly
                XmlObject[] anys = gerExtModule.selectChildren(GerExtModuleType.type.qnameSetForWildcardElements());
                if (anys.length != 1) {
                    throw new DeploymentException("Unexpected count of xs:any elements in embedded vendor plan " + anys.length + " qnameset: " + GerExtModuleType.type.qnameSetForWildcardElements());
                }
                Object vendorDD = anys[0];

                JarFile moduleFile;
                if (gerExtModule.isSetInternalPath()) {
                    String modulePath = gerExtModule.getInternalPath().trim();
                    moduleLocations.add(modulePath);
                    try {
                        moduleFile = new NestedJarFile(earFile, modulePath);
                    } catch (IOException e) {
                        throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                    }
                } else {
                    PatternType patternType = gerExtModule.getExternalPath();
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                    throw new DeploymentException("Could not access rar contents", e);
                }
            } else {
                path = resource.getInternalRar();
                try {
                    connectorFile = new NestedJarFile(moduleFile, path);
                } catch (IOException e) {
                    throw new DeploymentException("Could not locate connector inside ear", e);
                }
            }
            XmlObject connectorPlan = resource.getConnector();
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

            }
            EARConfigBuilder.LibClasspath libClasspath = (EARConfigBuilder.LibClasspath) earContext.getGeneralData().get(EARConfigBuilder.LibClasspath.class);
            if (libClasspath != null) {
                for (String libEntryPath: libClasspath) {
                    try {
                        NestedJarFile library = new NestedJarFile(earFile, libEntryPath);
                        appClientDeploymentContext.addIncludeAsPackedJar(URI.create(libEntryPath), library);
                    } catch (IOException e) {
                        throw new DeploymentException("Could not add to app client library classpath: " + libEntryPath, e);
                    }
                }
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                }
                path = artifact.toString();
            } else {
                path = resource.getInternalRar();
                try {
                    connectorFile = new NestedJarFile(moduleFile, path);
                } catch (IOException e) {
                    throw new DeploymentException("Could not locate connector inside ear", e);
                }
            }
            XmlObject connectorPlan = resource.getConnector();
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

            }
            ClassPathList libClasspath = (ClassPathList) earContext.getGeneralData().get(ClassPathList.class);
            if (libClasspath != null) {
                for (String libEntryPath : libClasspath) {
                    try {
                        NestedJarFile library = new NestedJarFile(earFile, libEntryPath);
                        appClientDeploymentContext.addIncludeAsPackedJar(URI.create(libEntryPath), library);
                    } catch (IOException e) {
                        throw new DeploymentException("Could not add to app client library classpath: " + libEntryPath, e);
                    }
                }
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                            addEntry = false;
                            break;
                        }
                    }
                    if (libDir != null && entry.getName().startsWith(libDir) && entry.getName().endsWith(".jar")) {
                        NestedJarFile library = new NestedJarFile(earFile, entry.getName());
                        earContext.addIncludeAsPackedJar(URI.create(entry.getName()), library);
                        libClasspath.add(entry.getName());
                    } else if (addEntry) {
                        earContext.addFile(URI.create(entry.getName()), earFile, entry);
                    }
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                            throw new DeploymentException("Could not find a module builder for module: " + moduleXml);
                        }

                        moduleLocations.add(modulePath);

                        NestedJarFile moduleFile;
                        try {
                            moduleFile = new NestedJarFile(earFile, modulePath);
                        } catch (IOException e) {
                            throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                        }

                        Module module = builder.createModule(altVendorDDs.get(modulePath),
                                moduleFile,
                                modulePath,
                                getAltSpecDDURL(earFile, moduleXml),
                                environment,
                                moduleContextInfo,
                                earName,
                                naming, idBuilder);

                        if (module == null) {
                            throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
                        }

                        modules.add(module);
                    }
                } else {
                    //no application.xml available, must inspect ear to locate and process modules
                    Enumeration<JarEntry> entries = earFile.entries();
                    while (entries.hasMoreElements()) {
                        ModuleBuilder builder;
                        Object moduleContextInfo = null;
                        String moduleTypeName;
                        ZipEntry entry = entries.nextElement();
                        if (entry.getName().endsWith(".war")) {
                            if (getWebConfigBuilder() == null) {
                                throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + entry.getName());
                            }
                            builder = getWebConfigBuilder();
                            moduleTypeName = "a war";
                            moduleContextInfo = entry.getName().split(".war")[0];
                        } else if (entry.getName().endsWith(".rar")) {
                            if (getConnectorConfigBuilder() == null) {
                                throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + entry.getName());
                            }
                            builder = getConnectorConfigBuilder();
                            moduleTypeName = "a connector";
                        } else if (entry.getName().endsWith(".jar") && !isLibraryEntry(application, entry)) {
                            try {
                                NestedJarFile moduleFile = new NestedJarFile(earFile, entry.getName());
                                Manifest mf = moduleFile.getManifest();

                                if (mf.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS) != null) {
                                    if (getAppClientConfigBuilder() == null) {
                                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + entry.getName());
                                    }
                                    builder = getAppClientConfigBuilder();
                                    moduleTypeName = "an application client";
                                } else {
                                    //ask the ejb builder if its an ejb module
                                    builder = getEjbConfigBuilder();
                                    if (builder == null) {
//                                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + entry.getName());
                                        continue;
                                    }

                                    Module module = builder.createModule(altVendorDDs.get(entry.getName()),
                                            moduleFile,
                                            entry.getName(),
                                            null,
                                            environment,
                                            moduleContextInfo,
                                            earName,
                                            naming, idBuilder);

                                    if (module != null) {
                                        moduleLocations.add(entry.getName());
                                        modules.add(module);
                                    }
                                    continue;
                                }
                                //TODO if no ejb-jar.xml inspect classes for EJB component annotations to identify as EJBJar module
                            } catch (IOException e) {
                                throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                            }
                        } else {
                            continue;
                        }

                        moduleLocations.add(entry.getName());

                        NestedJarFile moduleFile;
                        try {
                            moduleFile = new NestedJarFile(earFile, entry.getName());
                        } catch (IOException e) {
                            throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                        }

                        Module module = builder.createModule(altVendorDDs.get(entry.getName()),
                                moduleFile,
                                entry.getName(),
                                null,
                                environment,
                                moduleContextInfo,
                                earName,
                                naming, idBuilder);

                        if (module == null) {
                            throw new DeploymentException("Module was not " + moduleTypeName + ": " + entry.getName());
                        }

                        modules.add(module);
                    }
                }
            }

            //all the modules in the geronimo plan should have been found by now.
            if (!moduleLocations.containsAll(altVendorDDs.keySet())) {
                HashSet<String> missingModules = new HashSet<String>(altVendorDDs.keySet());
                missingModules.removeAll(moduleLocations);
                throw new DeploymentException("Geronimo ear plan contains modules that are not in the ear: " + missingModules);
            }
            //deploy the extension modules
            for (GerExtModuleType gerExtModule : gerApplication.getExtModuleArray()) {
                String moduleName;
                ModuleBuilder builder;
                Object moduleContextInfo = null;
                String moduleTypeName;

                if (gerExtModule.isSetEjb()) {
                    moduleName = gerExtModule.getEjb().getStringValue();
                    builder = getEjbConfigBuilder();
                    if (builder == null) {
                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + moduleName);
                    }
                    moduleTypeName = "an EJB";
                } else if (gerExtModule.isSetWeb()) {
                    moduleName = gerExtModule.getWeb().getStringValue();
                    if (getWebConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + moduleName);
                    }
                    builder = getWebConfigBuilder();
                    moduleTypeName = "a war";
                    //ext modules must use vendor plan to set context-root
                } else if (gerExtModule.isSetConnector()) {
                    moduleName = gerExtModule.getConnector().getStringValue();
                    if (getConnectorConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + moduleName);
                    }
                    builder = getConnectorConfigBuilder();
                    moduleTypeName = "a connector";
                } else if (gerExtModule.isSetJava()) {
                    moduleName = gerExtModule.getJava().getStringValue();
                    if (getAppClientConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + moduleName);
                    }
                    builder = getAppClientConfigBuilder();
                    moduleTypeName = "an application client";
                } else {
                    throw new DeploymentException("Could not find a module builder for module: " + gerExtModule);
                }
                //dd is included explicitly
                XmlObject[] anys = gerExtModule.selectChildren(GerExtModuleType.type.qnameSetForWildcardElements());
                if (anys.length != 1) {
                    throw new DeploymentException("Unexpected count of xs:any elements in embedded vendor plan " + anys.length + " qnameset: " + GerExtModuleType.type.qnameSetForWildcardElements());
                }
                Object vendorDD = anys[0];

                JarFile moduleFile;
                if (gerExtModule.isSetInternalPath()) {
                    String modulePath = gerExtModule.getInternalPath().trim();
                    moduleLocations.add(modulePath);
                    try {
                        moduleFile = new NestedJarFile(earFile, modulePath);
                    } catch (IOException e) {
                        throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                    }
                } else {
                    PatternType patternType = gerExtModule.getExternalPath();
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                        } catch (MalformedURLException e) {
                            throw new DeploymentException("Invalid alt sped dd url: " + moduleXml.getAltDd().getStringValue(), e);
                        }
                    }

                    NestedJarFile moduleFile = null;
                    try {
                        moduleFile = new NestedJarFile(earFile, modulePath);
                    } catch (IOException e) {
                        throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                    }

                    Module module = builder.createModule(altVendorDDs.get(modulePath),
                            moduleFile,
                            modulePath,
                            altSpecDD,
                            URI.create(gerApplication.getConfigId()),
                            moduleContextInfo);

                    if (module == null) {
                        throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
                    }

                    modules.add(module);
                }
            }

            //deploy the extension modules
            GerExtModuleType gerExtModuleTypes[] = gerApplication.getExtModuleArray();
            for (int i = 0; i < gerExtModuleTypes.length; i++) {
                GerExtModuleType gerExtModule = gerExtModuleTypes[i];
                String moduleName = null;
                ModuleBuilder builder;
                Object moduleContextInfo = null;
                String moduleTypeName;

                if (gerExtModule.isSetEjb()) {
                    moduleName = gerExtModule.getEjb().getStringValue();
                    if (ejbConfigBuilder == null) {
                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + moduleName);
                    }
                    builder = ejbConfigBuilder;
                    moduleTypeName = "an EJB";
                } else if (gerExtModule.isSetWeb()) {
                    moduleName = gerExtModule.getWeb().getStringValue();
                    if (webConfigBuilder == null) {
                        throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + moduleName);
                    }
                    builder = webConfigBuilder;
                    moduleTypeName = "a war";
                    //ext modules must use vendor plan to set context-root
//                    moduleContextInfo = gerExtModule.getWeb().getContextRoot().getStringValue().trim();
                } else if (gerExtModule.isSetConnector()) {
                    moduleName = gerExtModule.getConnector().getStringValue();
                    if (connectorConfigBuilder == null) {
                        throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + moduleName);
                    }
                    builder = connectorConfigBuilder;
                    moduleTypeName = "a connector";
                } else if (gerExtModule.isSetJava()) {
                    moduleName = gerExtModule.getJava().getStringValue();
                    if (appClientConfigBuilder == null) {
                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + moduleName);
                    }
                    builder = appClientConfigBuilder;
                    moduleTypeName = "an application client";
                } else {
                    throw new DeploymentException("Could not find a module builder for module: " + gerExtModule);
                }
                //dd is included explicitly
                XmlObject[] anys = gerExtModule.selectChildren(GerExtModuleType.type.qnameSetForWildcardElements());
                if (anys.length != 1) {
                    throw new DeploymentException("Unexpected count of xs:any elements in embedded vendor plan " + anys.length + " qnameset: " + GerExtModuleType.type.qnameSetForWildcardElements());
                }
                Object vendorDD = anys[0];

                JarFile moduleFile = null;
                if (gerExtModule.isSetInternalPath()) {
                    String modulePath = gerExtModule.getInternalPath().trim();
                    moduleLocations.add(modulePath);
                    try {
                        moduleFile = new NestedJarFile(earFile, modulePath);
                    } catch (IOException e) {
                        throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                    }
                } else {
                    String path = gerExtModule.getExternalPath().trim();
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                            addEntry = false;
                            break;
                        }
                    }
                    if(libDir != null && entry.getName().startsWith(libDir) && entry.getName().endsWith(".jar")) {
                  NestedJarFile library = new NestedJarFile(earFile, entry.getName());
                        earContext.addIncludeAsPackedJar(URI.create(entry.getName()), library);
                    } else if(addEntry) {
                      earContext.addFile(URI.create(entry.getName()), earFile, entry);
                    }
                }
View Full Code Here

Examples of org.apache.geronimo.deployment.util.NestedJarFile

                            throw new DeploymentException("Could not find a module builder for module: " + moduleXml);
                        }

                        moduleLocations.add(modulePath);

                        NestedJarFile moduleFile;
                        try {
                            moduleFile = new NestedJarFile(earFile, modulePath);
                        } catch (IOException e) {
                            throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                        }

                        Module module = builder.createModule(altVendorDDs.get(modulePath),
                                moduleFile,
                                modulePath,
                                getAltSpecDDURL(earFile, moduleXml),
                                environment,
                                moduleContextInfo,
                                earName,
                                naming, idBuilder);

                        if (module == null) {
                            throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
                        }

                        modules.add(module);
                    }
                } else {
                //no application.xml available, must inspect ear to locate and process modules
                Enumeration<JarEntry> entries = earFile.entries();
                while (entries.hasMoreElements()) {
                  ModuleBuilder builder;
                  Object moduleContextInfo = null;
                  String moduleTypeName;
                  ZipEntry entry = entries.nextElement();
                  if(entry.getName().endsWith(".war")) {
                    if (getWebConfigBuilder() == null) {
                      throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + entry.getName());
                    }
                    builder = getWebConfigBuilder();
                    moduleTypeName = "a war";
                    moduleContextInfo = entry.getName().split(".war")[0];
                  } else if(entry.getName().endsWith(".rar")) {
                    if (getConnectorConfigBuilder() == null) {
                      throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + entry.getName());
                    }
                    builder = getConnectorConfigBuilder();
                    moduleTypeName = "a connector";
                  } else if(entry.getName().endsWith(".jar") && !entry.getName().startsWith("lib")) {
                    try {
                      NestedJarFile moduleFile = new NestedJarFile(earFile, entry.getName());
                      if(moduleFile.getEntry("META-INF/application-client.xml") != null) {
                        if (getAppClientConfigBuilder() == null) {
                          throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + entry.getName());
                        }
                        builder = getAppClientConfigBuilder();
                        moduleTypeName = "an application client";
                      } else if(moduleFile.getEntry("META-INF/ejb-jar.xml") != null) {
                        builder = getEjbConfigBuilder();
                        if (builder == null) {
                          throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + entry.getName());
                        }
                        moduleTypeName = "an EJB";
                      } else {
                        continue;
                      }
                      //TODO if no ejb-jar.xml inspect classes for EJB component annotations to identify as EJBJar module
                    } catch (IOException e) {
                      throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                    }
                  } else {
                    continue;
                  }

                  moduleLocations.add(entry.getName());

                  NestedJarFile moduleFile;
                  try {
                    moduleFile = new NestedJarFile(earFile, entry.getName());
                  } catch (IOException e) {
                    throw new DeploymentException("Invalid moduleFile: " + entry.getName(), e);
                  }

                  Module module = builder.createModule(altVendorDDs.get(entry.getName()),
                      moduleFile,
                      entry.getName(),
                      null,
                      environment,
                      moduleContextInfo,
                      earName,
                      naming, idBuilder);

                  if (module == null) {
                    throw new DeploymentException("Module was not " + moduleTypeName + ": " + entry.getName());
                  }

                  modules.add(module);
                }
              }
            }

            //all the modules in the geronimo plan should have been found by now.
            if (!moduleLocations.containsAll(altVendorDDs.keySet())) {
                throw new DeploymentException("Geronimo ear plan contains modules that aren't in the ear: " + new HashSet<String>(moduleLocations).removeAll(altVendorDDs.keySet()));
            }
            //deploy the extension modules
            for (GerExtModuleType gerExtModule : gerApplication.getExtModuleArray()) {
                String moduleName;
                ModuleBuilder builder;
                Object moduleContextInfo = null;
                String moduleTypeName;

                if (gerExtModule.isSetEjb()) {
                    moduleName = gerExtModule.getEjb().getStringValue();
                    builder = getEjbConfigBuilder();
                    if (builder == null) {
                        throw new DeploymentException("Cannot deploy ejb application; No ejb deployer defined: " + moduleName);
                    }
                    moduleTypeName = "an EJB";
                } else if (gerExtModule.isSetWeb()) {
                    moduleName = gerExtModule.getWeb().getStringValue();
                    if (getWebConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy web application; No war deployer defined: " + moduleName);
                    }
                    builder = getWebConfigBuilder();
                    moduleTypeName = "a war";
                    //ext modules must use vendor plan to set context-root
                } else if (gerExtModule.isSetConnector()) {
                    moduleName = gerExtModule.getConnector().getStringValue();
                    if (getConnectorConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy resource adapter; No rar deployer defined: " + moduleName);
                    }
                    builder = getConnectorConfigBuilder();
                    moduleTypeName = "a connector";
                } else if (gerExtModule.isSetJava()) {
                    moduleName = gerExtModule.getJava().getStringValue();
                    if (getAppClientConfigBuilder() == null) {
                        throw new DeploymentException("Cannot deploy app client; No app client deployer defined: " + moduleName);
                    }
                    builder = getAppClientConfigBuilder();
                    moduleTypeName = "an application client";
                } else {
                    throw new DeploymentException("Could not find a module builder for module: " + gerExtModule);
                }
                //dd is included explicitly
                XmlObject[] anys = gerExtModule.selectChildren(GerExtModuleType.type.qnameSetForWildcardElements());
                if (anys.length != 1) {
                    throw new DeploymentException("Unexpected count of xs:any elements in embedded vendor plan " + anys.length + " qnameset: " + GerExtModuleType.type.qnameSetForWildcardElements());
                }
                Object vendorDD = anys[0];

                JarFile moduleFile;
                if (gerExtModule.isSetInternalPath()) {
                    String modulePath = gerExtModule.getInternalPath().trim();
                    moduleLocations.add(modulePath);
                    try {
                        moduleFile = new NestedJarFile(earFile, modulePath);
                    } catch (IOException e) {
                        throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                    }
                } else {
                    String path = gerExtModule.getExternalPath().trim();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.