Merge "Change to fix SQLInvalidAuthorizationSpecException"
[policy/xacml-pdp.git] / applications / common / src / main / java / org / onap / policy / pdp / xacml / application / common / operationshistory / GetOperationOutcomePip.java
index 4f327cf..f2339b1 100644 (file)
@@ -29,6 +29,7 @@ import com.att.research.xacml.std.pip.StdPIPResponse;
 import com.google.common.base.Strings;
 
 import java.util.Arrays;
+import java.util.Base64;
 import java.util.Collection;
 import java.util.Properties;
 
@@ -66,6 +67,14 @@ public class GetOperationOutcomePip extends StdOnapPip {
             //
             Properties emProperties = new Properties();
             emProperties.putAll(properties);
+
+            //
+            // Need to decode the password before creating the EntityManager
+            //
+            String decodedPassword = new String(Base64.getDecoder()
+                    .decode(emProperties.getProperty("javax.persistence.jdbc.password")));
+            emProperties.setProperty("javax.persistence.jdbc.password", decodedPassword);
+
             //
             // Create the entity manager factory
             //