Remove critical code smells for servlet classes 45/87345/4
authoreconwar <conor.ward@est.tech>
Tue, 14 May 2019 15:16:56 +0000 (15:16 +0000)
committereconwar <conor.ward@est.tech>
Tue, 14 May 2019 15:16:56 +0000 (15:16 +0000)
Change-Id: I691787741b84de630cbd80c4c887c89c99f662f5
Issue-ID: DMAAP-1195
Signed-off-by: econwar <conor.ward@est.tech>
15 files changed:
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/BaseServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/DRFeedsServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/FeedServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/GroupServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/InternalServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/ProxyServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/PublishServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/RouteServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/StatisticsServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServlet.java
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SynchronizerTask.java

index deb78b1..66a7c36 100755 (executable)
@@ -287,7 +287,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             loopback = InetAddress.getLoopbackAddress();
             //checkHttpsRelaxation(); //Data Router Subscriber HTTPS Relaxation feature USERSTORYID:US674047.
         } catch (UnknownHostException e) {
             loopback = InetAddress.getLoopbackAddress();
             //checkHttpsRelaxation(); //Data Router Subscriber HTTPS Relaxation feature USERSTORYID:US674047.
         } catch (UnknownHostException e) {
-            // ignore
+            intlogger.info("BaseServlet.init: " + e.getMessage(), e);
         }
     }
 
         }
     }
 
@@ -380,7 +380,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 return "Unauthorized address: " + remote;
             }
         } catch (UnknownHostException e) {
                 return "Unauthorized address: " + remote;
             }
         } catch (UnknownHostException e) {
-            intlogger.error("PROV0051 BaseServlet.isAuthorizedForProvisioning: ", e.getMessage());
+            intlogger.error("PROV0051 BaseServlet.isAuthorizedForProvisioning: " + e.getMessage(), e);
             return "Unauthorized address: " + remote;
         }
         // Does remote have a valid certificate?
             return "Unauthorized address: " + remote;
         }
         // Does remote have a valid certificate?
@@ -429,7 +429,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 return true;
             }
         } catch (UnknownHostException e) {
                 return true;
             }
         } catch (UnknownHostException e) {
-            intlogger.error("PROV0052 BaseServlet.isAuthorizedForInternal: ", e.getMessage());
+            intlogger.error("PROV0052 BaseServlet.isAuthorizedForInternal: " + e.getMessage(), e);
         }
         return false;
     }
         }
         return false;
     }
@@ -473,7 +473,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 }
             }
         } catch (UnknownHostException e) {
                 }
             }
         } catch (UnknownHostException e) {
-            intlogger.error("PROV0053 BaseServlet.addressMatchesNetwork: ", e.getMessage());
+            intlogger.error("PROV0053 BaseServlet.addressMatchesNetwork: " + e.getMessage(), e);
             return false;
         }
         return true;
             return false;
         }
         return true;
@@ -519,7 +519,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             thisPod = InetAddress.getLocalHost().getHostName();
         } catch (UnknownHostException e) {
             thisPod = "";
             thisPod = InetAddress.getLocalHost().getHostName();
         } catch (UnknownHostException e) {
             thisPod = "";
-            intlogger.warn("PROV0014 Cannot determine the name of this provisioning server.");
+            intlogger.warn("PROV0014 Cannot determine the name of this provisioning server.", e);
         }
 
         // Normalize the nodes, and fill in nodeAddresses
         }
 
         // Normalize the nodes, and fill in nodeAddresses
@@ -530,7 +530,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 intlogger.debug("PROV0003 DNS lookup: " + nodes[i] + " => " + na[i].toString());
             } catch (UnknownHostException e) {
                 na[i] = null;
                 intlogger.debug("PROV0003 DNS lookup: " + nodes[i] + " => " + na[i].toString());
             } catch (UnknownHostException e) {
                 na[i] = null;
-                intlogger.warn("PROV0004 Cannot lookup " + nodes[i] + ": " + e.getMessage());
+                intlogger.warn("PROV0004 Cannot lookup " + nodes[i] + ": " + e.getMessage(), e);
             }
         }
 
             }
         }
 
@@ -558,7 +558,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 intlogger.debug("PROV0003 DNS lookup: " + pods[i] + " => " + na[i].toString());
             } catch (UnknownHostException e) {
                 na[i] = null;
                 intlogger.debug("PROV0003 DNS lookup: " + pods[i] + " => " + na[i].toString());
             } catch (UnknownHostException e) {
                 na[i] = null;
-                intlogger.warn("PROV0004 Cannot lookup " + pods[i] + ": " + e.getMessage());
+                intlogger.warn("PROV0004 Cannot lookup " + pods[i] + ": " + e.getMessage(), e);
             }
         }
         podAddresses = na;
             }
         }
         podAddresses = na;
@@ -584,7 +584,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             try (InputStream inStream = getClass().getClassLoader().getResourceAsStream(MAILCONFIG_FILE)) {
                 mailprops.load(inStream);
             } catch (IOException e) {
             try (InputStream inStream = getClass().getClassLoader().getResourceAsStream(MAILCONFIG_FILE)) {
                 mailprops.load(inStream);
             } catch (IOException e) {
-                intlogger.error("PROV9003 Opening properties: " + e.getMessage());
+                intlogger.error("PROV9003 Opening properties: " + e.getMessage(), e);
                 System.exit(1);
             }
         }
                 System.exit(1);
             }
         }
@@ -604,7 +604,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                 try {
                     notifyPSTeam(p.get("org.onap.dmaap.datarouter.provserver.https.relax.notify").toString());
                 } catch (Exception e) {
                 try {
                     notifyPSTeam(p.get("org.onap.dmaap.datarouter.provserver.https.relax.notify").toString());
                 } catch (Exception e) {
-                    intlogger.warn("Exception: " + e.getMessage());
+                    intlogger.warn("Exception: " + e.getMessage(), e);
                 }
             }
             mailSendFlag = true;
                 }
             }
             mailSendFlag = true;
@@ -617,7 +617,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
      * @param email - list of email ids to notify if HTTP relexcation is enabled.
      * @author vs215k
      **/
      * @param email - list of email ids to notify if HTTP relexcation is enabled.
      * @author vs215k
      **/
