NamingManager.setInitialContextFactoryBuilder(new MyInitialcontextFactoryBuilder());
InitialContext ic = new InitialContext();
EmbeddedDataSource ds = new EmbeddedDataSource();
ds.setDatabaseName("target/test");
ds.setCreateDatabase("create");
ic.bind("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/derbyds)", ds);
PersonServiceImpl personService = new PersonServiceImpl();
EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
EntityManager em = emf.createEntityManager();
personService.setEntityManager(em);
em.getTransaction().begin();