Bug 166210 - IOException when creating entity class from scratch
IOException when creating entity class from scratch
Status: VERIFIED FIXED
Product: javaee
Classification: Unclassified
Component: Persistence
6.x
All All
: P1 (vote)
: 6.x
Assigned To: issues@javaee
issues@javaee
:
: 165774 (view as bug list)
Depends on: 166417
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-28 18:21 UTC by Andrei Badea
Modified: 2009-06-17 09:39 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Stack trace (6.31 KB, text/plain)
2009-05-28 18:22 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2009-05-28 18:21:33 UTC
[ Self-compiled build of main from 5/28/2009 ]

1. Register persistence provider library (I used EclipseLink).

2. Create new Java application, right-click Libraries node, add persistence provider library.

3. Create new class.

4. Before the class declaration insert "@Entity". Fix imports.

The attached exception keeps occurring.
Comment 1 Andrei Badea 2009-05-28 18:22:05 UTC
Created attachment 82935 [details]
Stack trace
Comment 2 Petr Jiricka 2009-05-28 21:49:56 UTC
Sounds nasty - Tomas, can you please take a look? Thanks.
Comment 3 Tomas Mysik 2009-05-29 09:03:59 UTC
Looks like related to changes done for issue #158261.
Comment 4 Vitezslav Stejskal 2009-05-29 10:35:45 UTC
According to Andrei's testing this apparently does not happen in release67. Andrei if I'm wrong please change the
version back to 6.7 and rise the priority. Thanks

CCing tzezula, Tomasi, have there been any changes recently in the way how classindex fires events? Thanks
Comment 5 Petr Blaha 2009-05-29 10:53:50 UTC
Upgrading to P1 because the bug is reproducible in RC1 build 2009-05-28_22-43-49. The bug should be resolved in RC2.
Comment 6 Tomas Zezula 2009-05-29 10:57:16 UTC
No changes in this code during last month.
The problem is still there and is a consequence of some other problems, unlike Scala the Java is not very well designed for writing concurrent applications.
One of such a problem (probably not causing this) is directly in AnnotationModelHelper.runCallable(...)
which sets a userActionTaskThread,  but the unset is not done in the finally block directly following the set.
What if the AnnotationModelHelper is called from the scheduled task which injects the user action task => the thread firing events == userActionTaskThread
and this exception is thrown. This should be very hard to reproduce as this requires a race among action and event.
Comment 7 Tomas Zezula 2009-05-29 10:58:26 UTC
The question is: "Is the bug is assigned to the correct module?"
Comment 8 Vitezslav Stejskal 2009-05-29 11:38:43 UTC
"This should be very hard to reproduce as this requires a race among action and event." - I witnessed Petr reproducing
it without even trying.

"Is the bug is assigned to the correct module?" - Maybe not, but at first it looked like a regression in P&I.
Comment 9 Vitezslav Stejskal 2009-05-29 12:57:04 UTC
http://hg.netbeans.org/jet-main/rev/d2f97723c7b0 works around the problem. File index does not have to be invalidated
when a file is modified, because it does not use any information from the file besides its name.

Of course this does not solve the problem, because other indexes including java _are_ invalidated and so if somebody
asked these indexes the situation would reappear. Anyway, the fix above seems to work in trunk and is safe enough to
apply to release67, if needed.

And I'm passing this back to j2ee/persistance as I tend to agree with what tzezula explained.
Comment 10 Tomas Zezula 2009-05-29 13:03:45 UTC
I will add assertions into the java module ensuring that the events are fired by the task processor dispatch thread.
Comment 11 Tomas Zezula 2009-05-29 14:04:00 UTC
We (Andei + me) also found another problem (now in the parsing API) which may cause these problems. I've added some asserts and under some cases I am 
able to violate event contract and fire even from non dispatching thread.
Comment 12 Tomas Zezula 2009-05-29 14:14:48 UTC
Added asserts:
http://hg.netbeans.org/jet-main/rev/2323d863ad06
Comment 13 Quality Engineering 2009-05-30 06:45:00 UTC
Integrated into 'main-golden', will be available in build *200905300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2323d863ad06
User: Tomas Zezula <tzezula@netbeans.org>
Log: #166210:IOException when creating entity class from scratch
Comment 14 Marian Mirilovic 2009-06-01 11:34:59 UTC
Tomas / Vita,
this issue is considered as a stopper for RC2/FCS. Proceed with bugfix into release67 ASAP, thanks in advance.
Comment 15 Vitezslav Stejskal 2009-06-02 16:29:06 UTC
The workaround (d2f97723c7b0) was transplanted to release67 clone as http://hg.netbeans.org/release67/rev/d16891a2f8aa.
Comment 16 Vitezslav Stejskal 2009-06-02 16:36:05 UTC
There is a follow-up issue #166417 to fix this problem correctly.
Comment 17 Jindrich Sedek 2009-06-05 09:58:54 UTC
verified in RC2
NetBeans IDE 6.7 RC2 (Build 200906042131)
Comment 18 Petr Jiricka 2009-06-17 09:39:30 UTC
*** Issue 165774 has been marked as a duplicate of this issue. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo