Problems undeploying war...

Hi,
We have an app (created in the days of Vaadin 7) which we deploy as a war under Tomee. We use CDI. When we want to deploy a new version we issue commands like:
http://127.0.0.1:80/manager/text/undeploy?path=/abc123
http://127.0.0.1:80/manager/text/deploy?path=/abc123&war=OurCode.war

This worked nicely when we were using Vaadin 7. However after we moved to Vaadin 8 (8.1.6), when we try to undeploy we get this error:
“FAIL - Unable to delete [C:\Program Files.…\tomee\webapps\abc123]
. The continued presence of this file may cause problems.”

Under the abc123 context WEB-INF\lib, tomee hasn’t undeployed deltaspike-core-api-1.7.2.jar and jsoup-1.8.3.jar

I think this is all CDI-related. This problem occurs if we simply start Tomee then try to undeploy (I.e we’ve started no sessions since it’s been running). As I understand it, deltaspike is used by CDI (we are using vaadin-cdi-2.0.0.jar). So the only thing (I think) that really happens in a CDI sense is during the standard Tomee startup, it does its ‘discovery’ for contexts and scopes, and it appears that these are held onto even when you undeploy the abc123 context.

Has anyone got any ideas, is there some cleanup to do somewhere which would fix this undeploy problem?
Thanks

I found a work-around (quite simple really) - after getting the ‘failed to undeploy’ message I simply sleep then retry. I found after several seconds (repeating in a loop), eventually the undeploy completes. Sometimes it’s successful after 7 seconds, sometimes 12. Quite a variation.

So it seems that previously (Vaadin 7) it’d undeploy in approx 1.2 seconds, but now (Vaadin 8) it aborts after 1.2 seconds. That initial request to undeploy never completes, but if I pause long enough and repeat the undeploy, it succeeds.

Does this sound familiar to anyone? Are we missing something, should we be calling some cleanup routine before undeploying, or should we just stick with this?