[
https://issues.jboss.org/browse/JBIDE-11696?page=com.atlassian.jira.plugi...
]
Xavier Coulon updated JBIDE-11696:
----------------------------------
Description:
workaround patch for client:
{code}
diff --git a/src/main/java/com/openshift/internal/client/ApplicationResource.java
b/src/main/java/com/openshift/internal/client/ApplicationResource.java
index 60b4bfe..aaebd09 100755
--- a/src/main/java/com/openshift/internal/client/ApplicationResource.java
+++ b/src/main/java/com/openshift/internal/client/ApplicationResource.java
@@ -616,14 +616,24 @@ public class ApplicationResource extends AbstractOpenShiftResource
implements IA
throw new OpenShiftSSHOperationException("SSH session for application
\"{0}\" is closed or null. Cannot start port forwarding", this.getName());
}
for (IApplicationPortForwarding port : ports) {
- port.start(session);
+ try {
+ port.start(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
return ports;
}
public List<IApplicationPortForwarding> stopPortForwarding() throws
OpenShiftSSHOperationException {
for (IApplicationPortForwarding port : ports) {
- port.stop(session);
+ try {
+ port.stop(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
// make sure port forwarding is stopped by closing session...
session.disconnect();
{code}
patch in ui:
{code}
Index:
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
===================================================================
---
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (revision
40574)
+++
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (working
copy)
@@ -194,7 +194,7 @@
wizardModel.startPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to start port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to start
port-forwarding.", e);
}
return Status.OK_STATUS;
}
@@ -227,7 +227,7 @@
wizardModel.stopPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to stop Port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to stop
port-forwarding.", e);
}
return Status.OK_STATUS;
}
{code}
was:
workaround patch for client:
{quote}
diff --git a/src/main/java/com/openshift/internal/client/ApplicationResource.java
b/src/main/java/com/openshift/internal/client/ApplicationResource.java
index 60b4bfe..aaebd09 100755
--- a/src/main/java/com/openshift/internal/client/ApplicationResource.java
+++ b/src/main/java/com/openshift/internal/client/ApplicationResource.java
@@ -616,14 +616,24 @@ public class ApplicationResource extends AbstractOpenShiftResource
implements IA
throw new OpenShiftSSHOperationException("SSH session for application
\"{0}\" is closed or null. Cannot start port forwarding", this.getName());
}
for (IApplicationPortForwarding port : ports) {
- port.start(session);
+ try {
+ port.start(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
return ports;
}
public List<IApplicationPortForwarding> stopPortForwarding() throws
OpenShiftSSHOperationException {
for (IApplicationPortForwarding port : ports) {
- port.stop(session);
+ try {
+ port.stop(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
// make sure port forwarding is stopped by closing session...
session.disconnect();
{quote}
patch in ui:
{quote}
Index:
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
===================================================================
---
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (revision
40574)
+++
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (working
copy)
@@ -194,7 +194,7 @@
wizardModel.startPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to start port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to start
port-forwarding.", e);
}
return Status.OK_STATUS;
}
@@ -227,7 +227,7 @@
wizardModel.stopPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to stop Port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to stop
port-forwarding.", e);
}
return Status.OK_STATUS;
}
{quote}
portforward: start/stop errors instantly so no error handling
possible and if one port fails all other fails too
-----------------------------------------------------------------------------------------------------------------
Key: JBIDE-11696
URL:
https://issues.jboss.org/browse/JBIDE-11696
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Reporter: Max Rydahl Andersen
Assignee: Xavier Coulon
Fix For: 3.3.0.Beta3
workaround patch for client:
{code}
diff --git a/src/main/java/com/openshift/internal/client/ApplicationResource.java
b/src/main/java/com/openshift/internal/client/ApplicationResource.java
index 60b4bfe..aaebd09 100755
--- a/src/main/java/com/openshift/internal/client/ApplicationResource.java
+++ b/src/main/java/com/openshift/internal/client/ApplicationResource.java
@@ -616,14 +616,24 @@ public class ApplicationResource extends AbstractOpenShiftResource
implements IA
throw new OpenShiftSSHOperationException("SSH session for application
\"{0}\" is closed or null. Cannot start port forwarding", this.getName());
}
for (IApplicationPortForwarding port : ports) {
- port.start(session);
+ try {
+ port.start(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
return ports;
}
public List<IApplicationPortForwarding> stopPortForwarding() throws
OpenShiftSSHOperationException {
for (IApplicationPortForwarding port : ports) {
- port.stop(session);
+ try {
+ port.stop(session);
+ } catch(OpenShiftSSHOperationException oss) {
+ // ignore for now
+ // should store this error on the forward to let user know why it could not
start/stop
+ }
}
// make sure port forwarding is stopped by closing session...
session.disconnect();
{code}
patch in ui:
{code}
Index:
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
===================================================================
---
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (revision
40574)
+++
plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java (working
copy)
@@ -194,7 +194,7 @@
wizardModel.startPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to start port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to start
port-forwarding.", e);
}
return Status.OK_STATUS;
}
@@ -227,7 +227,7 @@
wizardModel.stopPortForwarding();
refreshViewerInput();
} catch (Exception e) {
- Logger.error("Failed to stop Port-forwarding", e);
+ return OpenShiftUIActivator.createErrorStatus("Failed to stop
port-forwarding.", e);
}
return Status.OK_STATUS;
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira