geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r329716 - /geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Date Mon, 31 Oct 2005 02:59:58 GMT
Author: ammulder
Date: Sun Oct 30 18:59:55 2005
New Revision: 329716

URL: http://svn.apache.org/viewcvs?rev=329716&view=rev
Log:
Don't try a default connect for a non-standard URI.  GERONIMO-463

Modified:
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java?rev=329716&r1=329715&r2=329716&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Sun Oct 30 18:59:55 2005
@@ -220,19 +220,26 @@
         } else {
             mgr.registerDeploymentFactory(new DeploymentFactoryImpl());
         }
-        
-        try {
-            manager = mgr.getDeploymentManager(uri == null ? DEFAULT_URI : uri, user, password);
-        } catch(AuthenticationFailedException e) { // server's there, you just can't talk
to it
-            if(authPrompt && (user == null || password == null)) {
-                doAuthPromptAndRetry(uri, commandContext, user, password);
-            } else {
-                throw new DeploymentException("Login Failed");
+
+        if(authPrompt && uri != null && !uri.equals(DEFAULT_URI) &&
user == null && password == null) {
+            // Non-standard URI, but no authentication information
+            doAuthPromptAndRetry(uri, commandContext, user, password);
+            return;
+        } else { // Standard URI with no auth, Non-standard URI with auth, or else this is
the 2nd try already
+            try {
+                manager = mgr.getDeploymentManager(uri == null ? DEFAULT_URI : uri, user,
password);
+            } catch(AuthenticationFailedException e) { // server's there, you just can't
talk to it
+                if(authPrompt && (user == null || password == null)) {
+                    doAuthPromptAndRetry(uri, commandContext, user, password);
+                    return;
+                } else {
+                    throw new DeploymentException("Login Failed");
+                }
+            } catch(DeploymentManagerCreationException e) {
+                throw new DeploymentException("Unable to connect to server at "+(uri == null
? DEFAULT_URI : uri)+" -- "+e.getMessage());
             }
-        } catch(DeploymentManagerCreationException e) {
-            throw new DeploymentException("Unable to connect to server at "+(uri == null
? DEFAULT_URI : uri)+" -- "+e.getMessage());
         }
-        
+
         if (manager instanceof JMXDeploymentManager) {
             JMXDeploymentManager deploymentManager = (JMXDeploymentManager) manager;
             deploymentManager.setCommandContext(commandContext);



Mime
View raw message