This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
"Use Entity Manager" context-sensitive menu in an EJB converts: @Stateless public class EmployeeBean { } TO @Stateless @PersistenceContext(name = "persistence/LogicalName", unitName = "org.sample_schema-gen_war_1.0-SNAPSHOTPU") public class EmployeeBean { @Resource private javax.transaction.UserTransaction utx; protected void persist(Object object) { try { Context ctx = (Context) new InitialContext().lookup("java:comp/env"); utx.begin(); EntityManager em = (EntityManager) ctx.lookup("persistence/LogicalName"); em.persist(object); utx.commit(); } catch (Exception e) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", e); throw new RuntimeException(e); } } } where as the simplified code can be: @Stateless public class EmployeeBean { @PersistenceContext EntityManager em; protected void persist(Object object) { em.persist(object); } }
What 'dev' build is used? Looks similar to http://netbeans.org/bugzilla/show_bug.cgi?id=195993 is it maven project?
7.2 with Maven is used. Yes, it seems similar to http://netbeans.org/bugzilla/show_bug.cgi?id=195993.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss