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.
Product Version = NetBeans IDE Dev (Build 201110070600) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0 Runtime = Java HotSpot(TM) 64-Bit Server VM 21.0-b17 - insert code - Use entity manager worked fine for the first time and generated expected @PersistenceContext(unitName="WebAppJUnitPU") private EntityManager em; (as part of the tuturial "testing unins embedded container) After a problem, I changed some code. No, NB marks em as wrong. I deleted this code and tried to re-insert as abocve. NetBeans generated this code instead: public void persist(Object object) { /* Add this to the deployment descriptor of this module (e.g. web.xml, ejb-jar.xml): * <persistence-context-ref> * <persistence-context-ref-name>persistence/LogicalName</persistence-context-ref-name> * <persistence-unit-name>WebAppJUnitPU</persistence-unit-name> * </persistence-context-ref> * <resource-ref> * <res-ref-name>UserTransaction</res-ref-name> * <res-type>javax.transaction.UserTransaction</res-type> * <res-auth>Container</res-auth> * </resource-ref> */ try { Context ctx = new InitialContext(); UserTransaction utx = (UserTransaction) ctx.lookup("java:comp/env/UserTransaction"); utx.begin(); EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/LogicalName"); em.persist(object); utx.commit(); } catch (Exception e) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", e); throw new RuntimeException(e); } } BTW NetBeans behavior nor is abnormal. I inserted the code above by copy and paste. In the meantime I copied and pasted some other code outside of NB. Pasting here (or in NB editor) will still paste the same olld text :( I really don't know what happened. Sorry, I don't know how to reproduce it. The only thing I'm able to do, is to add some logs. And, just now, after _cutting_ and copying, clipboard is ok inside NB works again. Dubious...
Created attachment 111705 [details] messages
Created attachment 111706 [details] dump
Oops, I tried to insert into the entity instead of the bean. My fault. Thus I close this issue. The only dubious thing is the behavior of the clipborad...