-    private void notifyPSTeam(String email) throws Exception {
+    private void notifyPSTeam(String email) {
         loadMailProperties(); //Load HTTPS Relex mail properties.
         String[] emails = email.split(Pattern.quote("|"));
 
         loadMailProperties(); //Load HTTPS Relex mail properties.
         String[] emails = email.split(Pattern.quote("|"));
 
@@ -653,7 +653,9 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             intlogger.info("HTTPS relaxation mail is sent to - : " + email);
 
         } catch (MessagingException e) {
             intlogger.info("HTTPS relaxation mail is sent to - : " + email);
 
         } catch (MessagingException e) {
-            intlogger.error("Invalid email address, unable to send https relaxation mail to - : " + email);
+            intlogger.error("Invalid email address, unable to send https relaxation mail to - : " + email, e);
+        } catch (UnknownHostException uhe) {
+            intlogger.error("UnknownHostException", uhe);
         }
     }
 
         }
     }
 
@@ -748,7 +750,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             rv = bean.doInsert(conn);
         } catch (SQLException e) {
             rv = false;
             rv = bean.doInsert(conn);
         } catch (SQLException e) {
             rv = false;
-            intlogger.warn("PROV0005 doInsert: " + e.getMessage());
+            intlogger.warn("PROV0005 doInsert: " + e.getMessage(), e);
         } finally {
             if (conn != null) {
                 db.release(conn);
         } finally {
             if (conn != null) {
                 db.release(conn);
@@ -772,7 +774,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             rv = bean.doUpdate(conn);
         } catch (SQLException e) {
             rv = false;
             rv = bean.doUpdate(conn);
         } catch (SQLException e) {
             rv = false;
-            intlogger.warn("PROV0006 doUpdate: " + e.getMessage());
+            intlogger.warn("PROV0006 doUpdate: " + e.getMessage(), e);
         } finally {
             if (conn != null) {
                 db.release(conn);
         } finally {
             if (conn != null) {
                 db.release(conn);
@@ -796,7 +798,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             rv = bean.doDelete(conn);
         } catch (SQLException e) {
             rv = false;
             rv = bean.doDelete(conn);
         } catch (SQLException e) {
             rv = false;
-            intlogger.warn("PROV0007 doDelete: " + e.getMessage());
+            intlogger.warn("PROV0007 doDelete: " + e.getMessage(), e);
         } finally {
             if (conn != null) {
                 db.release(conn);
         } finally {
             if (conn != null) {
                 db.release(conn);
@@ -959,7 +961,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
                     return true;
                 }
             } catch (JSONException e) {
                     return true;
                 }
             } catch (JSONException e) {
-                intlogger.error("JSONException: " + e.getMessage());
+                intlogger.error("JSONException: " + e.getMessage(), e);
             }
         }
         return false;
             }
         }
         return false;
@@ -1048,7 +1050,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
             MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
         } catch (Exception e) {
             MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
             MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
         } catch (Exception e) {
-            intlogger.error("Exception: " + e.getMessage());
+            intlogger.error("Exception: " + e.getMessage(), e);
         }
 
     }
         }
 
     }
@@ -1091,7 +1093,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             }
             return type + "|" + aafInstance + "|" + action;
         } catch (Exception e) {
             }
             return type + "|" + aafInstance + "|" + action;
         } catch (Exception e) {
-            intlogger.error("PROV7005 BaseServlet.getFeedPermission: ", e.getMessage());
+            intlogger.error("PROV7005 BaseServlet.getFeedPermission: " + e.getMessage(), e);
         }
         return null;
     }
         }
         return null;
     }
@@ -1139,7 +1141,7 @@ public class BaseServlet extends HttpServlet implements ProvDataProvider {
             }
             return type + "|" + aafInstance + "|" + action;
         } catch (Exception e) {
             }
             return type + "|" + aafInstance + "|" + action;
         } catch (Exception e) {
-            intlogger.error("PROV7005 BaseServlet.getSubscriberPermission: ", e.getMessage());
+            intlogger.error("PROV7005 BaseServlet.getSubscriberPermission: " + e.getMessage(), e);
         }
         return null;
     }
         }
         return null;
     }
index 86e0268..058c762 100644 (file)
@@ -150,7 +150,7 @@ public class DRFeedsServlet extends ProxyServlet {
                     try {
                         resp.getOutputStream().print(feed.asJSONObject(true).toString());
                     } catch (IOException ioe) {
                     try {
                         resp.getOutputStream().print(feed.asJSONObject(true).toString());
                     } catch (IOException ioe) {
-                        eventlogger.error("IOException" + ioe.getMessage());
+                        eventlogger.error("PROV0111 DRFeedServlet.doGet " + ioe.getMessage(), ioe);
                     }
                 }
             } else {
                     }
                 }
             } else {
@@ -174,7 +174,7 @@ public class DRFeedsServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(t);
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(t);
                 } catch (IOException ioe) {
-                    eventlogger.error("IOException" + ioe.getMessage());
+                    eventlogger.error("PROV0112 DRFeedServlet.doGet " + ioe.getMessage(), ioe);
                 }
             }
         } finally {
                 }
             }
         } finally {
@@ -283,7 +283,7 @@ public class DRFeedsServlet extends ProxyServlet {
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
-                eventlogger.error(elr.toString());
+                eventlogger.error(elr.toString(), e);
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
@@ -365,7 +365,7 @@ public class DRFeedsServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(feed.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(feed.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
-                    eventlogger.error("IOException" + ioe.getMessage());
+                    eventlogger.error("PROV0113 DRFeedServlet.doPost " + ioe.getMessage(), ioe);
                 }
                 provisioningDataChanged();
             } else {
                 }
                 provisioningDataChanged();
             } else {
index 3cbaac3..4fc0b7f 100644 (file)
@@ -227,7 +227,7 @@ public class FeedServlet extends ProxyServlet {
             try {
                 resp.getOutputStream().print(feed.asJSONObject(true).toString());
             } catch (IOException ioe) {
             try {
                 resp.getOutputStream().print(feed.asJSONObject(true).toString());
             } catch (IOException ioe) {
-                eventlogger.error("IOException" + ioe.getMessage());
+                eventlogger.error("PROV0101 FeedServlet.doGet: " + ioe.getMessage(), ioe);
             }
         } finally {
             eelfLogger.info(EelfMsgs.EXIT);
             }
         } finally {
             eelfLogger.info(EelfMsgs.EXIT);
@@ -313,7 +313,7 @@ public class FeedServlet extends ProxyServlet {
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
-                eventlogger.error(elr.toString());
+                eventlogger.error(elr.toString(), e);
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
@@ -392,7 +392,7 @@ public class FeedServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(feed.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(feed.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
-                    eventlogger.error("IOException" + ioe.getMessage());
+                    eventlogger.error("PROV0102 FeedServlet.doPut: " + ioe.getMessage(), ioe);
                 }
 
 
                 }
 
 
@@ -405,7 +405,7 @@ public class FeedServlet extends ProxyServlet {
                             feed.changeOwnerShip();
                         }
                     } catch (JSONException je) {
                             feed.changeOwnerShip();
                         }
                     } catch (JSONException je) {
-                        eventlogger.error("JSONException" + je.getMessage());
+                        eventlogger.error("PROV0103 FeedServlet.doPut: " + je.getMessage(), je);
                     }
                 }
                 /***End of change ownership*/
                     }
                 }
                 /***End of change ownership*/
