summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
Diffstat (limited to 'cadi/core')
-rw-r--r--cadi/core/pom.xml2
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java7
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java8
3 files changed, 15 insertions, 2 deletions
diff --git a/cadi/core/pom.xml b/cadi/core/pom.xml
index 9f1d8aeb..337262da 100644
--- a/cadi/core/pom.xml
+++ b/cadi/core/pom.xml
@@ -16,7 +16,7 @@
<groupId>org.onap.aaf.authz</groupId>
<artifactId>cadiparent</artifactId>
<relativePath>..</relativePath>
- <version>2.1.14-SNAPSHOT</version>
+ <version>2.1.15-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
index 994e3250..26aa98cb 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
@@ -21,12 +21,14 @@
package org.onap.aaf.cadi;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
+import java.io.StringBufferInputStream;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -303,6 +305,11 @@ public class PropAccess implements Access {
if (o!=null) {
if(o.getClass().isArray()) {
first = write(first,sb,(Object[])o);
+ } else if(o instanceof Throwable) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(baos);
+ ((Throwable)o).printStackTrace(ps);
+ sb.append(baos.toString());
} else {
s=o.toString();
if (first) {
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
index 48f5e2d1..b53b54da 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
@@ -976,6 +976,7 @@ public class Config {
public static<T> void add(Access access, final String tag, List<Priori<T>> list) {
String plugins = access.getProperty(tag, null);
if(plugins!=null) {
+ access.log(Level.INIT, "Adding TAF Plugins: ", plugins);
for(String tafs : Split.splitTrim(';', plugins)) {
String[] pluginArray = Split.splitTrim(',', tafs);
String clssn = null;
@@ -1004,7 +1005,12 @@ public class Config {
try {
list.add(new Priori<T>(cnst.newInstance(access),priority));
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- access.printf(Level.ERROR, "%s cannot be constructed with Access.\n",clssn);
+ String hostname = access.getProperty(Config.HOSTNAME,null);
+ if(hostname==null) {
+ access.printf(Level.ERROR, "%s cannot be constructed on this machine. Set valid 'hostname' in your properties\n",clssn);
+ } else {
+ access.printf(Level.ERROR, "%s cannot be constructed on %s with Access.\n",clssn, hostname);
+ }
}
} catch (NoSuchMethodException | SecurityException e) {
access.printf(Level.ERROR, "%s needs a Constructor taking Access as sole param.\n",clssn);