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 76691 - CMP bean (from DB) has invalid implements clause
Summary: CMP bean (from DB) has invalid implements clause
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords: RANDOM
: 72387 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-22 17:00 UTC by Jan Horvath
Modified: 2007-01-05 13:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
assertion stack trace (1.08 KB, text/plain)
2006-09-21 15:32 UTC, Daniel Prusa
Details
patch for release55 (1.20 KB, patch)
2006-09-21 16:05 UTC, Daniel Prusa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2006-05-22 17:00:20 UTC
build 200605220200

-create new J2EE 1.4 Enterprise Application
-create CMP beans from Database
-ERROR some of created beans has invalid implements clause:

public abstract class ProductBean implements javax.ejb.EntityBean {
    pr, test.ProductLocalBusinessivate javax.ejb.EntityContext context;
Comment 1 Martin Adamek 2006-06-05 16:02:44 UTC
I cannot reproduce. Marking as RANDOM.
Comment 2 Daniel Prusa 2006-06-14 14:28:37 UTC
*** Issue 72387 has been marked as a duplicate of this issue. ***
Comment 3 Lukas Jungmann 2006-06-27 15:39:24 UTC
this is also valid for normal CMPs (not from DB)
Comment 4 Martin Adamek 2006-07-10 14:56:29 UTC
Dane, can you please check also this one?
Comment 5 Daniel Prusa 2006-09-18 13:46:48 UTC
I am not able to reproduce this issue in the latest builds. In fact, I have
never managed to reproduce it on my machine (Windows XP). There were made
several bugfixes in the javacore module and also in the related CMP beans
generator, it is possible that the problem has been already fixed.

Honzo, can you still reproduce it? If so, is it reproducible manually or in
tests only?
Comment 6 Jan Horvath 2006-09-18 17:28:51 UTC
Dane, I'm not able to reproduce this in the latest daily build
Comment 7 Lukas Jungmann 2006-09-18 18:15:16 UTC
I can still see this randomly in automated tests. Last time I saw this was in
build around September 7th-8th (note that I've been on vacation last week).
Comment 8 Lukas Jungmann 2006-09-19 14:50:30 UTC
I've just went through the history of our test results and I've found that this
is reproducible also in build:

-------------------------------------------------------------------------------
>Log Session: Monday, September 18, 2006 7:22:21 PM CEST
>System Info: 
  Product Version         = NetBeans 5.5 Dev (Build 200609181130)
  Operating System        = Windows 2003 version 5.2 running on amd64
  Java; VM; Vendor; Home  = 1.6.0-rc; Java HotSpot(TM) 64-Bit Server VM
1.6.0-rc-b95; Sun Microsystems Inc.; E:\space\jdks\jdk1.6.0\jre
  System Locale; Encoding = en_US (nb); Cp1252

steps done by the test case which failed:
-create new ejb module with J2EE 1.4 spec version
-create local session bean
-create remote session bean
-create session bean w/ local and remote interfaces

=> LocalAndRemoteSessionLocal interface is:

public interface LocalAndRemoteSessionLocal extends EJBLocalObject {
       , ejbs.LocalAndRemoteSessionLocalBusiness  

}
Comment 9 Jan Horvath 2006-09-19 16:27:04 UTC
this is now reproducible only in automated tests, decreasing priority to P3
Comment 10 Daniel Prusa 2006-09-21 15:27:49 UTC
The problem seems to be reproducible on a dual processor machine only. To
reproduce it, it requires to make several attempts, about ten, and it does not
always result in an incompilable source code, it is also possible to obtain an
assertion reporting that there is a resource without classes while a class was
expected there. In the case of assertion, the sources are compilable, but one
interface is missing in the 'implemets' section.

By inspecting the code, the critical part of CMP generating process could be in
EjbGenerationUtil.generateClass(). The following actions take place there:
- create a file object with 'java' extension
- fill the content of the file with output of transformation performed on a xml
template
- indent the content of the file by indentation engine, write output to string
writer
- retrieve document, remove its content and set the string from string writer as
the new content

It is possible that this sequence of steps leads to some race conditions,
temporal inconsistencies between jmi data and sources, but I have not found the
exact cause. On the other hand, it seems the problem disappers when reparse is
forced on the generated source file. I have not manage to reproduce the problem
after adding this.

I will commit related fix into release55_dev, if it is confirmed by QE that this
helps, we can merge the fix into release55.
Comment 11 Daniel Prusa 2006-09-21 15:32:04 UTC
Created attachment 34310 [details]
assertion stack trace
Comment 12 Daniel Prusa 2006-09-21 15:56:00 UTC
Fixed in release55_dev:

/cvs/j2ee/ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/codegeneration/EjbGenerationUtil.java
new revision: 1.1.2.4.2.4.2.1; previous revision: 1.1.2.4.2.4
Comment 13 Daniel Prusa 2006-09-21 16:05:13 UTC
Created attachment 34314 [details]
patch for release55
Comment 14 Lukas Jungmann 2006-09-26 16:53:21 UTC
The proposed fix did not help. Reproduced again in tests... :(
Comment 15 Erno Mononen 2007-01-05 13:50:43 UTC
The whole EJB generation functionality has been rewritten to Retouche, so I 
assume this issue is no longer relevant. Please reopen if the issue is still 
reproducible in your tests.