AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), "foo");
appModule.setModuleId("rest");
appModule.getWebModules().add(webModule);
appModule.getEjbModules().add(new EjbModule(ejbJar));
appModule.getEjbModules().iterator().next().setModuleId(webModule.getModuleId());
annotationDeployer.deploy(appModule);
AppInfo appInfo = factory.configureApplication(appModule);
final AppContext application = assembler.createApplication(appInfo);
Context ctx = (Context) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{Context.class}, new InvocationHandler() {