index 188dce6..5cd5481 100644 (file)
@@ -132,7 +132,7 @@ public class GroupServlet extends ProxyServlet {
         try {
             resp.getOutputStream().print(gup.asJSONObject().toString());
         } catch (IOException ioe) {
         try {
             resp.getOutputStream().print(gup.asJSONObject().toString());
         } catch (IOException ioe) {
-            eventlogger.error("IOException" + ioe.getMessage());
+            eventlogger.error("PROV0121 GroupServlet.doGet: " + ioe.getMessage(), ioe);
         }
 
         // Display a list of Groups
         }
 
         // Display a list of Groups
@@ -230,7 +230,7 @@ public class GroupServlet extends ProxyServlet {
             message = e.getMessage();
             elr.setMessage(message);
             elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
             message = e.getMessage();
             elr.setMessage(message);
             elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
-            eventlogger.error(elr.toString());
+            eventlogger.error(elr.toString(), e);
             sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
             return;
         }
             sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
             return;
         }
@@ -253,7 +253,7 @@ public class GroupServlet extends ProxyServlet {
             try {
                 resp.getOutputStream().print(gup.asJSONObject().toString());
             } catch (IOException ioe) {
             try {
                 resp.getOutputStream().print(gup.asJSONObject().toString());
             } catch (IOException ioe) {
-                eventlogger.error("IOException" + ioe.getMessage());
+                eventlogger.error("PROV0122 GroupServlet.doPut: " + ioe.getMessage(), ioe);
             }
             provisioningDataChanged();
         } else {
             }
             provisioningDataChanged();
         } else {
@@ -352,7 +352,7 @@ public class GroupServlet extends ProxyServlet {
             message = e.getMessage();
             elr.setMessage(message);
             elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
             message = e.getMessage();
             elr.setMessage(message);
             elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
-            eventlogger.error(elr.toString());
+            eventlogger.error(elr.toString(), e);
             sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
             return;
         }
             sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
             return;
         }
@@ -379,7 +379,7 @@ public class GroupServlet extends ProxyServlet {
             try {
                 resp.getOutputStream().print(gup.asJSONObject().toString());
             } catch (IOException ioe) {
             try {
                 resp.getOutputStream().print(gup.asJSONObject().toString());
             } catch (IOException ioe) {
-                eventlogger.error("IOException" + ioe.getMessage());
+                eventlogger.error("PROV0122 GroupServlet.doPost: " + ioe.getMessage(), ioe);
             }
             provisioningDataChanged();
         } else {
             }
             provisioningDataChanged();
         } else {
index 56b40e0..005acad 100644 (file)
@@ -268,7 +268,7 @@ public class InternalServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(p.getProvisioningString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(p.getProvisioningString());
                 } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                    intlogger.error("PROV0131 InternalServlet.doGet: " + ioe.getMessage(), ioe);
                 }
                 return;
             }
                 }
                 return;
             }
@@ -278,7 +278,7 @@ public class InternalServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(generateLogfileList().toString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(generateLogfileList().toString());
                 } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                    intlogger.error("PROV0132 InternalServlet.doGet: " + ioe.getMessage(), ioe);
                 }
                 return;
             }
                 }
                 return;
             }
@@ -294,7 +294,7 @@ public class InternalServlet extends ProxyServlet {
                         try {
                             Files.copy(logpath, resp.getOutputStream());
                         } catch (IOException ioe) {
                         try {
                             Files.copy(logpath, resp.getOutputStream());
                         } catch (IOException ioe) {
-                            intlogger.error("IOException" + ioe.getMessage());
+                            intlogger.error("PROV0133 InternalServlet.doGet: " + ioe.getMessage(), ioe);
                         }
                         return;
                     }
                         }
                         return;
                     }
@@ -316,7 +316,7 @@ public class InternalServlet extends ProxyServlet {
                         try {
                             resp.getOutputStream().print(param.getValue() + "\n");
                         } catch (IOException ioe) {
                         try {
                             resp.getOutputStream().print(param.getValue() + "\n");
                         } catch (IOException ioe) {
-                            intlogger.error("IOException" + ioe.getMessage());
+                            intlogger.error("PROV0134 InternalServlet.doGet: " + ioe.getMessage(), ioe);
                         }
                         return;
                     }
                         }
                         return;
                     }
@@ -330,7 +330,7 @@ public class InternalServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(lfl.getBitSet().toString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(lfl.getBitSet().toString());
                 } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                    intlogger.error("PROV0135 InternalServlet.doGet: " + ioe.getMessage(), ioe);
                 }
                 return;
             }
                 }
                 return;
             }
