airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r1427244 [1/2] - in /airavata/trunk/modules: integration-tests/ registry/airavata-jpa-registry/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ rest/service/src/main/java/org/apache/airavata/servic...
Date Mon, 31 Dec 2012 21:29:02 GMT
Author: amilaj
Date: Mon Dec 31 21:29:02 2012
New Revision: 1427244

URL: http://svn.apache.org/viewvc?rev=1427244&view=rev
Log:
Fixing AIRAVATA-687. Also removed redundant dependency entry from integration-tests pom

Modified:
    airavata/trunk/modules/integration-tests/pom.xml
    airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/WebAppUtil.java

Modified: airavata/trunk/modules/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/integration-tests/pom.xml?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/integration-tests/pom.xml (original)
+++ airavata/trunk/modules/integration-tests/pom.xml Mon Dec 31 21:29:02 2012
@@ -158,7 +158,7 @@
                 </executions>
             </plugin>
 
-            <plugin>
+            <!--plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
                     <execution>
@@ -175,7 +175,7 @@
                         </goals>
                     </execution>
                 </executions>
-            </plugin>
+            </plugin-->
 
 
             <plugin>
@@ -351,18 +351,6 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-jpa-registry</artifactId>
-            <type>jar</type>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-simple</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-webapp</artifactId>
             <version>${axis2.version}</version>

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml Mon Dec 31 21:29:02 2012
@@ -95,4 +95,30 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <phase>process-classes</phase>
+                        <configuration>
+                            <tasks>
+                                <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="maven.compile.classpath"/>
+                                <openjpac>
+                                    <classpath refid="maven.compile.classpath"/>
+                                </openjpac>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java Mon Dec 31 21:29:02 2012
@@ -49,7 +49,7 @@ public class ResourceUtils {
             properties.put("openjpa.ConnectionUserName",Utils.getJDBCUser());
             properties.put("openjpa.ConnectionPassword",Utils.getJDBCPassword());
             properties.put("openjpa.DynamicEnhancementAgent","true");
-            properties.put("openjpa.RuntimeUnenhancedClasses","supported");
+            properties.put("openjpa.RuntimeUnenhancedClasses","unsupported");
             properties.put("openjpa.Log","SQL=ERROR");
             properties.put("openjpa.ReadLockLevel", "none");
             properties.put("openjpa.WriteLockLevel", "none");

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java Mon Dec 31 21:29:02 2012
@@ -27,6 +27,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.Gateway;
 import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
 import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.*;
@@ -55,10 +56,8 @@ public class BasicRegistryResouce {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_GATEWAY, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -81,10 +80,8 @@ public class BasicRegistryResouce {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_USER, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -103,10 +100,8 @@ public class BasicRegistryResouce {
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Gateway added successfully");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_GATEWAY, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -125,10 +120,8 @@ public class BasicRegistryResouce {
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Airavata user added successfully");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_USER, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -151,10 +144,8 @@ public class BasicRegistryResouce {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.VERSION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -177,10 +168,8 @@ public class BasicRegistryResouce {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_SERVICE_URL, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -199,10 +188,8 @@ public class BasicRegistryResouce {
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Connection URL updated successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_SERVICE_URL, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java Mon Dec 31 21:29:02 2012
@@ -27,6 +27,7 @@ import org.apache.airavata.rest.mappings
 import org.apache.airavata.rest.mappings.resourcemappings.URLList;
 import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
 import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.*;
@@ -70,10 +71,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -110,10 +109,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION_LIST, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -144,10 +141,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Configuration saved successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.SAVE_CONFIGURATION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -178,10 +173,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Configuration updated successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.UPDATE_CONFIGURATION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -205,10 +198,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("All configurations with given config key removed successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_CONFIGURATION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -233,10 +224,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Configuration removed successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_CONFIGURATION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -270,10 +259,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_GFAC_URI_LIST, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -307,10 +294,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_WFINTERPRETER_URI_LIST, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -338,10 +323,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_EVENTING_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -369,10 +352,8 @@ public class ConfigurationRegistryResour
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_MESSAGE_BOX_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -397,10 +378,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("GFac URI added successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -425,10 +404,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Workflow interpreter URI added successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -453,10 +430,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Eventing URI set successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -481,10 +456,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("MessageBox URI set successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_MESSAGE_BOX_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -512,10 +485,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("GFac URI added successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -543,10 +514,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Workflow interpreter URI added successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -574,10 +543,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Eventing URI added successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -605,10 +572,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Message box URI retrieved successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_MSG_BOX_URI_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -633,10 +598,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("GFac URI deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_GFAC_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -659,10 +622,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("All GFac URIs deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_GFAC_URIS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -687,10 +648,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Workflow Interpreter URI deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_WFINTERPRETER_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -713,10 +672,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("All workflow interpreter URIs deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_WFINTERPRETER_URIS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -739,10 +696,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("Eventing URI deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_EVENTING_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -765,10 +720,8 @@ public class ConfigurationRegistryResour
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("MessageBox URI deleted successfully...");
             return builder.build();
-        } catch (Exception e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java Mon Dec 31 21:29:02 2012
@@ -25,7 +25,6 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException;
 import org.apache.airavata.registry.api.exception.gateway.DescriptorDoesNotExistsException;
 import org.apache.airavata.registry.api.exception.gateway.MalformedDescriptorException;
@@ -33,6 +32,7 @@ import org.apache.airavata.rest.mappings
 import org.apache.airavata.rest.mappings.utils.DescriptorUtil;
 import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
 import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.*;
@@ -81,10 +81,8 @@ public class DescriptorRegistryResource 
                 builder.entity("False");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -114,10 +112,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_SAVE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -147,10 +143,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_UPDATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -183,10 +177,8 @@ public class DescriptorRegistryResource 
                 builder.entity("Host Descriptor does not exist...");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -215,10 +207,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -254,10 +244,8 @@ public class DescriptorRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -279,8 +267,8 @@ public class DescriptorRegistryResource 
             List<HostDescription> hostDescriptionList = airavataRegistry.getHostDescriptors();
             List<String> hostDescriptorNames = new ArrayList<String>();
             DescriptorNameList descriptorNameList = new DescriptorNameList();
-            for (int i = 0; i < hostDescriptionList.size(); i++) {
-                hostDescriptorNames.add(hostDescriptionList.get(i).getType().getHostName());
+            for (HostDescription aHostDescriptionList : hostDescriptionList) {
+                hostDescriptorNames.add(aHostDescriptionList.getType().getHostName());
             }
             descriptorNameList.setDescriptorNames(hostDescriptorNames);
             if (hostDescriptionList.size() != 0) {
@@ -291,10 +279,8 @@ public class DescriptorRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS_NAMES, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -325,10 +311,8 @@ public class DescriptorRegistryResource 
                 builder.entity("False");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -358,10 +342,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -391,10 +373,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_UPDATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -427,10 +407,8 @@ public class DescriptorRegistryResource 
                 builder.entity("No service descriptor available with given service name...");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -458,10 +436,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_DELETE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -497,10 +473,8 @@ public class DescriptorRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_SERVICE_DESCS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -536,10 +510,8 @@ public class DescriptorRegistryResource 
                 builder.entity("False");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APPL_DESC_EXIST, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -594,10 +566,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_BUILD_SAVE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -652,10 +622,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_UPDATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -696,10 +664,8 @@ public class DescriptorRegistryResource 
                 builder.entity("Application descriptor does not exist...");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DESCRIPTION, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -737,10 +703,8 @@ public class DescriptorRegistryResource 
                 builder.entity("Application descriptor does not exist...");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_PER_HOST_SERVICE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -789,10 +753,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCS_SERVICE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -842,10 +804,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCRIPTORS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -884,10 +844,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_NAMES, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -920,10 +878,8 @@ public class DescriptorRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DELETE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java Mon Dec 31 21:29:02 2012
@@ -25,12 +25,12 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.AiravataUser;
 import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
 import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
 import org.apache.airavata.rest.mappings.resourcemappings.ExperimentList;
 import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
 import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.*;
@@ -77,6 +77,8 @@ public class ExperimentRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.DELETE_EXP, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -110,10 +112,8 @@ public class ExperimentRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_ALL_EXPS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -148,10 +148,8 @@ public class ExperimentRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_PROJECT, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -192,14 +190,12 @@ public class ExperimentRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
         } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -242,14 +238,12 @@ public class ExperimentRegistryResource 
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
         } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -295,14 +289,12 @@ public class ExperimentRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
         } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -331,10 +323,8 @@ public class ExperimentRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
             builder.entity("False");
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity("Exprtiment does not exist...");
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -362,10 +352,8 @@ public class ExperimentRegistryResource 
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("New experiment created...");
             return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS_CREATE, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java?rev=1427244&r1=1427243&r2=1427244&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java Mon Dec 31 21:29:02 2012
@@ -23,12 +23,12 @@ package org.apache.airavata.services.reg
 
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.WorkspaceProject;
-import org.apache.airavata.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectAlreadyExistsException;
 import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
 import org.apache.airavata.rest.mappings.resourcemappings.WorkspaceProjectList;
 import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
 import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.*;
@@ -72,10 +72,8 @@ public class ProjectRegistryResource {
                 builder.entity("False");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -109,10 +107,8 @@ public class ProjectRegistryResource {
                 builder.entity("False");
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST_CREATE, e);
         }finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -137,13 +133,11 @@ public class ProjectRegistryResource {
             builder.entity("Workspace project added successfully...");
             return builder.build();
         } catch (WorkspaceProjectAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.ADD_PROJECT, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -168,13 +162,11 @@ public class ProjectRegistryResource {
             builder.entity("Workspace project updated successfully...");
             return builder.build();
         } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.UPDATE_PROJECT, e);
         }  finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -198,13 +190,11 @@ public class ProjectRegistryResource {
             builder.entity("Workspace project deleted successfully...");
             return builder.build();
         } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.DELETE_PROJECT, e);
         }  finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -233,13 +223,11 @@ public class ProjectRegistryResource {
                 return builder.build();
             }
         } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
             builder.entity(e.getMessage());
             return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECT, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);
@@ -272,10 +260,8 @@ public class ProjectRegistryResource {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
                 return builder.build();
             }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
+        } catch (Throwable e) {
+            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECTS, e);
         } finally {
             if (airavataRegistry != null) {
                 RegPoolUtils.releaseRegistry(context, airavataRegistry);



Mime
View raw message