InitialContext ctx = new InitialContext();
EntityManagerFactory emf = (EntityManagerFactory)ctx.lookup("bpel/EntityManagerFactory");
if (null == emf) {
throw new IllegalStateException("EntityManagerFactory is null");
}
ds = new DefaultBPAFDataSource(emf);
}
catch (NamingException e)
{
throw new RuntimeException("Failed to initialize BPAF datasource");
}