@@ -477,12 +477,13 @@ public class InternalServlet extends ProxyServlet {
                         total += store.getTotalSpace();
                         avail += store.getUsableSpace();
                     } catch (IOException ioe) {
                         total += store.getTotalSpace();
                         avail += store.getUsableSpace();
                     } catch (IOException ioe) {
-                        intlogger.error("IOException" + ioe.getMessage());
+                        intlogger.error("PROV0136 InternalServlet.doPost: " + ioe.getMessage(), ioe);
                     }
                 }
                 try {
                     fs.close();
                 } catch (Exception e) {
                     }
                 }
                 try {
                     fs.close();
                 } catch (Exception e) {
+                    intlogger.error("PROV0137 InternalServlet.doPost: " + e.getMessage(), e);
                 }
                 if (((avail * 100) / total) < 5) {
                     elr.setResult(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
                 }
                 if (((avail * 100) / total) < 5) {
                     elr.setResult(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
@@ -500,7 +501,7 @@ public class InternalServlet extends ProxyServlet {
                     eventlogger.info(elr.toString());
                     LogfileLoader.getLoader();    // This starts the logfile loader "task"
                 } catch (IOException ioe) {
                     eventlogger.info(elr.toString());
                     LogfileLoader.getLoader();    // This starts the logfile loader "task"
                 } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                    intlogger.error("PROV0138 InternalServlet.doPost: " + ioe.getMessage(), ioe);
                 }
                 return;
             }
                 }
                 return;
             }
@@ -529,7 +530,7 @@ public class InternalServlet extends ProxyServlet {
                     LogRecord.printLogRecords(resp.getOutputStream(), bs);
                     eventlogger.info(elr.toString());
                 } catch (IOException ioe) {
                     LogRecord.printLogRecords(resp.getOutputStream(), bs);
                     eventlogger.info(elr.toString());
                 } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                    intlogger.error("PROV0139 InternalServlet.doPost: " + ioe.getMessage(), ioe);
                 }
                 return;
             }
                 }
                 return;
             }
index 77bcbdd..74441da 100644 (file)
@@ -226,7 +226,7 @@ public class LogServlet extends BaseServlet {
                 }\r
                 out.print("]");\r
             } catch (IOException ioe) {\r
                 }\r
                 out.print("]");\r
             } catch (IOException ioe) {\r
-                eventlogger.error("IOException: " + ioe.getMessage());\r
+                eventlogger.error("PROV0141 LogServlet.doGet: " + ioe.getMessage(), ioe);\r
             }\r
         } finally {\r
             eelfLogger.info(EelfMsgs.EXIT);\r
             }\r
         } finally {\r
             eelfLogger.info(EelfMsgs.EXIT);\r
index a0d8664..7c693bd 100644 (file)
@@ -102,7 +102,7 @@ public class Main {
             try {
                 in = getClass().getClassLoader().getResourceAsStream("drProvCadi.properties");
             } catch (Exception e) {
             try {
                 in = getClass().getClassLoader().getResourceAsStream("drProvCadi.properties");
             } catch (Exception e) {
-                intlogger.error("Exception in Main.getCadiProps() method ", e.getMessage());
+                intlogger.error("Exception in Main.getCadiProps(): " + e.getMessage(), e);
             }
             return in;
         }
             }
             return in;
         }
@@ -247,8 +247,8 @@ public class Main {
                         Inner obj = new Main().new Inner();
                         InputStream in = obj.getCadiProps();
                         cadiProperties.load(in);
                         Inner obj = new Main().new Inner();
                         InputStream in = obj.getCadiProps();
                         cadiProperties.load(in);
-                    } catch (IOException e1) {
-                        intlogger.error("PROV0001 Exception loading CADI properties", e1.getMessage());
+                    } catch (IOException ioe) {
+                        intlogger.error("PROV0001 Exception loading CADI properties: " + ioe.getMessage(), ioe);
                     }
                     cadiProperties.setProperty("aaf_locate_url", provProperties.getProperty("org.onap.dmaap.datarouter.provserver.cadi.aaf.url", "https://aaf-onap-test.osaaf.org:8095"));
                     intlogger.info("PROV0001  aaf_url set to - " + cadiProperties.getProperty("aaf_url"));
                     }
                     cadiProperties.setProperty("aaf_locate_url", provProperties.getProperty("org.onap.dmaap.datarouter.provserver.cadi.aaf.url", "https://aaf-onap-test.osaaf.org:8095"));
                     intlogger.info("PROV0001  aaf_url set to - " + cadiProperties.getProperty("aaf_url"));
@@ -281,7 +281,7 @@ public class Main {
             server.start();
             intlogger.info("Prov Server started-" + server.getState());
         } catch (Exception e) {
             server.start();
             intlogger.info("Prov Server started-" + server.getState());
         } catch (Exception e) {
-            intlogger.info("Jetty failed to start. Reporting will we unavailable", e.getMessage());
+            intlogger.info("Jetty failed to start. Reporting will we unavailable: " + e.getMessage(), e);
         }
         server.join();
         intlogger.info("PROV0001 **** AT&T Data Router Provisioning Server halted.");
         }
         server.join();
         intlogger.info("PROV0001 **** AT&T Data Router Provisioning Server halted.");
@@ -302,7 +302,7 @@ public class Main {
                 Thread.sleep(5000L);
                 System.exit(0);
             } catch (Exception e) {
                 Thread.sleep(5000L);
                 System.exit(0);
             } catch (Exception e) {
-                intlogger.error("Exception in Main.shutdown() method " + e.getMessage());
+                intlogger.error("Exception in Main.shutdown(): " + e.getMessage(), e);
             }
         });
     }
             }
         });
     }
index b9d5e7a..6177df2 100644 (file)
@@ -85,7 +85,7 @@ public class Poker extends TimerTask {
             thisPod = InetAddress.getLocalHost().getHostName();\r
         } catch (UnknownHostException e) {\r
             thisPod = "*UNKNOWN*"; // not a major problem\r
             thisPod = InetAddress.getLocalHost().getHostName();\r
         } catch (UnknownHostException e) {\r
             thisPod = "*UNKNOWN*"; // not a major problem\r
-            logger.info("UnknownHostException: Setting thisPod to \"*UNKNOWN*\"");\r
+            logger.info("UnknownHostException: Setting thisPod to \"*UNKNOWN*\"", e);\r
         }\r
         provString = buildProvisioningString();\r
 \r
         }\r
         provString = buildProvisioningString();\r
 \r
