geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1155996 - /geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Date Wed, 10 Aug 2011 01:45:06 GMT
Author: rwonly
Date: Wed Aug 10 01:45:05 2011
New Revision: 1155996

URL: http://svn.apache.org/viewvc?rev=1155996&view=rev
Log:
GERONIMO-6096 OpenJPA related error pops up when add two servers which just protocol different
in Monitoring porlet on admin console (thanks Fang shenghao for the patch)

Modified:
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java?rev=1155996&r1=1155995&r2=1155996&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java
Wed Aug 10 01:45:05 2011
@@ -687,10 +687,14 @@ public class MonitoringPortlet extends B
     private void addServer(ActionRequest actionRequest,
                            ActionResponse actionResponse) {
         try {
-            userTransaction.begin();
             String name = actionRequest.getParameter("name");
             String host = actionRequest.getParameter("ip");
+            if (entityManager.find(Node.class, name) != null) {
+                final String message = "The server name already exists. Please use a different
one.";
+                throw new Exception(message);
+            }
             try {
+                userTransaction.begin();
                 Node node = new Node();
                 node.setName(name);
                 node.setHost(host);



Mime
View raw message