Код: Выделить всё
java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName myApp
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.init(EntityManagerWrapper.java:130)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.doTxRequiredCheck(EntityManagerWrapper.java:148)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.doTransactionScopedTxCheck(EntityManagerWrapper.java:141)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:268)
at politse.ejb.RequestBean.createParliament(RequestBean.java:109)
Код: Выделить всё
@Named("requestBean")
@RequestScoped
@Stateful
public class RequestBean {
PersistenceContext(unitName="myApp")
private EntityManager em;
public void createParliament(String parliamentId)
{
Parliament wst = new Parliament(parliamentId);
em.persist(wst); //exception here
}
}
Код: Выделить всё
jdbc/MySQLPool
false
Подробнее здесь: https://stackoverflow.com/questions/798 ... ncecontext
Мобильная версия