From 02c75251b33c74a9d7d2abe67effa1e6e2007dea Mon Sep 17 00:00:00 2001 From: Antonio Fornie Date: Fri, 22 Aug 2014 06:44:10 -0500 Subject: [PATCH] Fixing NPE due to use of dependencies before Spring injection --- .../com/cloud/network/router/VpcNetworkHelperImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java b/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java index bbd08fddeba..aa57a5407d5 100644 --- a/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java +++ b/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java @@ -23,6 +23,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.TreeSet; +import javax.annotation.PostConstruct; import javax.inject.Inject; import org.apache.commons.lang.StringUtils; @@ -56,7 +57,13 @@ public class VpcNetworkHelperImpl extends NetworkHelperImpl { @Inject protected NicProfileHelper nicProfileHelper; - protected final String noHypervisorsErrMsgDetails = StringUtils.join(this.vpcMgr.getSupportedVpcHypervisors(), ','); + protected String noHypervisorsErrMsgDetails; + + @PostConstruct + protected void setupNoHypervisorsErrMsgDetails() { + this.noHypervisorsErrMsgDetails = StringUtils.join(this.vpcMgr.getSupportedVpcHypervisors(), ','); + this.noHypervisorsErrMsgDetails += " are the only supported Hypervisors"; + } @Override protected String getNoHypervisorsErrMsgDetails() {