properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
properties.setProperty(Context.PROVIDER_URL, "http://" + LOCALHOST + ":" + configuration.getHttpPort() + "/openejb/ejb");
InitialContext context = new InitialContext(properties);
File file = moduleIds.get(archive.getName());
Deployer deployer = (Deployer) context.lookup("openejb/DeployerBusinessRemote");
deployer.undeploy(file.getAbsolutePath());
FileUtils.delete(file.getParentFile()); // "i" folder
} catch (Exception e) {
e.printStackTrace();
throw new DeploymentException("Unable to undeploy", e);