@@ -195,10 +195,10 @@ public class Poker extends TimerTask {
             } catch (MalformedURLException e) {\r
                 logger.warn(\r
                         "PROV0013 MalformedURLException Error poking node at " + nodeUrl + " : " + e\r
             } catch (MalformedURLException e) {\r
                 logger.warn(\r
                         "PROV0013 MalformedURLException Error poking node at " + nodeUrl + " : " + e\r
-                                .getMessage());\r
+                                .getMessage(), e);\r
             } catch (IOException e) {\r
                 logger.warn("PROV0013 IOException Error poking node at " + nodeUrl + " : " + e\r
             } catch (IOException e) {\r
                 logger.warn("PROV0013 IOException Error poking node at " + nodeUrl + " : " + e\r
-                        .getMessage());\r
+                        .getMessage(), e);\r
             }\r
         };\r
         r.run();\r
             }\r
         };\r
         r.run();\r
index 67a74de..96dae25 100755 (executable)
@@ -101,7 +101,7 @@ public class ProxyServlet extends BaseServlet {
             sch = new Scheme("https", 443, socketFactory);
             inited = true;
         } catch (Exception e) {
             sch = new Scheme("https", 443, socketFactory);
             inited = true;
         } catch (Exception e) {
-            intlogger.error("ProxyServlet: " + e.getMessage());
+            intlogger.error("ProxyServlet.init: " + e.getMessage(), e);
         }
         intlogger.info("ProxyServlet: inited = " + inited);
     }
         }
         intlogger.info("ProxyServlet: inited = " + inited);
     }
@@ -111,7 +111,7 @@ public class ProxyServlet extends BaseServlet {
         try (FileInputStream instream = new FileInputStream(new File(store))) {
             ks.load(instream, pass.toCharArray());
         } catch (FileNotFoundException fileNotFoundException) {
         try (FileInputStream instream = new FileInputStream(new File(store))) {
             ks.load(instream, pass.toCharArray());
         } catch (FileNotFoundException fileNotFoundException) {
-            intlogger.error("ProxyServlet: " + fileNotFoundException.getMessage());
+            intlogger.error("ProxyServlet.readStore: " + fileNotFoundException.getMessage(), fileNotFoundException);
         } catch (Exception x) {
             intlogger.error("READING TRUSTSTORE: " + x);
         }
         } catch (Exception x) {
             intlogger.error("READING TRUSTSTORE: " + x);
         }
@@ -211,7 +211,7 @@ public class ProxyServlet extends BaseServlet {
                     rv = true;
 
                 } catch (IOException e) {
                     rv = true;
 
                 } catch (IOException e) {
-                    intlogger.error("ProxyServlet: " + e.getMessage());
+                    intlogger.error("ProxyServlet.doGetWithFallback: " + e.getMessage(), e);
                 } finally {
                     proxy.releaseConnection();
                     httpclient.getConnectionManager().shutdown();
                 } finally {
                     proxy.releaseConnection();
                     httpclient.getConnectionManager().shutdown();
@@ -250,7 +250,7 @@ public class ProxyServlet extends BaseServlet {
                     copyResponseHeaders(pxyResponse, resp);
                     copyEntityContent(pxyResponse, resp);
                 } catch (IOException e) {
                     copyResponseHeaders(pxyResponse, resp);
                     copyEntityContent(pxyResponse, resp);
                 } catch (IOException e) {
-                    intlogger.warn("ProxyServlet: " + e.getMessage());
+                    intlogger.warn("ProxyServlet.doProxy: " + e.getMessage(), e);
                     sendResponseError(resp, HttpServletResponse.SC_SERVICE_UNAVAILABLE, "", intlogger);
                 } finally {
                     proxy.releaseConnection();
                     sendResponseError(resp, HttpServletResponse.SC_SERVICE_UNAVAILABLE, "", intlogger);
                 } finally {
                     proxy.releaseConnection();
@@ -300,7 +300,7 @@ public class ProxyServlet extends BaseServlet {
             try (InputStream in = entity.getContent()) {
                 IOUtils.copy(in, resp.getOutputStream());
             } catch (Exception e) {
             try (InputStream in = entity.getContent()) {
                 IOUtils.copy(in, resp.getOutputStream());
             } catch (Exception e) {
-                intlogger.error("Exception: " + e.getMessage());
+                intlogger.error("ProxyServlet.copyEntityContent: " + e.getMessage(), e);
             }
         }
     }
             }
         }
     }
index 76a983f..2ef5087 100644 (file)
@@ -169,7 +169,7 @@ public class PublishServlet extends BaseServlet {
                 }\r
             }\r
         } catch (IOException ioe) {\r
                 }\r
             }\r
         } catch (IOException ioe) {\r
-            intlogger.error("IOException" + ioe.getMessage());\r
+            intlogger.error("PROV0151 PublishServlet.redirect: " + ioe.getMessage(), ioe);\r
         }\r
     }\r
 \r
         }\r
     }\r
 \r
@@ -235,6 +235,7 @@ public class PublishServlet extends BaseServlet {
             }\r
             return -1;\r
         } catch (NumberFormatException | JSONException e) {\r
             }\r
             return -1;\r
         } catch (NumberFormatException | JSONException e) {\r
+            intlogger.debug("PROV0152 PublishServlet.checkPath: " + e.getMessage(), e);\r
             return -1;\r
         }\r
     }\r
             return -1;\r
         }\r
     }\r
index 4dd422a..176cef5 100644 (file)
@@ -208,7 +208,9 @@ public class RouteServlet extends ProxyServlet {
                     );\r
                     d = new Deleteable[] { nr };\r
                 } catch (IllegalArgumentException e) {\r
                     );\r
                     d = new Deleteable[] { nr };\r
                 } catch (IllegalArgumentException e) {\r
-                    sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, "The specified network route does not exist.", eventlogger);\r
+                    String message = "The specified network route does not exist.";\r
+                    eventlogger.error(message, e);\r
+                    sendResponseError(resp, HttpServletResponse.SC_NOT_FOUND, message, eventlogger);\r
                     return;\r
                 }\r
             } else {\r
                     return;\r
                 }\r
             } else {\r
@@ -289,7 +291,7 @@ public class RouteServlet extends ProxyServlet {
                     try {\r
                         sb.append("\"").append(jx.getString(key)).append("\"");\r
                     } catch (JSONException je) {\r
                     try {\r
                         sb.append("\"").append(jx.getString(key)).append("\"");\r
                     } catch (JSONException je) {\r
-                        eventlogger.error("JSONException" + je.getMessage());\r
+                        eventlogger.error("PROV0161 RouteServlet.doGet: " + je.getMessage(), je);\r
                     }\r
                     pfx = ",\n";\r
                 }\r
                     }\r
                     pfx = ",\n";\r
                 }\r
@@ -315,7 +317,7 @@ public class RouteServlet extends ProxyServlet {
         try {\r
             resp.getOutputStream().print(sb.toString());\r
         } catch (IOException ioe) {\r
         try {\r
             resp.getOutputStream().print(sb.toString());\r
         } catch (IOException ioe) {\r
-            eventlogger.error("IOException" + ioe.getMessage());\r
+            eventlogger.error("PROV0162 RouteServlet.doGet: " + ioe.getMessage(), ioe);\r
         }\r
     }\r
     /**\r
         }\r
     }\r
     /**\r
@@ -368,7 +370,7 @@ public class RouteServlet extends ProxyServlet {
                 int seq = (t != null) ? Integer.parseInt(t) : (IngressRoute.getMaxSequence() + 100);\r
                 ins = new Insertable[] { new IngressRoute(seq, feedid, user, subnet, NodeClass.lookupNodeNames(nodepatt)) };\r
             } catch (Exception e) {\r
                 int seq = (t != null) ? Integer.parseInt(t) : (IngressRoute.getMaxSequence() + 100);\r
                 ins = new Insertable[] { new IngressRoute(seq, feedid, user, subnet, NodeClass.lookupNodeNames(nodepatt)) };\r
             } catch (Exception e) {\r
-                intlogger.info(e.toString());\r
+                intlogger.info(e.toString(), e);\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add ingress' command.", intlogger);\r
                 return;\r
             }\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add ingress' command.", intlogger);\r
                 return;\r
             }\r
@@ -384,7 +386,7 @@ public class RouteServlet extends ProxyServlet {
                 String node = NodeClass.normalizeNodename(req.getParameter("node"));\r
                 ins = new Insertable[] { new EgressRoute(subid, node) };\r
             } catch (Exception e) {\r
                 String node = NodeClass.normalizeNodename(req.getParameter("node"));\r
                 ins = new Insertable[] { new EgressRoute(subid, node) };\r
             } catch (Exception e) {\r
-                intlogger.info(e.toString());\r
+                intlogger.info(e.toString(), e);\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add egress' command.", intlogger);\r
                 return;\r
             }\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add egress' command.", intlogger);\r
                 return;\r
             }\r
@@ -410,7 +412,7 @@ public class RouteServlet extends ProxyServlet {
                 }\r
                 ins = new Insertable[] { nr };\r
             } catch (IllegalArgumentException e) {\r
                 }\r
                 ins = new Insertable[] { nr };\r
             } catch (IllegalArgumentException e) {\r
-                intlogger.info(e.toString());\r
+                intlogger.info(e.toString(), e);\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add network' command.", intlogger);\r
                 return;\r
             }\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, "Invalid arguments in 'add network' command.", intlogger);\r
                 return;\r
             }\r
index 34ba5d3..5fa7e16 100755 (executable)
@@ -98,7 +98,7 @@ public class StatisticsServlet extends BaseServlet {
       try {\r
         resp.getOutputStream().print("Invalid request, Feedid or Group ID is required.");\r
       } catch (IOException ioe) {\r
       try {\r
         resp.getOutputStream().print("Invalid request, Feedid or Group ID is required.");\r
       } catch (IOException ioe) {\r
-        eventlogger.error("IOException: " + ioe.getMessage());\r
+        eventlogger.error("PROV0171 StatisticsServlet.doGet: " + ioe.getMessage(), ioe);\r
       }\r
     }\r
 \r
       }\r
     }\r
 \r
@@ -110,35 +110,22 @@ public class StatisticsServlet extends BaseServlet {
       StringBuffer groupid1 = new StringBuffer();\r
 \r
       try {\r
       StringBuffer groupid1 = new StringBuffer();\r
 \r
       try {\r
-        System.out.println("feeedidsssssssss");\r
         groupid1 = this.getFeedIdsByGroupId(Integer.parseInt(req.getParameter("groupid")));\r
         groupid1 = this.getFeedIdsByGroupId(Integer.parseInt(req.getParameter("groupid")));\r
-        System.out.println("feeedids" + req.getParameter("groupid"));\r
-\r
         map.put("feedids", groupid1.toString());\r
         map.put("feedids", groupid1.toString());\r
-        System.out.println("groupid1" + groupid1.toString());\r
-\r
-\r
       } catch (NumberFormatException | SQLException e) {\r
       } catch (NumberFormatException | SQLException e) {\r
-        eventlogger.error(e.getMessage());\r
+        eventlogger.error("PROV0172 StatisticsServlet.doGet: " + e.getMessage(), e);\r
       }\r
     }\r
     if (req.getParameter("groupid") != null && req.getParameter("feedid") != null) {\r
       StringBuffer groupid1 = new StringBuffer();\r
 \r
       try {\r
       }\r
     }\r
     if (req.getParameter("groupid") != null && req.getParameter("feedid") != null) {\r
       StringBuffer groupid1 = new StringBuffer();\r
 \r
       try {\r
-        System.out.println("both r not null");\r
         groupid1 = this.getFeedIdsByGroupId(Integer.parseInt(req.getParameter("groupid")));\r
         groupid1 = this.getFeedIdsByGroupId(Integer.parseInt(req.getParameter("groupid")));\r
-        System.out.println("feeedids" + req.getParameter("groupid"));\r
         groupid1.append(",");\r
         groupid1.append(req.getParameter("feedid").replace("|", ",").toString());\r
         groupid1.append(",");\r
         groupid1.append(req.getParameter("feedid").replace("|", ",").toString());\r
-\r
         map.put("feedids", groupid1.toString());\r
         map.put("feedids", groupid1.toString());\r
-\r
-        System.out.println("groupid1" + groupid1.toString());\r
-\r
-\r
       } catch (NumberFormatException | SQLException e) {\r
       } catch (NumberFormatException | SQLException e) {\r
-        eventlogger.error(e.getMessage());\r
+        eventlogger.error("PROV0173 StatisticsServlet.doGet: " + e.getMessage(), e);\r
       }\r
     }\r
 \r
       }\r
     }\r
 \r
@@ -182,7 +169,7 @@ public class StatisticsServlet extends BaseServlet {
     try {\r
       this.getRecordsForSQL(map, outputType, resp.getOutputStream(), resp);\r
     } catch (IOException ioe) {\r
     try {\r
       this.getRecordsForSQL(map, outputType, resp.getOutputStream(), resp);\r
     } catch (IOException ioe) {\r
-      eventlogger.error("IOException: " + ioe.getMessage());\r
+      eventlogger.error("PROV0174 StatisticsServlet.doGet: " +  ioe.getMessage(), ioe);\r
     }\r
 \r
   }\r
     }\r
 \r
   }\r
@@ -291,7 +278,7 @@ public class StatisticsServlet extends BaseServlet {
           System.out.println("feedIds" + feedIds.toString());\r
       }\r
     } catch (SQLException e) {\r
           System.out.println("feedIds" + feedIds.toString());\r
       }\r
     } catch (SQLException e) {\r
-      eventlogger.error(e.getMessage());\r
+      eventlogger.error("PROV0175 StatisticsServlet.getFeedIdsByGroupId: " + e.getMessage(), e);\r
     } finally {\r
       try {\r
         if (resultSet != null) {\r
     } finally {\r
       try {\r
         if (resultSet != null) {\r
@@ -302,7 +289,7 @@ public class StatisticsServlet extends BaseServlet {
           db.release(conn);\r
         }\r
       } catch (Exception e) {\r
           db.release(conn);\r
         }\r
       } catch (Exception e) {\r
-        eventlogger.error(e.getMessage());\r
+        eventlogger.error("PROV0176 StatisticsServlet.getFeedIdsByGroupId: " + e.getMessage(), e);\r
       }\r
     }\r
     return feedIds;\r
       }\r
     }\r
     return feedIds;\r
index 69451a3..ef3555b 100644 (file)
@@ -140,7 +140,7 @@ public class SubscribeServlet extends ProxyServlet {
             try {
                 resp.getOutputStream().print(t);
             } catch (IOException ioe) {
             try {
                 resp.getOutputStream().print(t);
             } catch (IOException ioe) {
-                eventlogger.error("IOException: " + ioe.getMessage());
+                eventlogger.error("PROV0181 SubscribeServlet.doGet: " + ioe.getMessage(), ioe);
             }
         } finally {
             eelfLogger.info(EelfMsgs.EXIT);
             }
         } finally {
             eelfLogger.info(EelfMsgs.EXIT);
@@ -258,7 +258,7 @@ public class SubscribeServlet extends ProxyServlet {
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
                 message = e.getMessage();
                 elr.setMessage(message);
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);
-                eventlogger.error(elr.toString());
+                eventlogger.error(elr.toString(), e);
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
                 return;
             }
@@ -341,7 +341,7 @@ public class SubscribeServlet extends ProxyServlet {
                 try {
                     resp.getOutputStream().print(sub.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
                 try {
                     resp.getOutputStream().print(sub.asLimitedJSONObject().toString());
                 } catch (IOException ioe) {
-                    eventlogger.error("IOException: " + ioe.getMessage());
+                    eventlogger.error("PROV0182 SubscribeServlet.doPost: " + ioe.getMessage(), ioe);
                 }
 
                 provisioningDataChanged();
                 }
 
                 provisioningDataChanged();
index 63ff84d..ff3ed3c 100644 (file)
@@ -233,7 +233,7 @@ public class SubscriptionServlet extends ProxyServlet {
             try {\r
                 resp.getOutputStream().print(sub.asJSONObject(true).toString());\r
             } catch (IOException ioe) {\r
             try {\r
                 resp.getOutputStream().print(sub.asJSONObject(true).toString());\r
             } catch (IOException ioe) {\r
-                eventlogger.error("IOException: " + ioe.getMessage());\r
+                eventlogger.error("PROV0191 SubscriptionServlet.doGet: " + ioe.getMessage(), ioe);\r
             }\r
         } finally {\r
             eelfLogger.info(EelfMsgs.EXIT);\r
             }\r
         } finally {\r
             eelfLogger.info(EelfMsgs.EXIT);\r
@@ -320,7 +320,7 @@ public class SubscriptionServlet extends ProxyServlet {
                 message = e.getMessage();\r
                 elr.setMessage(message);\r
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);\r
                 message = e.getMessage();\r
                 elr.setMessage(message);\r
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);\r
-                eventlogger.error(elr.toString());\r
+                eventlogger.error(elr.toString(), e);\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);\r
                 return;\r
             }\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);\r
                 return;\r
             }\r
@@ -380,7 +380,7 @@ public class SubscriptionServlet extends ProxyServlet {
                 try {\r
                     resp.getOutputStream().print(sub.asLimitedJSONObject().toString());\r
                 } catch (IOException ioe) {\r
                 try {\r
                     resp.getOutputStream().print(sub.asLimitedJSONObject().toString());\r
                 } catch (IOException ioe) {\r
-                    eventlogger.error("IOException: " + ioe.getMessage());\r
+                    eventlogger.error("PROV0192 SubscriptionServlet.doPut: " + ioe.getMessage(), ioe);\r
                 }\r
 \r
                 /**Change Owner ship of Subscriber     Adding for group feature:Rally US708115*/\r
                 }\r
 \r
                 /**Change Owner ship of Subscriber     Adding for group feature:Rally US708115*/\r
