Kernel kernel = PortletManager.getKernel();
DeploymentFactory factory = new DeploymentFactoryWithKernel(kernel);
DeploymentManager deploymentManager = factory.getDeploymentManager("deployer:geronimo:inVM", null, null);
DeploymentConfiguration deploymentConfiguration = deploymentManager.createConfiguration(webDeployable);
WebAppDConfigRoot configRoot = (WebAppDConfigRoot) deploymentConfiguration.getDConfigBeanRoot(ddBeanRoot);
WebAppDConfigBean webApp = (WebAppDConfigBean) configRoot.getDConfigBean(ddBean);
webApp.setContextRoot(data.getContextRoot());
EnvironmentData environment = new EnvironmentData();
webApp.setEnvironment(environment);