Integrated notification manager with the latest changes (#33)
authornikchett <nikchett@iu.edu>
Thu, 14 Dec 2017 20:11:19 +0000 (15:11 -0500)
committerSuresh Marru <smarru@apache.org>
Thu, 14 Dec 2017 20:11:19 +0000 (15:11 -0500)
* Added cpi methods

* Adding cpi methods

* Adding new admin related project

* Update README

* synced with airavata dependencies

* VerifiedNotification Manager

* Added client for notification module

* Adding reviewer and admin client

* Removing redudant dependies

* Removing redudant dependies

* Removing redudant dependies

* Removing redudant dependies

* Adding change to the admin client

* Update README

* Integrating with the latest changes

15 files changed:
allocation-manager/Notification-Manager/Notification-Authenticator/src/main/java/org/apache/airavata/allocation/manager/notification/authenticator/NotificationDetails.java
allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification/receiver/NotificationReceiver.java
allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification/receiver/NotificationSender.java
allocation-manager/Notification-Manager/Notification-Receiver/src/main/resources/messages.properties
allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/sender/EmailNotificationMessage.java
allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/sender/MailNotification.java
allocation-manager/Notification-Manager/logs/airavata.log.2017-12-02 [new file with mode: 0644]
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/UserDetailRepository.java
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/server/AllocationManagerServerHandler.java
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/server/TestServer.java
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationManager.java
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationTestClient.java [new file with mode: 0644]
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/testClient.java
allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/service/cpi/AllocationRegistryService.java
allocation-manager/airavata-allocation-manager/logs/airavata.log.2017-12-03 [new file with mode: 0644]

index c61eb76..12496c5 100644 (file)
@@ -9,26 +9,33 @@ import org.apache.thrift.TException;
 
 public class NotificationDetails {
 
-       public NotificationInformation getRequestDetails(String projectID) {
-               NotificationInformation result = new NotificationInformation() ;
-               
-                try {
-                        AllocationManagerServerHandler obj  = new AllocationManagerServerHandler();
-                        //String status =  obj.getAllocationRequestStatus(projectID);
-                        
-                               List<String>senderList = new ArrayList<String>() ;
-               
-                               senderList.add(obj.getAllocationRequestUserName(projectID));
+       public NotificationInformation getRequestDetails(String projectID, String notificationType) {
+
+               NotificationInformation result = new NotificationInformation();
+
+               try {
+                       AllocationManagerServerHandler obj = new AllocationManagerServerHandler();
+                       List<String> senderList = new ArrayList<String>();
+
+                       if (notificationType.equals("NEW_REQUEST") || notificationType.equals("DELETE_REQUEST")) {
+                               senderList.add(obj.getAllocationRequestUserEmail(projectID));
                                senderList.add(obj.getAllocationManagerAdminEmail("ADMIN"));
-                               
-                       //result.setStatus(status);
+
+                       } else if (notificationType.equals("ASSIGN_REQUEST")) {
+                               senderList = obj.getEmailIdsOfReviewersForRequest(projectID);
+                       } else if (notificationType.equals("APPROVE_REQUEST")) {
+                               senderList.add(obj.getAllocationRequestUserEmail(projectID));
+                       } else if (notificationType.equals("DENY_REQUEST")) {
+                               senderList.add(obj.getAllocationRequestUserEmail(projectID));
+                       }
+
                        result.setSenderList(senderList);
 
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
-               
+
                return result;
        }
 }
index b07637f..e706639 100644 (file)
@@ -17,27 +17,26 @@ public class NotificationReceiver {
        public static void StartsimpleServer() {
                try {
 
-                       // Create a connection factory
                        ConnectionFactory factory = new ConnectionFactory();
-                       // Set the host to the location of the RabbitMQ server
                        factory.setHost("localHost");
-                       // Open a new connection
                        Connection connection = factory.newConnection();
-
                        Channel channel = connection.createChannel();
-
                        channel.queueDeclare("notify", false, false, false, null);
                        // Comfort logging
                        System.out.println("Waiting for notification");
-
                        Consumer consumer = new DefaultConsumer(channel) {
                                @Override
                                public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties,
                                                byte[] body) throws IOException {
-                                       String requestID = new String(body, "UTF-8");
+                                       String request = new String(body, "UTF-8");
+
+                                       String notificationDetails[] = request.split(",");
+                                       String projectId = notificationDetails[0];
+                                       String notificationType = notificationDetails[1];
 
-                                       NotificationInformation information = (new NotificationDetails()).getRequestDetails(requestID);
-                                       (new MailNotification()).sendMail(requestID, information.getStatus(), information.getSenderList());
+                                       NotificationInformation information = (new NotificationDetails()).getRequestDetails(projectId,
+                                                       notificationType);
+                                       (new MailNotification()).sendMail(projectId, notificationType, information.getSenderList(),projectId);
 
                                }
                        };
index 93bf473..d7c272c 100644 (file)
@@ -11,18 +11,14 @@ public class NotificationSender {
 
                try {
 
-                       // Create a connection factory
                        ConnectionFactory factory = new ConnectionFactory();
-                       // Set the host to the location of the RabbitMQ server
                        factory.setHost("localhost");
-                       // Open a new connection
                        Connection connection = factory.newConnection();
-                       // Channel is the abstraction for interacting with a queue
                        Channel channel = connection.createChannel();
-                       // Create the Queue if it does not exist
                        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
-                       // assuming this is the request id send
-                       String project_ID = "1001";
+
+                       // this is the project id and notification type that is sent 
+                       String project_ID = "1234,DENY_REQUEST";
 
                        channel.basicPublish("", QUEUE_NAME, null, project_ID.getBytes());
 
index b490727..0749ff3 100644 (file)
@@ -1,8 +1,11 @@
-SUBJECT_APPROVED=Request status
-MESSAGE_APPROVED=The request is approved
-SUBJECT_REJECTED=Request status
-MESSAGE_REJECTED=The request is rejected
+SUBJECT_APPROVED=Request is approved.
+MESSAGE_APPROVED=Your allocation request is approved
+SUBJECT_REJECTED=Request is rejected
+MESSAGE_REJECTED=Your allocation request is rejected
 SUBJECT_IN_PROCESS=Request status
 MESSAGE_IN_PROCESS=The new request has been submitted and request is being processed.
-SUBJECT_NEW_REQUEST=Request status
-MESSAGE_NEW_REQUEST=New request is submit
+SUBJECT_NEW_REQUEST=New request
+MESSAGE_NEW_REQUEST=A new request is submitted
+SUBJECT_ASSIGN_REQUEST=New request has been assigned for review
+MESSAGE_ASSIGN_REQUEST=You have been to assigned to review a request
+
index 06a1083..650e0cc 100644 (file)
@@ -7,7 +7,7 @@ import java.util.Properties;
 import org.apache.airavata.allocation.manager.notification.models.NotificationMessage;
 
 public class EmailNotificationMessage {
-       public NotificationMessage getEmailMessage(String status) {
+       public NotificationMessage getEmailMessage(String status, String projectID) {
                NotificationMessage result = new NotificationMessage();
                Properties prop = new Properties();
                InputStream input = null;
@@ -17,21 +17,29 @@ public class EmailNotificationMessage {
                        prop.load(input2);
 
                        switch (status) {
-                       case "APRROVED":
-                               result.setMessage(prop.getProperty("SUBJECT_APPROVED"));
-                               result.setSubject(prop.getProperty("MESSAGE_APPROVED"));
+                       case "APPROVE_REQUEST":
+                               result.setMessage(prop.getProperty("SUBJECT_APPROVED")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_APPROVED")+" "+projectID);
                                break;
-                       case "REJECTED":
-                               result.setMessage(prop.getProperty("SUBJECT_REJECTED"));
-                               result.setSubject(prop.getProperty("MESSAGE_REJECTED"));
+                       case "DENY_REQUEST":
+                               result.setMessage(prop.getProperty("SUBJECT_REJECTED")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_REJECTED")+" "+projectID);
                                break;
                        case "IN_PROGRESS":
-                               result.setMessage(prop.getProperty("SUBJECT_IN_PROCESS"));
-                               result.setSubject(prop.getProperty("MESSAGE_IN_PROCESS"));
+                               result.setMessage(prop.getProperty("SUBJECT_IN_PROCESS")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_IN_PROCESS")+" "+projectID);
                                break;
                        case "NEW_REQUEST":
-                               result.setMessage(prop.getProperty("SUBJECT_NEW_REQUEST"));
-                               result.setSubject(prop.getProperty("MESSAGE_NEW_REQUEST"));
+                               result.setMessage(prop.getProperty("SUBJECT_NEW_REQUEST")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_NEW_REQUEST")+" "+projectID);
+                               break;
+                       case "ASSIGN_REQUEST":
+                               result.setMessage(prop.getProperty("SUBJECT_ASSIGN_REQUEST")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_ASSIGN_REQUEST")+" "+projectID);
+                               break;
+                       case "DELETE_REQUEST":
+                               result.setMessage(prop.getProperty("SUBJECT_DELETE_REQUEST")+" "+projectID);
+                               result.setSubject(prop.getProperty("MESSAGE_DELETE_REQUEST")+" "+projectID);
                                break;
                        }
 
index f0102fb..10539b0 100644 (file)
@@ -11,7 +11,7 @@ import org.apache.commons.mail.SimpleEmail;
 public class MailNotification {
 
 
-       public void sendMail(String requestId, String status, List<String> senderList) {
+       public void sendMail(String requestId, String status, List<String> senderList, String projectId) {
 
                EmailNotificationMessage message = new EmailNotificationMessage();
                EmailNotificationConfiguration emailConfiguration = new EmailNotificationConfiguration();
@@ -19,8 +19,8 @@ public class MailNotification {
                String username = emailConfiguration.getCredentials().getUserName();
                String password = emailConfiguration.getCredentials().getPassword();
                
-               String subject = message.getEmailMessage(status).getSubject();
-               String body = message.getEmailMessage(status).getMessage();
+               String subject = message.getEmailMessage(status ,projectId).getSubject();
+               String body = message.getEmailMessage(status, projectId).getMessage();
                
                mail( username,  password,  subject,  body,  senderList);
 
@@ -48,5 +48,6 @@ public class MailNotification {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
+               System.out.println("Mail sent");
        }
 }
diff --git a/allocation-manager/Notification-Manager/logs/airavata.log.2017-12-02 b/allocation-manager/Notification-Manager/logs/airavata.log.2017-12-02
new file mode 100644 (file)
index 0000000..add960f
--- /dev/null
@@ -0,0 +1,1075 @@
+2017-12-02 16:32:07,894 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 16:32:09,334 [pool-1-thread-4] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 16:32:09,337 [pool-1-thread-4] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 16:38:04,185 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 17:37:16,558 [pool-1-thread-5] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 17:37:16,560 [pool-1-thread-5] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 17:39:30,454 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 17:39:43,716 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 17:50:49,125 [pool-1-thread-6] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 17:50:49,127 [pool-1-thread-6] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 17:56:48,880 [main] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 17:56:49,932 [main] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 17:56:49,934 [main] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.main(NotificationDetails.java:15)
+2017-12-02 18:18:48,188 [pool-1-thread-7] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 18:18:48,191 [pool-1-thread-7] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 18:37:41,789 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,799 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,790 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,793 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,853 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,861 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,879 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,884 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,933 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,833 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,969 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:37:41,979 [AMQP Connection 127.0.0.1:5672] WARN  c.r.c.i.ForgivingExceptionHandler  - An unexpected connection driver error occured (Exception message: Connection reset)
+2017-12-02 18:41:49,320 [pool-1-thread-11] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@68179149 (amq.ctag-RdbvM8GttyUvZP0j5sjDAA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.mail(MailNotification.java:41)
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.sendMail(MailNotification.java:25)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:40)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:00:02,200 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:06:22,622 [pool-1-thread-14] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 19:06:22,628 [pool-1-thread-14] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:08:04,387 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:08:10,436 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestStatus(AllocationManagerServerHandler.java:127)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:17)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:08:10,454 [pool-1-thread-11] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@713deb04 (amq.ctag-_ZgerZc_4Q9t1Dy84JEVLg) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:13:33,465 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:13:39,227 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestStatus(AllocationManagerServerHandler.java:127)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:17)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:20:05,963 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:21:13,658 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:21:19,479 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestStatus(AllocationManagerServerHandler.java:127)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:17)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:22:18,167 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:22:23,978 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestStatus(AllocationManagerServerHandler.java:127)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:17)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:26:37,068 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:26:42,905 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestStatus(AllocationManagerServerHandler.java:127)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:17)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:31:21,368 [pool-1-thread-11] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:31:27,445 [pool-1-thread-11] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestUserName(AllocationManagerServerHandler.java:150)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:21)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@18b4aac2, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:32:22,414 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:32:28,206 [pool-1-thread-4] ERROR o.a.a.a.m.s.AllocationManagerServerHandler  - Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
+       at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
+       at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1510)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
+       at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
+       at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
+       at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
+       at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
+       at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:959)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
+       at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
+       at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
+       at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.getEntityManager(JPAUtils.java:101)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.execute(AbstractRepository.java:153)
+       at org.apache.airavata.allocation.manager.db.repositories.AbstractRepository.get(AbstractRepository.java:88)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.getAllocationRequestUserName(AllocationManagerServerHandler.java:150)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:21)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
+       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
+       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
+       at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
+       at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
+       at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
+       ... 26 common frames omitted
+Caused by: java.sql.SQLException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
+       at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
+       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
+       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
+       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
+       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
+       at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
+       ... 31 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'sharing_catalog' with class loader sun.misc.Launcher$AppClassLoader@2a139a55, see the next exception for details.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
+       ... 47 common frames omitted
+Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /Users/nikithachettiar/Documents/IU_Fall17/ScienceGateway/Airavata/Forked_SandBox/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/sharing_catalog.
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
+       at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
+       at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
+       at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
+       at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
+       at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
+       at java.security.AccessController.doPrivileged(Native Method)
+       at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
+       ... 44 common frames omitted
+2017-12-02 19:36:06,723 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@7840cd98 (amq.ctag-ESWQYgo_b4BjnnuBt20CuA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.mail(MailNotification.java:41)
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.sendMail(MailNotification.java:25)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:38:31,246 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@18557f7f (amq.ctag-G0ngG-foG5insMxWVfGDgQ) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.mail(MailNotification.java:41)
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.sendMail(MailNotification.java:25)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:42:03,644 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@1f8fafe7 (amq.ctag-gGCPIqATum4uUFMYeJOhwQ) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:42:48,748 [pool-1-thread-15] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 19:42:48,751 [pool-1-thread-15] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:45:05,221 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@5566f43 (amq.ctag-xYWfqL4XTQhw1dO7POlOWA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:49:33,051 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:49:33,383 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@13eeadff (amq.ctag-SFkkQcVi5ucmsWJAZAHHkA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:50:12,121 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:50:12,622 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@2e668de8 (amq.ctag-99tNjInYlcYOACT1K7UdaQ) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:51:04,393 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:51:04,738 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@2c24f1e6 (amq.ctag-T035AsYvLbixIfy7st-LzQ) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:51:50,295 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:51:50,809 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@2c24f1e6 (amq.ctag-6tlkZ_OCC1ylyGy6m3HQMA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:56:17,795 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:56:18,122 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@51493afd (amq.ctag-MoPLG4Qh7NS-RCSmvfTMKA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:42)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:57:41,096 [pool-1-thread-4] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-02 19:57:41,584 [pool-1-thread-4] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-02 19:57:41,586 [pool-1-thread-4] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:39)
+       at org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails.getRequestDetails(NotificationDetails.java:16)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:38)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:57:41,587 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@7e6b4dd0 (amq.ctag-9H4GboyZtpMLVI-Hc9oUOw) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 19:59:11,653 [pool-1-thread-3] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@390d445 (amq.ctag-dJZt_7M23aL0KM0T7ecXaQ) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:39)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:01:14,726 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@221a1938 (amq.ctag-1FeZZl1102H0WVYE5BuCpg) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:43)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:01:55,461 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@6ac8bfbf (amq.ctag-dPwv0OuXKpEXdyzq3eadiA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:43)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:04:56,592 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@6f76e141 (amq.ctag-f1-j-8OpoRGfbdkCWoiPYA) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:43)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:05:59,307 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@18fb5759 (amq.ctag-twaaUgTJReaWyy3_HutSEg) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.mail(MailNotification.java:42)
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.sendMail(MailNotification.java:25)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:44)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:11:24,853 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@5a811a04 (amq.ctag-GCk4GYIpWM5aTpybETjm4Q) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.NullPointerException: null
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.mail(MailNotification.java:42)
+       at org.apache.airavata.allocation.manager.notification.sender.MailNotification.sendMail(MailNotification.java:25)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:44)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
+2017-12-02 20:14:28,858 [pool-1-thread-4] ERROR c.r.c.i.ForgivingExceptionHandler  - Consumer org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1@51b33fa2 (amq.ctag-NVp8niAOXpOc8P79-ELdhg) method handleDelivery for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1) threw an exception for channel AMQChannel(amqp://guest@127.0.0.1:5672/,1)
+java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
+       at java.util.ArrayList.rangeCheck(ArrayList.java:653)
+       at java.util.ArrayList.get(ArrayList.java:429)
+       at org.apache.airavata.allocation.manager.notification.receiver.NotificationReceiver$1.handleDelivery(NotificationReceiver.java:43)
+       at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
+       at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
+       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
+       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
+       at java.lang.Thread.run(Thread.java:748)
index f25fe18..3fff3f1 100755 (executable)
@@ -19,13 +19,11 @@ public class UserDetailRepository extends AbstractRepository<UserDetail, UserDet
        }
 
        public UserDetail getAdminDetails() throws Exception {
-               String userType = "ADMIN";
-               String queryString = "SELECT * FROM " + UserDetailEntity.class.getSimpleName() + "WHERE"
-                               + DBConstants.UserDetailTable.USERTYPE + "=" + userType;
                Map<String, Object> queryParameters = new HashMap<>();
-               queryParameters.put(DBConstants.UserDetailTable.USERTYPE, userType);
-
-               return (UserDetail) select(queryString, queryParameters, 0, -1);
+               String query = "SELECT DISTINCT p from " + UserDetailEntity.class.getSimpleName() + " as p";
+               query += " WHERE ";
+               query += "p." + DBConstants.UserDetailTable.USERTYPE + " ='" + DBConstants.UserType.ADMIN + "'";
+               return select(query, queryParameters, 0, -1).get(0);
        }
 
        public List<UserDetail> getAllReviewers() throws Exception {
index 39f5de7..7ed414e 100755 (executable)
@@ -37,312 +37,364 @@ import org.slf4j.LoggerFactory;
 
 public class AllocationManagerServerHandler implements AllocationRegistryService.Iface {
 
-    private final static Logger logger = LoggerFactory.getLogger(AllocationManagerServerHandler.class);
+       private final static Logger logger = LoggerFactory.getLogger(AllocationManagerServerHandler.class);
 
-    public static String OWNER_PERMISSION_NAME = "OWNER";
+       public static String OWNER_PERMISSION_NAME = "OWNER";
 
-    public AllocationManagerServerHandler() throws AllocationManagerException, ApplicationSettingsException, TException, Exception {
-        JPAUtils.initializeDB();
-    }
+       public AllocationManagerServerHandler()
+                       throws AllocationManagerException, ApplicationSettingsException, TException, Exception {
+               JPAUtils.initializeDB();
+       }
 
        @Override
        public boolean createUser(UserDetail userDetail) throws TException {
                // TODO Auto-generated method stub
-        try {
-            UserDetail create = (new UserDetailRepository()).create(userDetail);
-            return true;
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
+               try {
+                       UserDetail create = (new UserDetailRepository()).create(userDetail);
+                       return true;
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
+
+       // Implementing createAllocationRequest method
+       @Override
+       public String createAllocationRequest(UserAllocationDetail reqDetails)
+                       throws AllocationManagerException, TException {
+               try {
+                       if ((new UserAllocationDetailRepository()).isExists(reqDetails.getProjectId())) {
+                               throw new TException("There exist project with the id");
+                       }
+                       reqDetails.setStatus(DBConstants.RequestStatus.PENDING);
+                       UserAllocationDetail create = (new UserAllocationDetailRepository()).create(reqDetails);
+                       String projectId =reqDetails.getProjectId();
+                       (new NotificationManager()).notificationSender(projectId, "NEW_REQUEST");
+                       return projectId;
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
        }
-       
-    //Implementing createAllocationRequest method 
-    @Override
-    public String createAllocationRequest(UserAllocationDetail reqDetails) throws AllocationManagerException, TException {
-        try {
-            if ((new UserAllocationDetailRepository()).isExists(reqDetails.getProjectId())) {
-                throw new TException("There exist project with the id");
-            }
-            reqDetails.setStatus(DBConstants.RequestStatus.PENDING);
-            UserAllocationDetail create = (new UserAllocationDetailRepository()).create(reqDetails);
-            return reqDetails.getProjectId();
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
 
        @Override
        public boolean deleteAllocationRequest(String projectId) throws TException {
-                try {
-                   (new UserAllocationDetailRepository()).delete(projectId);
-                   return true;
-               } catch (Exception ex) {
-                   logger.error(ex.getMessage(), ex);
-                   throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-               }
+               try {
+                       (new UserAllocationDetailRepository()).delete(projectId);
+                       (new NotificationManager()).notificationSender(projectId, "NEW_REQUEST");
+                       return true;
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
+
+       @Override
+       public boolean updateAllocationRequest(UserAllocationDetail reqDetails) throws TException {
+               try {
+                       if ((new UserAllocationDetailRepository()).update(reqDetails).getProjectId() != null) {
+                               return true;
+                       }
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+               return false;
        }
-       
-    @Override
-    public boolean updateAllocationRequest(UserAllocationDetail reqDetails) throws TException {
-        try {
-            if ((new UserAllocationDetailRepository()).update(reqDetails).getProjectId() != null) {
-                return true;
-            }
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-        return false;
-    }
 
        @Override
        public UserAllocationDetail getAllocationRequest(String projectId) throws TException {
-                try {
-                   return (new UserAllocationDetailRepository().get(projectId));
-               } catch (Exception ex) {
-                   logger.error(ex.getMessage(), ex);
-                   throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-               }
+               try {
+                       return (new UserAllocationDetailRepository().get(projectId));
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
        }
 
-       
-    @Override
-    public boolean isAdmin(String userName) throws AllocationManagerException, TException {
-        try {
-            UserDetail objUser = getUserDetails(userName);
-            if (objUser == null) {
-                throw new IllegalArgumentException();
-            }
-            return objUser.userType.equals(DBConstants.UserType.ADMIN);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public boolean isAdmin(String userName) throws AllocationManagerException, TException {
+               try {
+                       UserDetail objUser = getUserDetails(userName);
+                       if (objUser == null) {
+                               throw new IllegalArgumentException();
+                       }
+                       return objUser.userType.equals(DBConstants.UserType.ADMIN);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public boolean isReviewer(String userName) throws AllocationManagerException, TException {
-        try {
-            UserDetail objUser = getUserDetails(userName);
-            if (objUser == null) {
-                throw new IllegalArgumentException();
-            }
-            return objUser.userType.equals(DBConstants.UserType.REVIEWER);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public boolean isReviewer(String userName) throws AllocationManagerException, TException {
+               try {
+                       UserDetail objUser = getUserDetails(userName);
+                       if (objUser == null) {
+                               throw new IllegalArgumentException();
+                       }
+                       return objUser.userType.equals(DBConstants.UserType.REVIEWER);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public List<UserAllocationDetail> getAllRequestsForReviewers(String userName) throws AllocationManagerException, TException {
-        List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
-        try {
-            if (!isReviewer(userName)) {
-                throw new AllocationManagerException().setMessage("Invalid reviewer id!");
-            }
-            List<ProjectReviewer> projReviewerList = (new ProjectReviewerRepository()).getProjectForReviewer(userName);
-            List<String> projectIds = new ArrayList<String>();
-            for (ProjectReviewer objProj : projReviewerList) {
-               projectIds.add(objProj.getProjectId());
-            }
-            return new UserAllocationDetailRepository().get(projectIds);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public List<UserAllocationDetail> getAllRequestsForReviewers(String userName)
+                       throws AllocationManagerException, TException {
+               List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
+               try {
+                       if (!isReviewer(userName)) {
+                               throw new AllocationManagerException().setMessage("Invalid reviewer id!");
+                       }
+                       List<ProjectReviewer> projReviewerList = (new ProjectReviewerRepository()).getProjectForReviewer(userName);
+                       List<String> projectIds = new ArrayList<String>();
+                       for (ProjectReviewer objProj : projReviewerList) {
+                               projectIds.add(objProj.getProjectId());
+                       }
+                       return new UserAllocationDetailRepository().get(projectIds);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public UserDetail getUserDetails(String userName) throws AllocationManagerException, TException {
-        try {
-            return (new UserDetailRepository()).get(userName);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public UserDetail getUserDetails(String userName) throws AllocationManagerException, TException {
+               try {
+                       return (new UserDetailRepository()).get(userName);
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public List<UserAllocationDetail> getAllRequestsForAdmin(String userName) throws TException {
-        List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
-        try {
-            if (!isAdmin(userName)) {
-                throw new AllocationManagerException().setMessage("Invalid admin id!");
-            }
-            userAllocationDetailList = new UserAllocationDetailRepository().getAllUserRequests();
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-        return userAllocationDetailList;
-    }
+       @Override
+       public List<UserAllocationDetail> getAllRequestsForAdmin(String userName) throws TException {
+               List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
+               try {
+                       if (!isAdmin(userName)) {
+                               throw new AllocationManagerException().setMessage("Invalid admin id!");
+                       }
+                       userAllocationDetailList = new UserAllocationDetailRepository().getAllUserRequests();
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+               return userAllocationDetailList;
+       }
 
-    @Override
-    public boolean assignReviewers(String projectId, String reviewerId, String adminId) throws TException {
-        try {
-            if (!isAdmin(adminId)) {
-                throw new AllocationManagerException().setMessage("Invalid admin id!");
-            }
-            if (!isReviewer(reviewerId)) {
-                throw new AllocationManagerException().setMessage("Invalid reviewer id!");
-            }
-            
-            ProjectReviewer projectReviewer = new ProjectReviewer();
-            projectReviewer.setProjectId(projectId);
-            projectReviewer.setReviewer(reviewerId);
+       @Override
+       public boolean assignReviewers(String projectId, String reviewerId, String adminId) throws TException {
+               try {
+                       if (!isAdmin(adminId)) {
+                               throw new AllocationManagerException().setMessage("Invalid admin id!");
+                       }
+                       if (!isReviewer(reviewerId)) {
+                               throw new AllocationManagerException().setMessage("Invalid reviewer id!");
+                       }
 
-            ProjectReviewer projectReviewerObj = new ProjectReviewerRepository().create(projectReviewer);
-            if (projectReviewerObj.getProjectId() != null) {
-                //Update the status to under review.
-                 //Construct the primary key
-               UserAllocationDetail userAllocationDetail = new UserAllocationDetailRepository().get(projectId).setStatus(DBConstants.RequestStatus.UNDER_REVIEW);
-                //Updates the request
-                new UserAllocationDetailRepository().update(userAllocationDetail);
-            }
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-        return true;
-    }
+                       ProjectReviewer projectReviewer = new ProjectReviewer();
+                       projectReviewer.setProjectId(projectId);
+                       projectReviewer.setReviewer(reviewerId);
 
-    @Override
-    public List<ReviewerAllocationDetail> getAllReviewsForARequest(String projectId) throws TException {
-        List<ReviewerAllocationDetail> reviewerAllocationDetailList = new ArrayList<ReviewerAllocationDetail>();
-        try {
-               reviewerAllocationDetailList = new ReviewerAllocationDetailRepository().getAllReviewsForARequest(projectId);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-        return reviewerAllocationDetailList;
-    }
+                       ProjectReviewer projectReviewerObj = new ProjectReviewerRepository().create(projectReviewer);
+                       if (projectReviewerObj.getProjectId() != null) {
+                               // Update the status to under review.
+                               // Construct the primary key
+                               UserAllocationDetail userAllocationDetail = new UserAllocationDetailRepository().get(projectId)
+                                               .setStatus(DBConstants.RequestStatus.UNDER_REVIEW);
+                               // Updates the request
+                               new UserAllocationDetailRepository().update(userAllocationDetail);
+                       }
+                       (new NotificationManager()).notificationSender(projectId, "ASSIGN_REQUEST");
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+               return true;
+       }
 
-    @Override
-    public List<UserDetail> getAllReviewers() throws TException {
-        try {
-            return new UserDetailRepository().getAllReviewers();
-        } catch (Exception ex) {
-            java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE, null, ex);
-        }
-        return null;
-    }
+       @Override
+       public List<ReviewerAllocationDetail> getAllReviewsForARequest(String projectId) throws TException {
+               List<ReviewerAllocationDetail> reviewerAllocationDetailList = new ArrayList<ReviewerAllocationDetail>();
+               try {
+                       reviewerAllocationDetailList = new ReviewerAllocationDetailRepository().getAllReviewsForARequest(projectId);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+               return reviewerAllocationDetailList;
+       }
 
-    @Override
-    public boolean updateRequestByReviewer(ReviewerAllocationDetail reviewerAllocationDetail) throws TException {
-        try {
-               ReviewerAllocationDetail reviewerAllocationDetailObj = new ReviewerAllocationDetail();
-               reviewerAllocationDetailObj = new ReviewerAllocationDetailRepository().isProjectExists(reviewerAllocationDetail.getProjectId(),reviewerAllocationDetail.getUsername());
-               if (reviewerAllocationDetailObj!=null) {
-                       reviewerAllocationDetail.setId(reviewerAllocationDetailObj.getId());
-                       reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository()).update(reviewerAllocationDetail);
-            } else {
-               reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository()).create(reviewerAllocationDetail);
-            }
-            if (reviewerAllocationDetailObj.getProjectId() != null) {
-                return true;
-            }
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-        return false;
-    }
+       @Override
+       public List<UserDetail> getAllReviewers() throws TException {
+               try {
+                       return new UserDetailRepository().getAllReviewers();
+               } catch (Exception ex) {
+                       java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE, null,
+                                       ex);
+               }
+               return null;
+       }
 
-    /*Method to get a list of all reviewers not yet assigned to a request*/
-    @Override
-    public List<UserDetail> getAllUnassignedReviewersForRequest(String projectId) throws TException {
-        List<UserDetail> userDetailList = getAllReviewers();
-        // TO_DO part
-        List<UserDetail> reviewerList = new ArrayList<UserDetail>();
-        for (UserDetail userDetailObj : userDetailList) {
-            try {
-                if (!new ProjectReviewerRepository().isProjectExists(projectId,userDetailObj.getUsername())) {
-                    reviewerList.add(userDetailObj);
-                }
-            } catch (Exception ex) {
-                java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE, null, ex);
-            }
-        }
-        return reviewerList;
-    }
+       @Override
+       public boolean updateRequestByReviewer(ReviewerAllocationDetail reviewerAllocationDetail) throws TException {
+               try {
+                       ReviewerAllocationDetail reviewerAllocationDetailObj = new ReviewerAllocationDetail();
+                       reviewerAllocationDetailObj = new ReviewerAllocationDetailRepository()
+                                       .isProjectExists(reviewerAllocationDetail.getProjectId(), reviewerAllocationDetail.getUsername());
+                       if (reviewerAllocationDetailObj != null) {
+                               reviewerAllocationDetail.setId(reviewerAllocationDetailObj.getId());
+                               reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository())
+                                               .update(reviewerAllocationDetail);
+                       } else {
+                               reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository())
+                                               .create(reviewerAllocationDetail);
+                       }
+                       if (reviewerAllocationDetailObj.getProjectId() != null) {
+                               return true;
+                       }
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+               return false;
+       }
 
-    /*Method to update the request's start date, end date, status and award allocation on approval*/
-    @Override
-    public boolean approveRequest(String projectId, String adminId, long startDate, long endDate, long awardAllocation) throws TException {
-        try {
-            if (!isAdmin(adminId)) {
-                throw new AllocationManagerException().setMessage("Invalid admin id!");
-            }
-            //Create UserAllocationDetail object to call update method
-            UserAllocationDetail userAllocDetail = new UserAllocationDetail();
-            userAllocDetail = new UserAllocationDetailRepository().get(projectId);
-            userAllocDetail.setStatus(DBConstants.RequestStatus.APPROVED);
-            userAllocDetail.setStartDate(startDate);
-            userAllocDetail.setEndDate(endDate);
-            userAllocDetail.setAwardAllocation(awardAllocation);
+       /* Method to get a list of all reviewers not yet assigned to a request */
+       @Override
+       public List<UserDetail> getAllUnassignedReviewersForRequest(String projectId) throws TException {
+               List<UserDetail> userDetailList = getAllReviewers();
+               // TO_DO part
+               List<UserDetail> reviewerList = new ArrayList<UserDetail>();
+               for (UserDetail userDetailObj : userDetailList) {
+                       try {
+                               if (!new ProjectReviewerRepository().isProjectExists(projectId, userDetailObj.getUsername())) {
+                                       reviewerList.add(userDetailObj);
+                               }
+                       } catch (Exception ex) {
+                               java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE,
+                                               null, ex);
+                       }
+               }
+               return reviewerList;
+       }
 
-            //updates the request
-            return updateAllocationRequest(userAllocDetail);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       /*
+        * Method to update the request's start date, end date, status and award
+        * allocation on approval
+        */
+       @Override
+       public boolean approveRequest(String projectId, String adminId, long startDate, long endDate, long awardAllocation)
+                       throws TException {
+               try {
+                       if (!isAdmin(adminId)) {
+                               throw new AllocationManagerException().setMessage("Invalid admin id!");
+                       }
+                       // Create UserAllocationDetail object to call update method
+                       UserAllocationDetail userAllocDetail = new UserAllocationDetail();
+                       userAllocDetail = new UserAllocationDetailRepository().get(projectId);
+                       userAllocDetail.setStatus(DBConstants.RequestStatus.APPROVED);
+                       userAllocDetail.setStartDate(startDate);
+                       userAllocDetail.setEndDate(endDate);
+                       userAllocDetail.setAwardAllocation(awardAllocation);
+                       
+                       (new NotificationManager()).notificationSender(projectId, "APPROVE_REQUEST");
+                       
+                       // updates the request
+                       return updateAllocationRequest(userAllocDetail);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
+
+       /* Method to update the request status to rejected on reject of a request */
+       @Override
+       public boolean rejectRequest(String projectId, String adminId) throws TException {
+               try {
+                       if (!isAdmin(adminId)) {
+                               throw new AllocationManagerException().setMessage("Invalid admin id!");
+                       }
 
-    /*Method to update the request status to rejected on reject of a request*/
-    @Override
-    public boolean rejectRequest(String projectId, String adminId) throws TException {
-        try {
-            if (!isAdmin(adminId)) {
-                throw new AllocationManagerException().setMessage("Invalid admin id!");
-            }
-        
-            //Create UserAllocationDetail object to call update method
-            UserAllocationDetail userAllocDetail = new UserAllocationDetail();
-            userAllocDetail = new UserAllocationDetailRepository().get(projectId);
-            userAllocDetail.setStatus(DBConstants.RequestStatus.REJECTED);
-            
-            //Updates the request
-            return updateAllocationRequest(userAllocDetail);
-        } catch (Exception ex) {
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
-    
-    @Override
+                       // Create UserAllocationDetail object to call update method
+                       UserAllocationDetail userAllocDetail = new UserAllocationDetail();
+                       userAllocDetail = new UserAllocationDetailRepository().get(projectId);
+                       userAllocDetail.setStatus(DBConstants.RequestStatus.REJECTED);
+
+                       // Updates the request
+                       (new NotificationManager()).notificationSender(projectId, "DENY_REQUEST");
+                       return updateAllocationRequest(userAllocDetail);
+               } catch (Exception ex) {
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
+
+       @Override
        public String getAllocationRequestStatus(String projectId) throws TException {
-                try {
-                   return (new UserAllocationDetailRepository().get(projectId).getStatus());
-               } catch (Exception ex) {
-                   logger.error(ex.getMessage(), ex);
-                   throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-               }
+               try {
+                       return (new UserAllocationDetailRepository().get(projectId).getStatus());
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
+
+       @Override
+       public String getAllocationRequestUserEmail(String projectId) throws TException {
+               try {
+                       String username = getAllocationRequestUserName(projectId);
+                       return ((new UserDetailRepository()).get(username)).getEmail();
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
        }
 
-    @Override
-    public String getAllocationRequestUserEmail(String projectId) throws TException {
-        try {
-            return (new UserDetailRepository()).get(projectId).getEmail();
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public String getAllocationRequestUserName(String projectId) throws org.apache.thrift.TException {
+               try {
+                       return ((new UserAllocationDetailRepository()).get(projectId)).getUsername();
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public String getAllocationRequestUserName(String projectId) throws org.apache.thrift.TException {
-        try {
-               return (new UserDetailRepository()).get(projectId).getUsername();
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       @Override
+       public String getAllocationManagerAdminEmail(String userType) throws TException {
+               try {
+                       return (new UserDetailRepository()).getAdminDetails().getEmail();
+               } catch (Exception ex) {
+                       logger.error(ex.getMessage(), ex);
+                       throw new AllocationManagerException()
+                                       .setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
+               }
+       }
 
-    @Override
-    public String getAllocationManagerAdminEmail(String userType) throws TException {
-        try {
-            return (new UserDetailRepository()).getAdminDetails().getEmail();
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-            throw new AllocationManagerException().setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
-        }
-    }
+       public List<String> getEmailIdsOfReviewersForRequest(String projectId) {
+               List<String> reviewerEmailList = new ArrayList<>();
+               try {
+                       for (ReviewerAllocationDetail s : getAllReviewsForARequest(projectId)) {
+                               reviewerEmailList.add(getUserDetails(s.getUsername()).getEmail());
+                       }
+               } catch (TException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               return reviewerEmailList;
+       }
 }
index 5ceb4a9..577224b 100755 (executable)
@@ -13,7 +13,7 @@ public class TestServer {
 
  public static void StartsimpleServer(AllocationRegistryService.Processor<AllocationManagerServerHandler> processor) {
   try {
-   TServerTransport serverTransport = new TServerSocket(9030);
+   TServerTransport serverTransport = new TServerSocket(9040);
    TServer server = new TSimpleServer(
      new Args(serverTransport).processor(processor));
 
index 2f9b5fa..59e6f91 100644 (file)
@@ -8,23 +8,18 @@ public class NotificationManager {
 
        private final static String QUEUE_NAME = "notify";
 
-       public void notificationSender(String projectID) {
-
+       public void notificationSender(String projectID, String notificationType) {
                try {
 
-                       // Create a connection factory
                        ConnectionFactory factory = new ConnectionFactory();
-                       // Set the host to the location of the RabbitMQ server
                        factory.setHost("localhost");
-                       // Open a new connection
                        Connection connection = factory.newConnection();
-                       // Channel is the abstraction for interacting with a queue
                        Channel channel = connection.createChannel();
-                       // Create the Queue if it does not exist
                        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
-                       // assuming this is the request id send
-                       String project_ID = projectID;
 
+                       // this is the project id and notification type that is sent 
+                       String project_ID = projectID+","+notificationType;
+                       
                        channel.basicPublish("", QUEUE_NAME, null, project_ID.getBytes());
 
                        System.out.println(" [x] Sent the request");
diff --git a/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationTestClient.java b/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationTestClient.java
new file mode 100644 (file)
index 0000000..8ab514d
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.apache.airavata.allocation.manager.client;
+
+import java.util.List;
+import org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+import org.apache.airavata.allocation.manager.models.UserAllocationDetail;
+import org.apache.airavata.allocation.manager.models.UserDetail;
+import org.apache.airavata.allocation.manager.service.cpi.AllocationRegistryService;
+
+public class NotificationTestClient {
+
+    public static void main(String[] args) {
+
+        try {
+            TTransport transport;
+
+            transport = new TSocket("localhost", 9040);
+            transport.open();
+
+            TProtocol protocol = new TBinaryProtocol(transport);
+            AllocationRegistryService.Client client = new AllocationRegistryService.Client(protocol);
+            System.out.println("Started client");
+            
+//            System.out.println("Testing createAllocationRequest() ");
+//
+//            UserAllocationDetail requestDetails = new UserAllocationDetail();
+//            requestDetails.setProjectId("1115");
+//            requestDetails.setUsername("nikitha");
+//            requestDetails.setRequestedDate(101L);
+//            requestDetails.setTitle("Test");
+//            requestDetails.setProjectDescription("Test");
+//            requestDetails.setTypeOfAllocation("Comm");
+//            requestDetails.setStatus("pending");
+//
+//            System.out.println(client.createAllocationRequest(requestDetails));
+
+//            UserAllocationDetail rDetails1 = new UserAllocationDetail();
+//            rDetails1.setProjectId("1234");
+//            rDetails1.setUsername("madrina");
+//            rDetails1.setRequestedDate(101L);
+//            rDetails1.setTitle("Test");
+//            rDetails1.setProjectDescription("Test");
+//            rDetails1.setTypeOfAllocation("Comm");
+//            rDetails1.setStatus("pending");
+//
+//            System.out.println(client.createAllocationRequest(rDetails1));
+//            
+//            System.out.println("######################");
+//            
+//            System.out.println("Testing deleteAllocationRequest() ");
+//
+//            System.out.println(client.deleteAllocationRequest("123456"));
+//            
+//            System.out.println("######################");
+//            
+//            System.out.println("Testing assignReviewers() ");
+//
+//            System.out.println(client.assignReviewers("123456", "reviewer1", "admin"));
+//            System.out.println(client.assignReviewers("123456", "reviewer2", "admin"));
+            System.out.println(client.assignReviewers("1234", "reviewer2", "admin"));
+            System.out.println(client.assignReviewers("1234", "reviewer3", "admin"));
+//            
+//            System.out.println("######################");
+//
+//
+//
+//            System.out.println("Testing updateRequestByReviewer() ");
+//            ReviewerAllocationDetail reviewerAllocationDetail = new ReviewerAllocationDetail();
+//            reviewerAllocationDetail.setProjectId("123456");
+//            reviewerAllocationDetail.setUsername("reviewer2");
+//            reviewerAllocationDetail.setMaxMemoryPerCpu(15L);
+//            System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail));
+//
+//            ReviewerAllocationDetail reviewerAllocationDetail1 = new ReviewerAllocationDetail();
+//            reviewerAllocationDetail1.setProjectId("123456");
+//            reviewerAllocationDetail1.setUsername("reviewer1");
+//            reviewerAllocationDetail1.setMaxMemoryPerCpu(5L);
+//            System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail1));
+//            
+//
+//
+            System.out.println("Testing approveRequest() ");
+
+            System.out.println(client.approveRequest("1234", "admin", 1l, 2l, 50l));
+//            
+//            System.out.println("######################");
+//
+            System.out.println("Testing rejectRequest() ");
+
+            System.out.println(client.rejectRequest("1234", "admin"));
+//            
+//            System.out.println("######################");
+
+            transport.close();
+        } catch (TTransportException e) {
+            e.printStackTrace();
+        } catch (TException x) {
+            x.printStackTrace();
+        } finally {
+            //transport.close();
+        }
+    }
+
+}
index 15d76af..f3f5c15 100755 (executable)
@@ -24,7 +24,7 @@ public class testClient {
         try {
             TTransport transport;
 
-            transport = new TSocket("localhost", 9030);
+            transport = new TSocket("localhost", 9040);
             transport.open();
 
             TProtocol protocol = new TBinaryProtocol(transport);
index a95c750..debb4f6 100644 (file)
@@ -6,6 +6,8 @@
  */
 package org.apache.airavata.allocation.manager.service.cpi;
 
+import org.apache.airavata.allocation.manager.client.NotificationManager;
+
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
 @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
 public class AllocationRegistryService {
@@ -442,6 +444,7 @@ public class AllocationRegistryService {
     public boolean assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId) throws org.apache.thrift.TException
     {
       send_assignReviewers(projectId, reviewerId, adminId);
+      (new NotificationManager()).notificationSender(projectId, "ASSIGN_REQUEST");
       return recv_assignReviewers();
     }
 
@@ -650,6 +653,7 @@ public class AllocationRegistryService {
     public boolean approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation) throws org.apache.thrift.TException
     {
       send_approveRequest(projectId, adminId, startDate, endDate, awardAllocation);
+      (new NotificationManager()).notificationSender(projectId, "APPROVE_REQUEST");
       return recv_approveRequest();
     }
 
@@ -677,6 +681,7 @@ public class AllocationRegistryService {
     public boolean rejectRequest(java.lang.String projectId, java.lang.String adminId) throws org.apache.thrift.TException
     {
       send_rejectRequest(projectId, adminId);
+      (new NotificationManager()).notificationSender(projectId, "DENY_REQUEST");
       return recv_rejectRequest();
     }
 
diff --git a/allocation-manager/airavata-allocation-manager/logs/airavata.log.2017-12-03 b/allocation-manager/airavata-allocation-manager/logs/airavata.log.2017-12-03
new file mode 100644 (file)
index 0000000..ce51078
--- /dev/null
@@ -0,0 +1,12 @@
+2017-12-03 00:37:00,058 [main] INFO  o.a.a.c.u.ApplicationSettings  - Settings loaded from jar:file:/Users/nikithachettiar/.m2/repository/org/apache/airavata/airavata-server-configuration/0.17-SNAPSHOT/airavata-server-configuration-0.17-SNAPSHOT.jar!/airavata-server.properties
+2017-12-03 00:37:01,222 [main] INFO  o.a.a.a.m.d.u.DatabaseCreator  - Script file not found at database_scripts/sharing-registry-derby.sql. Uses default database script file
+2017-12-03 00:37:01,226 [main] ERROR o.a.a.a.m.db.utils.JPAUtils  - null
+java.lang.NullPointerException: null
+       at java.io.Reader.<init>(Reader.java:78)
+       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.executeSQLScript(DatabaseCreator.java:272)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createDatabase(DatabaseCreator.java:237)
+       at org.apache.airavata.allocation.manager.db.utils.DatabaseCreator.createRegistryDatabase(DatabaseCreator.java:65)
+       at org.apache.airavata.allocation.manager.db.utils.JPAUtils.initializeDB(JPAUtils.java:121)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler.<init>(AllocationManagerServerHandler.java:40)
+       at org.apache.airavata.allocation.manager.server.AllocationManagerAdminServer.main(AllocationManagerAdminServer.java:33)