@@ -392,7 +392,7 @@ public class SubscriptionServlet extends ProxyServlet {
                             sub.changeOwnerShip();\r
                         }\r
                     } catch (JSONException je) {\r
                             sub.changeOwnerShip();\r
                         }\r
                     } catch (JSONException je) {\r
-                        eventlogger.error("JSONException: " + je.getMessage());\r
+                        eventlogger.error("PROV0193 SubscriptionServlet.doPut: " + je.getMessage(), je);\r
                     }\r
                 }\r
                 /***End of change ownership*/\r
                     }\r
                 }\r
                 /***End of change ownership*/\r
@@ -499,7 +499,7 @@ public class SubscriptionServlet extends ProxyServlet {
                 message = "Badly formed JSON";\r
                 elr.setMessage(message);\r
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);\r
                 message = "Badly formed JSON";\r
                 elr.setMessage(message);\r
                 elr.setResult(HttpServletResponse.SC_BAD_REQUEST);\r
-                eventlogger.error(elr.toString());\r
+                eventlogger.error(elr.toString(), e);\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);\r
             }\r
         } finally {\r
                 sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);\r
             }\r
         } finally {\r
@@ -538,11 +538,11 @@ public class SubscriptionServlet extends ProxyServlet {
                         conn.getContentLength();    // Force the GET through\r
                         conn.disconnect();\r
                     } catch (IOException e) {\r
                         conn.getContentLength();    // Force the GET through\r
                         conn.disconnect();\r
                     } catch (IOException e) {\r
-                        intlogger.info("IOException Error accessing URL: " + u + ": " + e.getMessage());\r
+                        intlogger.info("PROV0194 Error accessing URL: " + u + ": " + e.getMessage(), e);\r
                     }\r
                 }\r
             } catch (Exception e) {\r
                     }\r
                 }\r
             } catch (Exception e) {\r
-                intlogger.warn("Caught exception in SubscriberNotifyThread: " + e.getMessage());\r
+                intlogger.warn("PROV0195 Caught exception in SubscriberNotifyThread: " + e.getMessage(), e);\r
             }\r
         }\r
     }\r
             }\r
         }\r
     }\r
index 3097a9d..6552645 100644 (file)
@@ -312,7 +312,7 @@ public class SynchronizerTask extends TimerTask {
                 logger.warn("PROV5003: My name (" + thisPod + ") is missing from the list of provisioning servers.");
             }
         } catch (UnknownHostException e) {
                 logger.warn("PROV5003: My name (" + thisPod + ") is missing from the list of provisioning servers.");
             }
         } catch (UnknownHostException e) {
-            logger.warn("PROV5002: Cannot determine the name of this provisioning server.");
+            logger.warn("PROV5002: Cannot determine the name of this provisioning server.", e);
         }
 
         if (newstate != state) {
         }
 
         if (newstate != state) {
@@ -334,7 +334,7 @@ public class SynchronizerTask extends TimerTask {
                 Feed f = new Feed(ja.getJSONObject(n));
                 coll.add(f);
             } catch (Exception e) {
                 Feed f = new Feed(ja.getJSONObject(n));
                 coll.add(f);
             } catch (Exception e) {
-                logger.warn("PROV5004: Invalid object in feed: " + ja.optJSONObject(n));
+                logger.warn("PROV5004: Invalid object in feed: " + ja.optJSONObject(n), e);
             }
         }
         if (sync(coll, Feed.getAllFeeds())) {
             }
         }
         if (sync(coll, Feed.getAllFeeds())) {
@@ -355,7 +355,7 @@ public class SynchronizerTask extends TimerTask {
                 Subscription s = new Subscription(j);
                 coll.add(s);
             } catch (Exception e) {
                 Subscription s = new Subscription(j);
                 coll.add(s);
             } catch (Exception e) {
-                logger.warn("PROV5004: Invalid object in subscription: " + ja.optJSONObject(n));
+                logger.warn("PROV5004: Invalid object in subscription: " + ja.optJSONObject(n), e);
             }
         }
         if (sync(coll, Subscription.getAllSubscriptions())) {
             }
         }
         if (sync(coll, Subscription.getAllSubscriptions())) {
@@ -373,7 +373,7 @@ public class SynchronizerTask extends TimerTask {
                 Group g = new Group(ja.getJSONObject(n));
                 coll.add(g);
             } catch (Exception e) {
                 Group g = new Group(ja.getJSONObject(n));
                 coll.add(g);
             } catch (Exception e) {
-                logger.warn("PROV5004: Invalid object in subscription: " + ja.optJSONObject(n));
+                logger.warn("PROV5004: Invalid object in group: " + ja.optJSONObject(n), e);
             }
         }
         if (sync(coll, Group.getAllgroups())) {
             }
         }
         if (sync(coll, Group.getAllgroups())) {
@@ -392,9 +392,11 @@ public class SynchronizerTask extends TimerTask {
             try {
                 v = jo.getString(k);
             } catch (JSONException e) {
             try {
                 v = jo.getString(k);
             } catch (JSONException e) {
+                logger.warn("PROV5004: Invalid object in parameters: " + jo.optJSONObject(k), e);
                 try {
                     v = "" + jo.getInt(k);
                 } catch (JSONException e1) {
                 try {
                     v = "" + jo.getInt(k);
                 } catch (JSONException e1) {
+                    logger.warn("PROV5004: Invalid object in parameters: " + jo.optInt(k), e);
                     JSONArray ja = jo.getJSONArray(k);
                     for (int i = 0; i < ja.length(); i++) {
                         if (i > 0) {
                     JSONArray ja = jo.getJSONArray(k);
                     for (int i = 0; i < ja.length(); i++) {
                         if (i > 0) {
@@ -436,9 +438,9 @@ public class SynchronizerTask extends TimerTask {
                 EgressRoute er = new EgressRoute(sub, node);
                 coll.add(er);
             } catch (NumberFormatException e) {
                 EgressRoute er = new EgressRoute(sub, node);
                 coll.add(er);
             } catch (NumberFormatException e) {
-                logger.warn("PROV5004: Invalid subid in egress routes: " + key);
+                logger.warn("PROV5004: Invalid subid in egress routes: " + key, e);
             } catch (IllegalArgumentException e) {
             } catch (IllegalArgumentException e) {
-                logger.warn("PROV5004: Invalid node name in egress routes: " + key);
+                logger.warn("PROV5004: Invalid node name in egress routes: " + key, e);
             }
         }
         if (sync(coll, EgressRoute.getAllEgressRoutes())) {
             }
         }
         if (sync(coll, EgressRoute.getAllEgressRoutes())) {