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.

Bug 130535 - Empty list of entity classes
Summary: Empty list of entity classes
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-19 15:47 UTC by Jan Horvath
Modified: 2008-03-26 16:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test project (26.00 KB, application/x-gzip)
2008-03-19 15:48 UTC, Jan Horvath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2008-03-19 15:47:50 UTC
Product Version: NetBeans IDE Dev (Build 200803171203)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.2 running on i386; MacRoman; en_US (nb)

-create web project (java EE 5)
-create persistence unit
-create entity classes from sample database
-try to create JSF from entity classes
-ERROR: list of entity classes in the wizard is empty

-test project is attached
Comment 1 Jan Horvath 2008-03-19 15:48:36 UTC
Created attachment 58674 [details]
test project
Comment 2 Dan Kolar 2008-03-19 17:07:02 UTC
With my own build 080318 everything works as desired. I used sample and vir databases.
Problem is in absence of persistence library in Tomcat, so all entity classes are uncompillable and thats clear the
reason, why JSF Pages from entity classes doesn't "see" them. If you change server to Glassfish v2, all is ok - project
compillable and classes visible in wizard. If you made some class uncompillable - it no longer can be used for
generating jsf.
So this issue is about missing persistence library in Tomcat 6.0, not about incorrect behavior of wizard.
Marking as invalid.
Comment 3 _ potingwu 2008-03-19 17:46:04 UTC
Sometimes I see the delay if my IDE is loading other big project, the list shown ~20-30 sec. later. I believe the slow
network may affect as well.

By eventually the list shown.
Comment 4 Jan Horvath 2008-03-19 19:16:23 UTC
I can still reproduce the issue even if I add toplink to the project classpath.
I've used a fresh IDE with clean userdir, ant Tomcat 6.0 as a server.
Comment 5 Matthew Bohm 2008-03-19 20:50:02 UTC
Note: I am not familiar with our requirements for Tomcat support. Marking target milestone as 6.1 for now, so the issue
will not be considered unevaluated.
Comment 6 Matthew Bohm 2008-03-20 05:25:09 UTC
Please clarify the Tomcat requirements for the release, if possible.
Comment 7 Jan Horvath 2008-03-20 09:43:44 UTC
list of supported servers is here:
http://wiki.netbeans.org/DatabasesAndApplicationServers
Comment 8 Jan Horvath 2008-03-20 09:47:00 UTC
lowering priority because the issue is reproducible only with Tomcat
Comment 9 Dan Kolar 2008-03-20 13:35:06 UTC
Tried it with continuous build  (Build 20080320063641) and just can't reproduce it.
I tried both JPA and Hibernate, but when as toplink library is added and hence errors resolved, wizard see all entity
classes.
Matthew, are you able to reproduce it?
Comment 10 Matthew Bohm 2008-03-21 02:35:53 UTC
I can reproduce the problem, sort of. From what I can tell, it has nothing to do with Tomcat or Glassfish--the behavior
occurs with either appserver. As soon as the progress bar associated with generating the entity classes disappears,
right-click (it's faster) the project and quickly choose JSF Pages from Entity Class, before the entity classes have
finished compiling. The list of entities is then shown as empty. However, just cancel, or press the back button in the
wizard, and then try again. Since the entity classes have now finished compiling, they show up. I have to play the IDE a
little like a video game to make this happen.

If this is the actual problem, I do not think there is anything to be done, and we would just close the issue.



Comment 11 Matthew Bohm 2008-03-21 02:37:37 UTC
Just marking incomplete, to get confirmation from jhorvath that the problem is as I have diagnosed.
Comment 12 Jan Horvath 2008-03-21 10:46:23 UTC
I've just reproduced it on another MacOSX machine. I wait after the entity classes are compiled, then invoke the wizard. 100% reproducible for me. 
Comment 13 Matthew Bohm 2008-03-21 20:47:41 UTC
Then you must be doing something we are not attempting, because I cannot otherwise reproduce it on glassfish or tomcat.

If possible, please provide *very* detailed steps explaining exactly how to reproduce the issue. (Or, if the resulting
files would not be too big, maybe we can make screen capture videos for this sort of thing?)

By the way, you mentioned it is only on Tomcat. Is it also only on Mac? dkolar, have you tried it on Tomcat+Mac?

Comment 14 Jan Horvath 2008-03-21 22:04:44 UTC
Matthew did you already tried the steps above on the MacOSX?
Comment 15 Matthew Bohm 2008-03-22 06:03:30 UTC
No, I rarely have to seek out a Mac like this. But apparently this is one of those cases. So it is Tomcat+Mac only for
you, then? Does this happen for you on Tomcat+XP?
Comment 16 Matthew Bohm 2008-03-22 08:42:00 UTC
I just came across something very like the problem on XP. When you run the Entities from DB wizard, try making sure the
checkbox for generating named queries is selected. Once that is done, do you see an error message in the entities to the
effect of "named queries can only be used on an entity class"--implying that the class is no longer recognized as an
entity class? I did see this, in which case the list of entity classes in the JSF CRUD wizard was empty. The workaround
was to go into each entity class and modify the class by adding a space somewhere and saving the file, modifying and
saving like this several times if necessary, until the class was again recognized as an entity class.

Is this consistent with what you are seeing?
Comment 17 Jan Horvath 2008-03-25 11:12:55 UTC
Looks like some problem with the model, reassigning to Andrei
Comment 18 Andrei Badea 2008-03-26 16:00:33 UTC
The issue really seems to be that the persistence unit wizard did not add the persistence provider to the classpath.
Fixed, and also added a message to the JSF wizard warning the user that a persistence provider needs to be on the
classpath. A nicer fix could have been to just temporarily add the persistence provider to the classpath of the entity
class model, but that would be too risky so late in the release cycle.

Fixed in c3537ed61a0e.