Can't create EntityManager

Posted by bovo on Stack Overflow See other posts from Stack Overflow or by bovo
Published on 2010-04-14T17:43:14Z Indexed on 2010/04/14 17:53 UTC
Read the original article Hit count: 360

Filed under:
|
|

New to EJB3, please help/explain.

Inside a session bean I declare an EntityManager as follow

@PersistenceContext(unitName="ScheduleUnit")
private EntityManager em;

and this works. But when I do this

private EntityManager em;
private EntityManagerFactory emf;

public void myFunction() {
  emf = Persistence.createEntityManagerFactory("ScheduleUnit");
  em = emf.createEntityManager();
}

I get the following error:

A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property

© Stack Overflow or respective owner

Related posts about java

Related posts about ejb3