The workaround could be ... InitialContext ctx = new InitialContext(); DataSource datasource = (javax.sql.DataSource) ctx.lookup ("java:/comp/env/jdbc/DS"); Map<String, Object> props = new HashMap<String, Object>(); props.put(Environment.DATASOURCE, dataSource); EntityManagerFactory emf = Persistence.createEntityManagerFactory(UNIT_NAME, props); ... It is checked in Tomcat 8.0.3 and entitymanager 4.3.5
|