Juan Hernandez has uploaded a new change for review.

Change subject: userportal, webadmin>: Don't bundle gwt-dev.jar
......................................................................

userportal, webadmin>: Don't bundle gwt-dev.jar

The GWT RPC mechanism that we currently use needs some classes that are
part of the gwt-dev.jar file since version 2.5.1. This means that we
need to add that gwt-dev.jar file to the WEB-INF/lib directories of the
applications, and that causes class loading problems because gwt-dev.jar
bundles many third party libraries, including its own copy of the Xerces
XML parser. To avoid this issue we are copying into the frontend project
the sources of the classes needed by the GWT RPC mechanism and not
included in gwt-servlet.jar, currently only
com.google.gwt.core.client.GWTBridge. This way we can set the scope of
the gwt-dev dependency to provided so that it won't be included in the
WEB-INF/lib directories.

Change-Id: I0555b185ea8c52469ebe0779f5287b5bd824a569
Signed-off-by: Juan Hernandez <[email protected]>
---
M frontend/webadmin/modules/frontend/pom.xml
A 
frontend/webadmin/modules/frontend/src/main/java/com/google/gwt/core/client/GWTBridge.java
M pom.xml
3 files changed, 45 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/17264/1

diff --git a/frontend/webadmin/modules/frontend/pom.xml 
b/frontend/webadmin/modules/frontend/pom.xml
index c9102fd..8366848 100644
--- a/frontend/webadmin/modules/frontend/pom.xml
+++ b/frontend/webadmin/modules/frontend/pom.xml
@@ -19,6 +19,10 @@
       <artifactId>gwt-user</artifactId>
     </dependency>
     <dependency>
+      <groupId>com.google.gwt</groupId>
+      <artifactId>gwt-dev</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.spec.javax.servlet</groupId>
       <artifactId>jboss-servlet-api_3.0_spec</artifactId>
       <scope>provided</scope>
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/com/google/gwt/core/client/GWTBridge.java
 
b/frontend/webadmin/modules/frontend/src/main/java/com/google/gwt/core/client/GWTBridge.java
new file mode 100644
index 0000000..848b0b4
--- /dev/null
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/com/google/gwt/core/client/GWTBridge.java
@@ -0,0 +1,33 @@
+// This class has been copied from the GWT 2.5.1 source code because it
+// is used by the GWT RPC but it isn't included in the gwt-servlet.jar.
+// The alternative is to include the gwt-dev.jar file in the runtime
+// class path of the application and that introduces many class loaded
+// problems caused by the fact that gwt-dev.jar bundles many third party
+// dependencies, including its own version of the Xerces XML parser.
+
+/*
+ * Copyright 2008 Google 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 com.google.gwt.core.client;
+
+/**
+ * When running in Development Mode, acts as a bridge from {@link GWT} into the
+ * Development Mode environment.
+ *
+ * For code that may run anywhere besides the client, use
+ * {@link com.google.gwt.core.shared.GWTBridge} instead.
+ */
+public abstract class GWTBridge extends com.google.gwt.core.shared.GWTBridge {
+}
diff --git a/pom.xml b/pom.xml
index 8565c09..481ad7f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -269,12 +269,19 @@
         <version>${gwt.version}</version>
         <scope>provided</scope>
       </dependency>
+
+      <!-- We avoid having gwt-dev.jar in the runtime class path adding
+           to the frontend.jar file the classes that the GWT direct-eval
+           RPC (deRPC) needs, that way we can set the scope of this
+           dependency as provided and it won't be added to the generated
+           .war files: -->
       <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-dev</artifactId>
         <version>${gwt.version}</version>
-        <!-- gwt-dev needs to be on runtime classpath due to GWT direct-eval 
RPC (deRPC) usage -->
+        <scope>provided</scope>
       </dependency>
+
       <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-servlet</artifactId>


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0555b185ea8c52469ebe0779f5287b5bd824a569
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