Embedded embedded=new Embedded(logger);
String contextPath=servletContext.getRealPath("/");
File contextFile=new File(contextPath);
Engine engine=embedded.createEngine();
engine.setName(contextFile.getName());
engine.setAutoDeploy(false);
engine.setParentClassLoader(servletClassLoader);
UserDatabaseRealm userRealm=new UserDatabaseRealm();
engine.setRealmDatabase(userRealm);
embedded.setEngine(engine);
Context context=embedded.createContext(contextFile.getName(),contextFile.getAbsolutePath());
context.setAutoDeploy(false);
context.setReloadable(false);
engine.addChild(context);
try
{
embedded.start();
}