From 490e87a617970874f43c35cb74efc2817fba87bf Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 17 Aug 2012 13:39:45 -0700 Subject: [PATCH] Fix small compilation issue encountered when building with maven --- {server => agent}/src/com/cloud/agent/VmmAgentShell.java | 0 console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java | 4 ++-- .../nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename {server => agent}/src/com/cloud/agent/VmmAgentShell.java (100%) diff --git a/server/src/com/cloud/agent/VmmAgentShell.java b/agent/src/com/cloud/agent/VmmAgentShell.java similarity index 100% rename from server/src/com/cloud/agent/VmmAgentShell.java rename to agent/src/com/cloud/agent/VmmAgentShell.java diff --git a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java index 9f1304f627f..a722d8305a2 100644 --- a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java +++ b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.Properties; import java.util.concurrent.Executor; -import org.apache.axis.encoding.Base64; +import org.apache.commons.codec.binary.Base64; import org.apache.log4j.xml.DOMConfigurator; import com.cloud.consoleproxy.util.Logger; @@ -77,7 +77,7 @@ public class ConsoleProxy { byte[] randomBytes = new byte[16]; random.nextBytes(randomBytes); - return Base64.encode(randomBytes); + return Base64.encodeBase64String(randomBytes); } catch (NoSuchAlgorithmException e) { s_logger.error("Unexpected exception ", e); assert(false); diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java index a24d80930a4..264b24a9e0e 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java @@ -255,7 +255,7 @@ public class NiciraNvpApi { T result; try { - result = gson.fromJson(pm.getResponseBodyAsString(), TypeToken.get(newObject.getClass()).getType()); + result = (T)gson.fromJson(pm.getResponseBodyAsString(), TypeToken.get(newObject.getClass()).getType()); } catch (IOException e) { throw new NiciraNvpApiException("Failed to decode json response body", e); } @@ -314,7 +314,7 @@ public class NiciraNvpApi { Gson gson = new Gson(); T returnValue; try { - returnValue = gson.fromJson(gm.getResponseBodyAsString(), returnObjectType); + returnValue = (T)gson.fromJson(gm.getResponseBodyAsString(), returnObjectType); } catch (IOException e) { s_logger.error("IOException while retrieving response body",e); throw new NiciraNvpApiException(e);