2

Is there a way to stop Eclipse for publishing / deleting a project from server, if you really want it to stop in between, and not waiting for eternity it to complete it first (like it makes for me at least)? The event blocks every mods on eclipse and if I press cancel nothing really is happening to the upload process.

EDIT1:

Question in short: Can I cancel publishing to Glassfish from Eclipse servers tab in between the processing?

Answer criteria: I am happy with any insights

  1. what could be done when you want to stop in between?
  2. and what happens there under hood forcing the Eclipse to wait the event until end?
mico
  • 12,730
  • 12
  • 59
  • 99
  • You mean completely turn off automatic publishing? Double click on server in `Servers` tab and look inside `Publishing`. – Aleksandr M Jun 03 '14 at 10:33
  • Actually not. I would like to end the publishing event, when it starts to publish (automatically or manually) and I want to cancel the publish eg. from reason that I noticed one window there is still not saved and I would like to cancel and save and publish only after that. Now that seems impossible, 'cause the publish goes like train and cancel is 'heard' only after whole event is done. – mico Jun 03 '14 at 10:44
  • Eclipse creates an eclipseApps folder, so it copies some kind of release there. Is then so, that Eclipse copies stuff there and any control comes back only when Deploy successful or Deploy failed take place in the logs? Kinda irritating way, but maybe there was no option when this was developed. – mico Jun 05 '14 at 07:18
  • I read some pages and found out the eclipse servers functionality is actually part of some plugin, in my case GlassFish tools. So this issue does not relate to pure Eclipse feature but an plugin enabled feature. – mico Jun 10 '14 at 12:18
  • I think this is not intended but maybe if the upload have his own process you could write a batch file: "taskkill /im processname" – jungerislaender Jun 13 '14 at 12:43
  • Like @jungerislander pointed out, the solution lies outside the eclipse. I looked on Glassfish admin console and realized that the deploy itself is not the slowest part but the starting of service of the deployed app takes the time. Something has to be found to break the startup of app, so that it is not anymore loaded to active memory (/whereever it goes) and then the new fresh version could be added, when the control comes back in form of failed to deploy or similar. HAve to figure out how to do that. – mico Jun 16 '14 at 06:36
  • I mean with deploy, that the package appears in deployed apps list and there is mark on deployed box. – mico Jun 16 '14 at 06:37
  • I looked [this post on SO](http://stackoverflow.com/questions/17346811/undeploy-all-applications-from-glassfish) and realized you can do manual undeploy on the asadmin tool from command line. Whenever you want to cancel upload, call that and the app is undeployed. There is still issue with the EclipseApps folder and Eclipse being in wierd state when it does not recognize the manual intervention. – mico Jun 16 '14 at 06:55
  • That undeploy outside Eclipse seems to be not working. At least I got everything stuck in a state while trying. Blah... – mico Jun 16 '14 at 08:46

1 Answers1

0

It seems that it is not possible to stop the server from deploying to Glassfish, but what you can interrupt is to run manual intervention before Glassfish starts the deployed program.

It is only partial solution but cuts the time to half, at least.

For manual intervention I use:

#!/bin/bash

ASADMIN=(path to Glassfish asadmin executable)

function undeploy_all {
    for p in $*; do
        echo "Undeploying $p..."
        $ASADMIN undeploy $p
    done;
}

apps=`$ASADMIN list-applications -t | awk '{print $1;}'`

undeploy_all $apps

and I run this from Cygwin. Takes effect when logs show that services and wars are copied to server generated folder and app is loading its startup stuff to the log file.

Original post about manual intervention:

[1] Undeploy all applications from Glassfish

Community
  • 1
  • 1
mico
  • 12,730
  • 12
  • 59
  • 99