Juan Hernandez has uploaded a new change for review.

Change subject: restapi: Deploy using modules
......................................................................

restapi: Deploy using modules

Currently the RESTAPI application is deployed as a nested .war file
inside the .ear of the engine, actually as two .war files, one for /api,
and another for /ovirt-engine/api. This double deployment causes class
cast exceptions because classes are loaded twice. To avoid this issues
this patch changes the RESTAPI application so that it is deployed
outside of the .ear and users JBoss modules for all its components, so
that no class will be loaded twice.

Change-Id: Ie4079277f60e5521d9b61379fa78713a5c4ccc10
Bug-Url: https://bugzilla.redhat.com/1113485
Signed-off-by: Juan Hernandez <[email protected]>
---
M Makefile
M backend/manager/modules/branding/pom.xml
A 
backend/manager/modules/branding/src/main/modules/org/ovirt/engine/core/branding/main/module.xml
M backend/manager/modules/restapi/interface/common/jaxrs/pom.xml
M 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/PackageExplorer.java
A 
backend/manager/modules/restapi/interface/common/jaxrs/src/main/modules/org/ovirt/engine/api/interface-common-jaxrs/main/module.xml
M backend/manager/modules/restapi/interface/definition/pom.xml
D 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/FileUtils.java
A 
backend/manager/modules/restapi/interface/definition/src/main/modules/org/ovirt/engine/api/restapi-definition/main/module.xml
M backend/manager/modules/restapi/jaxrs/pom.xml
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
A 
backend/manager/modules/restapi/jaxrs/src/main/modules/org/ovirt/engine/api/restapi-jaxrs/main/module.xml
M backend/manager/modules/restapi/types/pom.xml
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
A 
backend/manager/modules/restapi/types/src/main/modules/org/ovirt/engine/api/restapi-types/main/module.xml
M backend/manager/modules/restapi/webapp/pom.xml
D backend/manager/modules/restapi/webapp/src/main/resources/META-INF/MANIFEST.MF
A 
backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
A backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-web.xml
M backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
M ear/pom.xml
M ear/src/main/resources/META-INF/MANIFEST.MF
M ovirt-engine.spec.in
M packaging/services/ovirt-engine/ovirt-engine.conf.in
25 files changed, 513 insertions(+), 239 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/29474/1

diff --git a/Makefile b/Makefile
index c2e54b8..17213c6 100644
--- a/Makefile
+++ b/Makefile
@@ -355,6 +355,14 @@
        find "$(MAVEN_OUTPUT_DIR)" -name '*-modules.zip' | grep -v tmp.repos | 
xargs -n 1 unzip -q -o -d "$(DESTDIR)$(PKG_JBOSS_MODULES)"
        install -dm 0755 "$(DESTDIR)$(PKG_EAR_DIR)"
        find "$(MAVEN_OUTPUT_DIR)" -name '*.ear' -type f | grep -v tmp.repos | 
xargs -n 1 unzip -q -o -d "$(DESTDIR)$(PKG_EAR_DIR)"
+       install -dm 0755 "$(DESTDIR)$(DATA_DIR)/restapi.war"
+       find "$(MAVEN_OUTPUT_DIR)" -name 'restapi-*.war' -type f | grep -v 
tmp.repos | xargs -n 1 unzip -q -o -d "$(DESTDIR)$(DATA_DIR)/restapi.war"
+       cp -r \
+               "$(DESTDIR)$(DATA_DIR)/restapi.war" \
+               "$(DESTDIR)$(DATA_DIR)/legacy_restapi.war"
+       sed -i \
+               
's|<context-root>/ovirt-engine/api</context-root>|<context-root>/api</context-root>|'
 \
+               "$(DESTDIR)$(DATA_DIR)/legacy_restapi.war/WEB-INF/jboss-web.xml"
        install -dm 0755 "$(DESTDIR)$(PKG_HTML_DIR)"
        find "$(MAVEN_OUTPUT_DIR)" -name '*-javadoc.jar' -type f | grep -v 
tmp.repos | while read f; do \
                comp="$$(basename "$${f}" | sed 's/-[0-9].*//')"; \
diff --git a/backend/manager/modules/branding/pom.xml 
b/backend/manager/modules/branding/pom.xml
index cbd91f4..5ffb9a1 100644
--- a/backend/manager/modules/branding/pom.xml
+++ b/backend/manager/modules/branding/pom.xml
@@ -34,6 +34,7 @@
       </resource>
     </resources>
     <plugins>
+
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
@@ -42,6 +43,13 @@
           </additionalClasspathElements>
         </configuration>
       </plugin>
+
+      <!-- Create the JBoss module: -->
+      <plugin>
+        <groupId>org.ovirt.engine</groupId>
+        <artifactId>jboss-modules-maven-plugin</artifactId>
+      </plugin>
+
     </plugins>
   </build>
   <profiles>
diff --git 
a/backend/manager/modules/branding/src/main/modules/org/ovirt/engine/core/branding/main/module.xml
 
b/backend/manager/modules/branding/src/main/modules/org/ovirt/engine/core/branding/main/module.xml
new file mode 100644
index 0000000..44ced64
--- /dev/null
+++ 
b/backend/manager/modules/branding/src/main/modules/org/ovirt/engine/core/branding/main/module.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<module xmlns="urn:jboss:module:1.1" name="org.ovirt.engine.core.branding">
+
+  <resources>
+    <resource-root path="branding.jar"/>
+  </resources>
+
+  <dependencies>
+    <module name="javax.api"/>
+    <module name="javax.servlet.api"/>
+    <module name="org.apache.log4j"/>
+    <module name="org.codehaus.jackson.jackson-core-asl"/>
+    <module name="org.codehaus.jackson.jackson-mapper-asl"/>
+    <module name="org.ovirt.engine.core.utils"/>
+  </dependencies>
+
+</module>
diff --git a/backend/manager/modules/restapi/interface/common/jaxrs/pom.xml 
b/backend/manager/modules/restapi/interface/common/jaxrs/pom.xml
index fb800c4..dff5807 100644
--- a/backend/manager/modules/restapi/interface/common/jaxrs/pom.xml
+++ b/backend/manager/modules/restapi/interface/common/jaxrs/pom.xml
@@ -51,13 +51,26 @@
       <scope>provided</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
   </dependencies>
 
   <build>
     <plugins>
+
       <plugin>
         <artifactId>maven-checkstyle-plugin</artifactId>
       </plugin>
+
+      <!-- Create the JBoss module: -->
+      <plugin>
+        <groupId>org.ovirt.engine</groupId>
+        <artifactId>jboss-modules-maven-plugin</artifactId>
+      </plugin>
+
     </plugins>
   </build>
   <profiles>
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/PackageExplorer.java
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/PackageExplorer.java
index 058acba..0332e30 100644
--- 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/PackageExplorer.java
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/PackageExplorer.java
@@ -1,32 +1,54 @@
+/*
+* Copyright (c) 2014 Red Hat, Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 package org.ovirt.engine.api.common.util;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.net.URL;
 import java.net.URLDecoder;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class PackageExplorer {
+    /**
+     * The logger used by this class.
+     */
+    private static final Logger log = 
LoggerFactory.getLogger(PackageExplorer.class);
 
     /**
      * Discover classes under target package.
      *
-     * @param packageName
-     *            package to look under
-     * @return list of classes found
+     * @param packageName the fully qualified name of the package
+     * @return the list of class names found
      */
