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 20080724040119) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13 System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb) Description: ============ Start IDE and try to generate JDA project with db connection and check query which is set in view class ... there is default string which is not correct : SELECT o FROM Object o but if I change it to proper query string then project can be run but no data are loaded in table from db. There seems to be deeper problem. The layout of view class is generated incorrectly as well. It doesn't contain textfields as usual. Another issue appears when I try to generate Project with Master/Detailed Table. But It could be the consequence of previous one. The results are: view class is generated with compilation errors, query is wrong and during creating of project NPE is thrown which comes from j2ee module. I can't evaluate if this is a form or j2ee issue, so please reassign it to appropriate component if needed. StackTrace: =========== java.lang.NullPointerException at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$EntityClassGenerator.generateRelationship(JavaPersistenceGenerator.java:911) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$ClassGenerator.run(JavaPersistenceGenerator.java:657) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:422) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:419) at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:916)
Created attachment 65509 [details] 141509
The described problems (e.g. incorrectly generated Java Desktop application) are caused by the fact that newly generated entity doesn't appear in the model e.g. EntityMappingsMetadata.getRoot().getEntity() returns an empty array. I am not able to evaluate the attached exception, but I believe that it will have the same root as the problem with EntityMappingsMetadata.getRoot().getEntity(). Reassigning to j2ee/persitence for evaluation.
For the NPE, I do have another bug 139804 reported. But I'm not able to find a reproducible case for it. Honza, can you help me reproduce issue 139804? Thanks. Also, I can not even make a compilable JDA with table from a yesterday's build. Is this thing working at all?
Ok, I see the NPE on the console all the time now, which is breaking the whole application. But I still don't understand why it is happening. I tried the same application in M1, it worked fine. The Web applications also work fine in the latest code. The NPE is from when trying to generate the relationship field, it can not find the TypeElement of the other class (workingCopy.getElements().getTypeElement("the.class.on.the.other.side.of.relationship") returns null). Is this a JavaSource issue?
Perhaps a compile on save issue?
No, it looks caused by the fix of issue 67270. The entity and related artifacts in the JDA project are generated while the project is being opened. If they were generated before opening the project, the project's sourcepath wouldn't be registered in GlobalPathRegistry and there would be no ClassIndex events for the generated entity, or the entity wouldn't be in ClassIndex at all, not sure now.
Nice try Jardo. The GlobalSourcePath is my class however the code causing regression was your contribution.
Thanks, Andrei, for looking into it!
Jarda will be OOO for next week. Tomas, any idea what could get wrong? You've seen the patch. The only change in fixing 67270 was that GlobalPathRegistry now fires later - i.e. after the project is opened (also after open project hook), but the content of all paths should be ok (all paths registered, just not fired - if I understand it right). Maybe Andrei could comment on that? Anyway, if this is tricky to be sorted out, can someone rollback the change until Jarda is back? Thanks
The problem is that form in the OpenProjectHook accesses metadata which are delayed by Jarda patch to the end of the OpenProjectHook.
Either form will change the code it generated the java code (I have no idea how yet) or the Jarda's patch needs to be rolled back.
If there are no objections I suggest to rollback the performance improvement causing this problem.
Ok, Tomas who is going to rollback Yarda's changes ?
Agreed with Tomas that he will rollback the Jarda's change.
After discussions fixed in GUI builder. http://hg.netbeans.org/main/rev/f2063fd3901f
verified on Product Version: NetBeans IDE Dev (Build 20080731042603) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13 System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)