-    public static List<Class<?>> discoverClasses(String packageName) {
-        List<Class<?>> ret = new ArrayList<Class<?>>();
+    public static List<String> discoverClasses(String packageName) {
         ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+        List<String> classNames = new ArrayList<>();
         try {
             Enumeration<URL> resources = 
classLoader.getResources(toPath(packageName));
-            List<File> dirs = new ArrayList<File>();
-            List<JarInputStream> jars = new ArrayList<JarInputStream>();
+            List<File> dirs = new ArrayList<>();
+            List<JarInputStream> jars = new ArrayList<>();
             while (resources.hasMoreElements()) {
                 URL resource = resources.nextElement();
                 if (isJar(resource)) {
@@ -37,16 +59,21 @@
                     dirs.add(new File(URLDecoder.decode(resource.getFile(), 
"UTF-8")));
                 }
             }
-            walkJars(ret, packageName, jars);
-            walkDirs(ret, packageName, dirs);
-        } catch (Exception e) {
-            ret = Collections.emptyList();
+            walkJars(classNames, packageName, jars);
+            walkDirs(classNames, packageName, dirs);
         }
-        return ret;
+        catch (IOException exception) {
+            log.error(
+                "Error while trying to find scan classpath for package 
\"{}\".",
+                packageName,
+                exception
+            );
+        }
+        return classNames;
     }
 
     private static JarInputStream getContainingResource(ClassLoader 
classLoader, URL resource)
-            throws Exception {
+            throws IOException {
         JarInputStream ret = null;
         Enumeration<URL> globals = classLoader.getResources("/");
         while (globals.hasMoreElements()) {
@@ -59,15 +86,15 @@
         return ret;
     }
 
-    private static void walkJars(List<Class<?>> classList, String packageName, 
List<JarInputStream> jars)
-            throws Exception {
+    private static void walkJars(List<String> classNames, String packageName, 
List<JarInputStream> jars)
+            throws IOException {
         for (JarInputStream jarFile : jars) {
             try {
-                JarEntry entry = null;
+                JarEntry entry;
                 while ((entry = jarFile.getNextJarEntry()) != null) {
                     String name = toPackage(entry.getName());
                     if (name.startsWith(packageName) && isClass(name)) {
-                        classList.add(Class.forName(trimClass(name)));
+                        classNames.add(trimClass(name));
                     }
                 }
             } finally {
@@ -78,27 +105,26 @@
         }
     }
 
-    private static void walkDirs(List<Class<?>> classList, String packageName, 
List<File> dirs)
-            throws Exception {
+    private static void walkDirs(List<String> classNames, String packageName, 
List<File> dirs)
+            throws IOException {
         for (File directory : dirs) {
-            List<Class<?>> classes = new ArrayList<Class<?>>();
+            List<String> classes = new ArrayList<>();
             if (directory.exists()) {
                 File[] files = directory.listFiles();
                 for (File file : files) {
                     if (file.isDirectory()) {
                         classes.addAll(getClassesUnder(file, in(packageName, 
file.getName())));
                     } else if (isClass(file.getName())) {
-                        classes.add(Class.forName(in(packageName, 
trimClass(file.getName()))));
+                        classes.add(in(packageName, 
trimClass(file.getName())));
                     }
                 }
-                classList.addAll(getClassesUnder(directory, packageName));
+                classNames.addAll(getClassesUnder(directory, packageName));
             }
         }
     }
 
-    private static List<Class<?>> getClassesUnder(File directory, String 
packageName)
-            throws ClassNotFoundException {
-        List<Class<?>> classes = new ArrayList<Class<?>>();
+    private static List<String> getClassesUnder(File directory, String 
packageName) {
+        List<String> classes = new ArrayList<>();
         if (!directory.exists()) {
             return classes;
         }
@@ -107,7 +133,7 @@
             if (file.isDirectory()) {
                 classes.addAll(getClassesUnder(file, in(packageName, 
file.getName())));
             } else if (isClass(file.getName())) {
-                classes.add(Class.forName(in(packageName, 
trimClass(file.getName()))));
+                classes.add(in(packageName, trimClass(file.getName())));
             }
         }
         return classes;
diff --git 
a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/modules/org/ovirt/engine/api/interface-common-jaxrs/main/module.xml
 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/modules/org/ovirt/engine/api/interface-common-jaxrs/main/module.xml
new file mode 100644
index 0000000..2391ac6
--- /dev/null
+++ 
b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/modules/org/ovirt/engine/api/interface-common-jaxrs/main/module.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<module xmlns="urn:jboss:module:1.1" 
name="org.ovirt.engine.api.interface-common-jaxrs">
+
+  <resources>
+    <resource-root path="interface-common-jaxrs.jar"/>
+  </resources>
+
+  <dependencies>
+    <module name="javax.api"/>
+    <module name="javax.ws.rs.api"/>
+    <module name="javax.xml.bind.api"/>
+    <module name="org.apache.commons.codec"/>
+    <module name="org.apache.commons.lang"/>
+    <module name="org.jboss.resteasy.resteasy-jaxrs"/>
+    <module name="org.ovirt.engine.api.restapi-definition"/>
+    <module name="org.slf4j"/>
+  </dependencies>
+
+</module>
diff --git a/backend/manager/modules/restapi/interface/definition/pom.xml 
b/backend/manager/modules/restapi/interface/definition/pom.xml
index baa4c7d..e6ca666 100644
--- a/backend/manager/modules/restapi/interface/definition/pom.xml
+++ b/backend/manager/modules/restapi/interface/definition/pom.xml
@@ -119,6 +119,12 @@
         </executions>
       </plugin>
 
+      <!-- Create the JBoss module: -->
+      <plugin>
+        <groupId>org.ovirt.engine</groupId>
+        <artifactId>jboss-modules-maven-plugin</artifactId>
+      </plugin>
+
     </plugins>
   </build>
 
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/FileUtils.java
 
b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/FileUtils.java
deleted file mode 100644
index 33b4df4..0000000
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/FileUtils.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.ovirt.engine.api.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-
-
-public class FileUtils {
-    /**
-     * Locates specified file in given package
-     *
-     * @param  packageName
-     * @param  fileName
-     * @throws IOException
-     * @return InputStream
-     */
-    public static InputStream get(String packageName, String fileName) throws 
IOException {
-        JarEntry jarEntry;
-        String path = packageName.replace('.', '/');
-        List<URL> dirs = ReflectionHelper.getDirectories(path);
-        ClassLoader loader = URLClassLoader.newInstance(dirs.toArray(new 
URL[0]),
-                Thread.currentThread().getContextClassLoader());
-
-        for (URL directory : dirs) {
-            String resource = directory.getPath().replace("/" + path + "/", 
"");
-            if (resource.endsWith(".jar")) {
-                JarInputStream jarFileInputStream = null;
-                try{
-                    jarFileInputStream = new JarInputStream(new 
FileInputStream(resource));
-                    while (true) {
-                        jarEntry = jarFileInputStream.getNextJarEntry();
-                        if (jarEntry == null)
-                            break;
-                        if (jarEntry.getName().equals(fileName)) {
-                            InputStream str = 
loader.getResourceAsStream(loader.getResource(jarEntry.getName()).getFile());
-                            if (str != null) {
-                                return str;
-                            }
-                        }
-                    }
-                } finally {
-                    closeQuietly(jarFileInputStream);
-                }
-            }
-        }
-        return null;
-    }
-
-    public static InputStream get(String fileName) throws IOException {
-        return new FileInputStream(new File(fileName)); // replace with the 
right implementation.
-    }
-
-    private static void closeQuietly(InputStream stream) {
-        if(stream != null) {
-            try {
-                stream.close();
-            } catch (IOException e) {
-                //ignore exception
-            }
-        }
-    }
-}
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/modules/org/ovirt/engine/api/restapi-definition/main/module.xml
 
b/backend/manager/modules/restapi/interface/definition/src/main/modules/org/ovirt/engine/api/restapi-definition/main/module.xml
new file mode 100644
index 0000000..f1f8787
--- /dev/null
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/modules/org/ovirt/engine/api/restapi-definition/main/module.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<module xmlns="urn:jboss:module:1.1" 
name="org.ovirt.engine.api.restapi-definition">
+
+  <resources>
+    <resource-root path="restapi-definition.jar"/>
+  </resources>
+
+  <dependencies>
+    <module name="javax.api"/>
+    <module name="javax.ws.rs.api"/>
+    <module name="javax.xml.bind.api"/>
+    <module name="org.apache.commons.codec"/>
+    <module name="org.apache.commons.lang"/>
+    <module name="org.apache.xmlgraphics.fop"/>
+    <module name="org.codehaus.jackson.jackson-core-asl"/>
+    <module name="org.codehaus.jackson.jackson-mapper-asl"/>
+    <module name="org.codehaus.jackson.jackson-xc"/>
+    <module name="org.jboss.resteasy.resteasy-jackson-provider"/>
+    <module name="org.jboss.resteasy.resteasy-jaxb-provider"/>
+    <module name="org.ovirt.engine.core.common"/>
+    <module name="org.slf4j"/>
+    <module name="org.yaml.snakeyaml"/>
+  </dependencies>
+
+</module>
diff --git a/backend/manager/modules/restapi/jaxrs/pom.xml 
b/backend/manager/modules/restapi/jaxrs/pom.xml
index d6d771a..3afbc2d 100644
--- a/backend/manager/modules/restapi/jaxrs/pom.xml
+++ b/backend/manager/modules/restapi/jaxrs/pom.xml
@@ -108,14 +108,32 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+
     <dependency>
       <groupId>org.jboss.resteasy</groupId>
       <artifactId>resteasy-jaxb-provider</artifactId>
       <version>${resteasy.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
   </dependencies>
 
+  <build>
+    <plugins>
+
+      <!-- Create the JBoss module: -->
+      <plugin>
+        <groupId>org.ovirt.engine</groupId>
+        <artifactId>jboss-modules-maven-plugin</artifactId>
+      </plugin>
+
+    </plugins>
+  </build>
+
   <profiles>
     <profile>
         <id>findbugs</id>
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
index ea6e903..5740da3 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
@@ -52,7 +52,6 @@
 import org.ovirt.engine.api.restapi.util.VersionHelper;
 import org.ovirt.engine.api.rsdl.RsdlManager;
 import org.ovirt.engine.api.utils.ApiRootLinksCreator;
-import org.ovirt.engine.api.utils.FileUtils;
 import org.ovirt.engine.api.utils.LinkHelper;
 import org.ovirt.engine.core.common.action.VdcActionParametersBase;
 import org.ovirt.engine.core.common.action.VdcActionType;
@@ -70,7 +69,6 @@
     implements ApiResource {
 
     private static final String SYSTEM_STATS_ERROR = "Unknown error querying 
system statistics";
-    private static final String RESOURCES_PACKAGE = 
"org.ovirt.engine.api.resource";
     private static final String API_SCHEMA = "api.xsd";
     private static final String RSDL_CONSTRAINT_PARAMETER = "rsdl";
     private static final String SCHEMA_CONSTRAINT_PARAMETER = "schema";
@@ -244,12 +242,13 @@
     private Response getSchema() {
         ByteArrayOutputStream baos = null;
         InputStream is = null;
-        int thisLine;
+        byte[] buffer = new byte[4096];
         try {
             baos = new ByteArrayOutputStream();
-            is = FileUtils.get(RESOURCES_PACKAGE, API_SCHEMA);
-            while ((thisLine = is.read()) != -1) {
-                baos.write(thisLine);
+            is = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(API_SCHEMA);
+            int count;
+            while ((count = is.read(buffer)) != -1) {
+                baos.write(buffer, 0, count);
             }
             baos.flush();
             return Response.ok(baos.toByteArray(), 
MediaType.APPLICATION_OCTET_STREAM)
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
index f957d72..5b9a5da 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/ValidatorLocator.java
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2014 Red Hat, Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 package org.ovirt.engine.api.restapi.resource.validation;
 
 import java.util.HashMap;
@@ -5,30 +21,53 @@
 import java.util.Map;
 
 import org.ovirt.engine.api.common.util.PackageExplorer;
-import org.ovirt.engine.core.utils.log.Log;
-import org.ovirt.engine.core.utils.log.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ValidatorLocator {
+    /**
+     * The logger used by this class.
+     */
+    protected static final Logger log = 
LoggerFactory.getLogger(ValidatorLocator.class);
 
-    protected static final Log LOG = LogFactory.getLog(ValidatorLocator.class);
-    private Map<Class<?>, Validator<?>> validators = new HashMap<Class<?>, 
Validator<?>>();
+    /**
+     * The cache of loaded validators.
+     */
+    private Map<Class<?>, Validator<?>> validators = new HashMap<>();
 
     public void populate() {
         populate(this.getClass().getPackage().getName());
     }
 
     public void populate(String discoverPackageName) {
-        List<Class<?>> classes = 
PackageExplorer.discoverClasses(discoverPackageName);
-        for (Class<?> clz : classes) {
-            ValidatedClass validatedClass = 
clz.getAnnotation(ValidatedClass.class);
-            if (validatedClass != null) {
-                try {
-                    validators.put(validatedClass.clazz(),
-                            (Validator<?>) clz.newInstance());
-                } catch (Exception e) {
-                    LOG.error("Problem initializing Enum Validators", e);
+        ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+        List<String> classNames = 
PackageExplorer.discoverClasses(discoverPackageName);
+        for (String className : classNames) {
+            try {
+                @SuppressWarnings("unchecked")
+                Class<Validator<?>> validatorClass = (Class<Validator<?>>) 
classLoader.loadClass(className);
+                ValidatedClass validatedClass = 
validatorClass.getAnnotation(ValidatedClass.class);
+                if (validatedClass != null) {
+                    try {
+                        Validator<?> validatorInstance = 
validatorClass.newInstance();
+                        validators.put(validatedClass.clazz(), 
validatorInstance);
+                    }
+                    catch (InstantiationException|IllegalAccessException 
exception) {
+                        log.error(
+                            "Error while trying to create instance of 
validator class \"{}\".",
+                            className,
+                            exception
+                        );
+                    }
                 }
             }
+            catch (ClassNotFoundException exception) {
+                log.error(
+                    "Error while trying to load validator class \"{}\".",
+                    className,
+                    exception
+                );
+            }
         }
     }
 
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/modules/org/ovirt/engine/api/restapi-jaxrs/main/module.xml
 
b/backend/manager/modules/restapi/jaxrs/src/main/modules/org/ovirt/engine/api/restapi-jaxrs/main/module.xml
new file mode 100644
index 0000000..2f2fd3d
--- /dev/null
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/modules/org/ovirt/engine/api/restapi-jaxrs/main/module.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<module xmlns="urn:jboss:module:1.1" name="org.ovirt.engine.api.restapi-jaxrs">
+
+  <resources>
+    <resource-root path="restapi-jaxrs.jar"/>
+  </resources>
+
+  <dependencies>
+    <module name="javax.api"/>
+    <module name="javax.ws.rs.api"/>
+    <module name="javax.xml.bind.api"/>
+    <module name="org.apache.commons.lang"/>
+    <module name="org.apache.log4j"/>
+    <module name="org.codehaus.jackson.jackson-core-asl"/>
+    <module name="org.jboss.resteasy.resteasy-jaxb-provider"/>
+    <module name="org.jboss.resteasy.resteasy-jaxrs"/>
+    <module name="org.ovirt.engine.api.interface-common-jaxrs"/>
+    <module name="org.ovirt.engine.api.restapi-definition"/>
+    <module name="org.ovirt.engine.api.restapi-types"/>
+    <module name="org.ovirt.engine.core.branding"/>
+    <module name="org.ovirt.engine.core.common"/>
+    <module name="org.ovirt.engine.core.compat"/>
+    <module name="org.ovirt.engine.core.utils"/>
+    <module name="org.slf4j"/>
+  </dependencies>
+
+</module>
diff --git a/backend/manager/modules/restapi/types/pom.xml 
b/backend/manager/modules/restapi/types/pom.xml
index 43e79605..f9b0104 100644
--- a/backend/manager/modules/restapi/types/pom.xml
+++ b/backend/manager/modules/restapi/types/pom.xml
@@ -64,8 +64,25 @@
       <artifactId>commons-codec</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
   </dependencies>
 
+  <build>
+    <plugins>
+
+      <!-- Create the JBoss module: -->
+      <plugin>
+        <groupId>org.ovirt.engine</groupId>
+        <artifactId>jboss-modules-maven-plugin</artifactId>
+      </plugin>
+
+    </plugins>
+  </build>
+
   <profiles>
     <profile>
         <id>findbugs</id>
diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
index edb4d48..5b40601 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/MappingLocator.java
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2014 Red Hat, Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 package org.ovirt.engine.api.restapi.types;
 
 import java.lang.reflect.InvocationTargetException;
@@ -9,11 +25,17 @@
 import org.ovirt.engine.api.common.util.PackageExplorer;
 import org.ovirt.engine.api.restapi.utils.MalformedIdException;
 import org.ovirt.engine.api.restapi.utils.MappingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Discovers and manages type mappers.
  */
 public class MappingLocator {
+    /**
+     * The logger used by this class.
+     */
+    private static final Logger log = 
LoggerFactory.getLogger(MappingLocator.class);
 
     private String discoverPackageName;
     private Map<ClassPairKey, Mapper<?, ?>> mappers;
@@ -22,7 +44,7 @@
      * Normal constructor used when injected
      */
     public MappingLocator() {
-        mappers = new HashMap<ClassPairKey, Mapper<?, ?>>();
+        mappers = new HashMap<>();
     }
 
     /**
@@ -33,7 +55,7 @@
      */
     MappingLocator(String discoverPackageName) {
         this.discoverPackageName = discoverPackageName;
-        mappers = new HashMap<ClassPairKey, Mapper<?, ?>>();
+        mappers = new HashMap<>();
     }
 
     /**
@@ -43,16 +65,27 @@
      * with the @Mapping annotation.
      */
     public void populate() {
-        List<Class<?>> classes = 
PackageExplorer.discoverClasses(discoverPackageName != null ? 
discoverPackageName
-                : this.getClass().getPackage().getName());
-        for (Class<?> clz : classes) {
-            for (Method method : clz.getMethods()) {
-                Mapping mapping = method.getAnnotation(Mapping.class);
-                if (mapping != null) {
-                    mappers.put(new ClassPairKey(mapping.from(), mapping.to()),
+        String packageName = discoverPackageName != null? discoverPackageName: 
this.getClass().getPackage().getName();
+        ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+        List<String> classNames = PackageExplorer.discoverClasses(packageName);
+        for (String className : classNames) {
+            try {
+                Class<?> mapperClass = classLoader.loadClass(className);
+                for (Method method : mapperClass.getMethods()) {
+                    Mapping mapping = method.getAnnotation(Mapping.class);
+                    if (mapping != null) {
+                        mappers.put(new ClassPairKey(mapping.from(), 
mapping.to()),
                             new MethodInvokerMapper(method, mapping.to()));
+                    }
                 }
             }
+            catch (ClassNotFoundException exception) {
+                log.error(
+                    "Error while trying to load mapper class \"{}\".",
+                    className,
+                    exception
+                );
+            }
         }
     }
 
diff --git 
a/backend/manager/modules/restapi/types/src/main/modules/org/ovirt/engine/api/restapi-types/main/module.xml
 
b/backend/manager/modules/restapi/types/src/main/modules/org/ovirt/engine/api/restapi-types/main/module.xml
new file mode 100644
index 0000000..04ec031
--- /dev/null
+++ 
b/backend/manager/modules/restapi/types/src/main/modules/org/ovirt/engine/api/restapi-types/main/module.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<module xmlns="urn:jboss:module:1.1" name="org.ovirt.engine.api.restapi-types">
+
+  <resources>
+    <resource-root path="restapi-types.jar"/>
+  </resources>
+
+  <dependencies>
+    <module name="javax.api"/>
+    <module name="javax.xml.bind.api"/>
+    <module name="org.apache.commons.lang"/>
+    <module name="org.ovirt.engine.api.interface-common-jaxrs"/>
+    <module name="org.ovirt.engine.api.restapi-definition"/>
+    <module name="org.ovirt.engine.core.common"/>
+    <module name="org.ovirt.engine.core.compat"/>
+    <module name="org.ovirt.engine.core.utils"/>
+    <module name="org.slf4j"/>
+  </dependencies>
+
+</module>
diff --git a/backend/manager/modules/restapi/webapp/pom.xml 
b/backend/manager/modules/restapi/webapp/pom.xml
index fd0457a..8b37ac3 100644
--- a/backend/manager/modules/restapi/webapp/pom.xml
+++ b/backend/manager/modules/restapi/webapp/pom.xml
@@ -1,4 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project
+  xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -11,92 +15,23 @@
   <packaging>war</packaging>
   <name>oVirt RESTful API Backend Integration Webapp</name>
 
-  <properties>
-       <webapp.name>restapi</webapp.name>
-  </properties>
-  <dependencies>
-     <dependency>
-       <groupId>org.ovirt.engine.api</groupId>
-       <artifactId>restapi-jaxrs</artifactId>
-       <version>${engine.version}</version>
-     </dependency>
-
-     <dependency>
-       <groupId>org.jboss.resteasy</groupId>
-       <artifactId>resteasy-jaxrs</artifactId>
-       <version>${resteasy.version}</version>
-       <scope>provided</scope>
-     </dependency>
-  </dependencies>
   <build>
     <plugins>
+
+      <!-- Don't include Maven metadata or empty classes directory in
+           the generated .jar file: -->
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
-
-          <!-- Add a the manifest that contains the required
-               dependencies for JBoss modules: -->
           <archive>
             <addMavenDescriptor>false</addMavenDescriptor>
-            
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
           </archive>
-
-          <!-- Don't include any of the external dependencies, as they are
-               already included as references in the manifest (note that the
-               web.xml file is included regardless of this configuration): -->
-          <packagingIncludes>
-            WEB-INF/lib/interface-common-jaxrs.jar,
-            WEB-INF/lib/restapi-definition.jar,
-            WEB-INF/lib/restapi-jaxrs.jar,
-            WEB-INF/lib/restapi-types.jar,
-            WEB-INF/lib/branding.jar,
-          </packagingIncludes>
-
+          <packagingExcludes>WEB-INF/classes</packagingExcludes>
         </configuration>
       </plugin>
+
     </plugins>
   </build>
-  <profiles>
-    <profile>
-        <id>findbugs</id>
-        <activation>
-            <activeByDefault>true</activeByDefault>
-        </activation>
-        <build>
-            <plugins>
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>findbugs-maven-plugin</artifactId>
-                    <version>${findbugs.version}</version>
-                    <configuration>
-                        <xmlOutput>true</xmlOutput>
-                        <!-- Optional directory to put findbugs xdoc xml 
report -->
-                        <excludeFilterFile> 
${basedir}/exclude-filters.xml</excludeFilterFile>
-                        <xmlOutputDirectory>target/site</xmlOutputDirectory>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </build>
-    </profile>
-
-    <profile>
-        <id>findbugs-general</id>
-        <build>
-            <plugins>
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>findbugs-maven-plugin</artifactId>
-                    <version>${findbugs.version}</version>
-                    <configuration>
-                        <xmlOutput>true</xmlOutput>
-                        <!-- Optional directory to put findbugs xdoc xml 
report -->
-                        <excludeFilterFile> ${basedir}/exclude-filters.xml, 
${basedir}/../../../../../exclude-filters-general.xml</excludeFilterFile>
-                        <xmlOutputDirectory>target/site</xmlOutputDirectory>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </build>
-    </profile>
-  </profiles>
 
 </project>
diff --git 
a/backend/manager/modules/restapi/webapp/src/main/resources/META-INF/MANIFEST.MF
 
b/backend/manager/modules/restapi/webapp/src/main/resources/META-INF/MANIFEST.MF
deleted file mode 100644
index 6856a8a..0000000
--- 
a/backend/manager/modules/restapi/webapp/src/main/resources/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Dependencies: org.codehaus.jackson.jackson-xc,org.yaml.snakeyaml
-
diff --git 
a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
new file mode 100644
index 0000000..d642b80
--- /dev/null
+++ 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
+
+  <deployment>
+    <dependencies>
+      <module name="org.ovirt.engine.api.interface-common-jaxrs" 
annotations="true" services="import"/>
+      <module name="org.ovirt.engine.api.restapi-definition" 
annotations="true" services="import"/>
+      <module name="org.ovirt.engine.api.restapi-jaxrs" annotations="true" 
services="import"/>
+      <module name="org.ovirt.engine.api.restapi-types" annotations="true" 
services="import"/>
+      <module name="org.ovirt.engine.core.aaa"/>
+    </dependencies>
+  </deployment>
+
+</jboss-deployment-structure>
diff --git 
a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-web.xml 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-web.xml
new file mode 100644
index 0000000..3c13a43
--- /dev/null
+++ 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/jboss-web.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<jboss-web
+  xmlns="http://www.jboss.com/xml/ns/javaee";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee 
http://www.jboss.org/j2ee/schema/jboss-web_7_1.xsd";
+  version="7.1">
+
+  <context-root>/ovirt-engine/api</context-root>
+
+</jboss-web>
diff --git 
a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml 
b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
index ca684a3..4754f1c 100644
--- a/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
@@ -1,5 +1,21 @@
 <?xml version="1.0"?>
 
+<!--
+Copyright (c) 2014 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
 <web-app
   xmlns="http://java.sun.com/xml/ns/javaee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
diff --git a/ear/pom.xml b/ear/pom.xml
index ce9b9ae..e19be38 100644
--- a/ear/pom.xml
+++ b/ear/pom.xml
@@ -36,13 +36,6 @@
     </dependency>
 
     <dependency>
-      <groupId>org.ovirt.engine.api</groupId>
-      <artifactId>restapi-webapp</artifactId>
-      <version>${engine.version}</version>
-      <type>war</type>
-    </dependency>
-
-    <dependency>
       <groupId>org.ovirt.engine.ui</groupId>
       <artifactId>userportal</artifactId>
       <version>${engine.version}</version>
@@ -194,20 +187,6 @@
               <artifactId>root-war</artifactId>
               <bundleFileName>root.war</bundleFileName>
               <contextRoot>/</contextRoot>
-            </webModule>
-
-            <webModule>
-              <groupId>org.ovirt.engine.api</groupId>
-              <artifactId>restapi-webapp</artifactId>
-              <bundleFileName>restapi.war</bundleFileName>
-              <contextRoot>${application.baseuri}</contextRoot>
-            </webModule>
-
-            <webModule>
-              <groupId>org.ovirt.engine.api</groupId>
-              <artifactId>restapi-webapp</artifactId>
-              <bundleFileName>legacy_restapi.war</bundleFileName>
-              <contextRoot>/api</contextRoot>
             </webModule>
 
             <webModule>
diff --git a/ear/src/main/resources/META-INF/MANIFEST.MF 
b/ear/src/main/resources/META-INF/MANIFEST.MF
index 6485e4a..2b122ef 100644
--- a/ear/src/main/resources/META-INF/MANIFEST.MF
+++ b/ear/src/main/resources/META-INF/MANIFEST.MF
@@ -27,7 +27,6 @@
  org.ovirt.engine.api.ovirt-engine-extensions-api,
  org.ovirt.vdsm-jsonrpc-java,
  org.quartz,
- org.apache.xmlgraphics.fop,
  org.springframework,
  com.woorea.openstack.sdk services,
  org.yaml.snakeyaml
diff --git a/ovirt-engine.spec.in b/ovirt-engine.spec.in
index c16d582..dd12a9a 100644
--- a/ovirt-engine.spec.in
+++ b/ovirt-engine.spec.in
@@ -93,8 +93,8 @@
 %global engine_log %{_localstatedir}/log/%{engine_name}
 %global engine_name ovirt-engine
 %global engine_pki %{_sysconfdir}/pki/%{engine_name}
-%global engine_restapi_war %{engine_ear}/restapi.war
-%global engine_legacy_restapi_war %{engine_ear}/legacy_restapi.war
+%global engine_restapi_war %{engine_data}/restapi.war
+%global engine_legacy_restapi_war %{engine_data}/legacy_restapi.war
 %global engine_run %{_localstatedir}/run/%{engine_name}
 %global engine_state %{_localstatedir}/lib/%{engine_name}
 %global engine_tmp %{_localstatedir}/tmp/%{engine_name}
@@ -583,10 +583,13 @@
 #
 # Force TLS/SSL for selected applications.
 #
-for war in restapi legacy_restapi userportal webadmin; do
+for war in \
+       "%{buildroot}%{engine_ear}"/{userportal,webadmin}.war \
+       "%{buildroot}%{engine_restapi_war}" \
+       "%{buildroot}%{engine_legacy_restapi_war}"; do
        sed -i \
                
's#<transport-guarantee>NONE</transport-guarantee>#<transport-guarantee>CONFIDENTIAL</transport-guarantee>#'
 \
-               "%{buildroot}%{engine_ear}/${war}.war/WEB-INF/web.xml"
+               "${war}/WEB-INF/web.xml"
 done
 
 #
@@ -603,15 +606,18 @@
 done << __EOF__
 %{engine_ear}/bll.jar
 %{engine_ear}/docs.war/WEB-INF/lib/branding.jar
-%{engine_ear}/legacy_restapi.war/WEB-INF/lib/branding.jar
 %{engine_ear}/lib/vdsbroker.jar
-%{engine_ear}/restapi.war/WEB-INF/lib/branding.jar
 %{engine_ear}/scheduler.jar
 %{engine_ear}/userportal.war/WEB-INF/lib/branding.jar
 %{engine_ear}/webadmin.war/WEB-INF/lib/branding.jar
 %{engine_ear}/welcome.war/WEB-INF/lib/branding.jar
+%{engine_jboss_modules}/org/ovirt/engine/api/interface-common-jaxrs/main/interface-common-jaxrs.jar
 
%{engine_jboss_modules}/org/ovirt/engine/api/ovirt-engine-extensions-api/main/ovirt-engine-extensions-api.jar
+%{engine_jboss_modules}/org/ovirt/engine/api/restapi-definition/main/restapi-definition.jar
+%{engine_jboss_modules}/org/ovirt/engine/api/restapi-jaxrs/main/restapi-jaxrs.jar
+%{engine_jboss_modules}/org/ovirt/engine/api/restapi-types/main/restapi-types.jar
 %{engine_jboss_modules}/org/ovirt/engine/core/aaa/main/aaa.jar
+%{engine_jboss_modules}/org/ovirt/engine/core/branding/main/branding.jar
 %{engine_jboss_modules}/org/ovirt/engine/core/common/main/common.jar
 %{engine_jboss_modules}/org/ovirt/engine/core/compat/main/compat.jar
 %{engine_jboss_modules}/org/ovirt/engine/core/dal/main/dal.jar
@@ -621,14 +627,6 @@
 %{engine_jboss_modules}/org/ovirt/engine/core/utils/main/utils.jar
 %{engine_jboss_modules}/org/ovirt/engine/core/uutils/main/uutils.jar
 %{engine_jboss_modules}/org/ovirt/engine/extensions/builtin/main/builtin.jar
-%{engine_legacy_restapi_war}/WEB-INF/lib/interface-common-jaxrs.jar
-%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-definition.jar
-%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-jaxrs.jar
-%{engine_legacy_restapi_war}/WEB-INF/lib/restapi-types.jar
-%{engine_restapi_war}/WEB-INF/lib/interface-common-jaxrs.jar
-%{engine_restapi_war}/WEB-INF/lib/restapi-definition.jar
-%{engine_restapi_war}/WEB-INF/lib/restapi-jaxrs.jar
-%{engine_restapi_war}/WEB-INF/lib/restapi-types.jar
 __EOF__
 
 # Needed for compatibility if package is different than the directory structure
diff --git a/packaging/services/ovirt-engine/ovirt-engine.conf.in 
b/packaging/services/ovirt-engine/ovirt-engine.conf.in
index ef2a419..e7b8579 100644
--- a/packaging/services/ovirt-engine/ovirt-engine.conf.in
+++ b/packaging/services/ovirt-engine/ovirt-engine.conf.in
@@ -127,7 +127,7 @@
 # separated files or directories that should exist under
 # /usr/share/ovirt-engine:
 #
-ENGINE_APPS=engine.ear
+ENGINE_APPS="engine.ear restapi.war legacy_restapi.war"
 ENGINE_URI=/ovirt-engine
 
 #


-- 
To view, visit http://gerrit.ovirt.org/29474
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4079277f60e5521d9b61379fa78713a5c4ccc10
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to