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.
Refer to issue #74629 to set up tables for this issue + Right click a tab in the Editor Window, and select "Close All Documents" + Open "ejb-jar.xml" and view the CMR tab + Open "sun-ejb-jar.xml" + Select the Customers bean + Click on the "map relationship" column for the ordersBean field. + Observe the first dialog and notice that things look OK. + Click "Cancel" + Go back to "ejb-jar.xml" + Select the OrdersBean-CustomerBean relation and click "Edit" + Uncheck the "Create CMR Field" for the OrdersBean on the left. + Click "OK" + Return to "sun-ejb-jar.xml" + Select CustomerBean + Click on the "map relationship" column for the ordersBean field. + Observe the Red X box for the "Related Field" + Click "Cancel" + Go back to "ejb-jar.xml" + Select the OrdersBean-CustomerBean relation and click "Edit" + Reverse the Relationship + On the left hand side, select "CustomerBean" from the drop down + Place "Customer-has-orders" in the Role Name + Select the "One" check box + Select "Cascade Delete" + Select "Create CMR Field" + Put "orders" in "Field Name" + On the right hand side, select "OrdersBean" from the drop down + Make Role Name blank + Select the "Many" checkbox + Ensure "Cascade Delete" is unchecked + Ensure "Create CMR Field" is unchecked + Click "OK" + Return to "sun-ejb-jar.xml" + Select CustomerBean + Click on the "map relationship" column for the orders field. + Observe "Related Bean" now says "<Choose Related Class>" and that the "..." button is diabled. + Observe "Related Field" is empty + Observe "Primary Table" is "<unmapped>" + Observer "Next >" button is disabled. + Click "Cancel" + Go back to "ejb-jar.xml" + Delete the "OrdersBean-CustomerBean" relation + Create a new Relation, following the previous scenario + Observe in "sun-ejb-jar.xml" the same symptoms + Close NetBeans + Select "Save All" + Open NetBeans + Observe that only the "ejb-jar.xml" window is open, rather than both "ejb-jar.xml" and "sun-ejb-jar.xml" + Observe in the CMR tab that the Original OrdersBean-CustomerBean relation that we both renamed and deleted is still there. I have also been getting NPE's around this time, but I haven't got a duplicating scenario for this
Thanks for reporting. According to bug priority guidelines I am decreasing to P2.
The problem seems to be in the sunappserv plug-in, in the sun-ejb-jar.xml editor more specifically. Reassiging to Peter for better evaluation.
I reproduced this in NB 5.0 FCS, sort of -- I did observe the disabled ... button, etc. after both sets of detailed steps. I did _not_ observe the original relationship being "restored" on restart. In my case, it was as expected and both the CMP Relationships view and XML text reflected the editing actions performed. Did you check for any exceptions in the log file? Comment on sun config editor not being restored -- this is deliberate. Historically, there was/were a bug(s) that the point during startup the the config editor was being restored was before j2eeserver module and the project were fully initialized and it was causing problems, so we just disabled it. I have not had time to reinvestigate restoring this behavior, it is a low priority. Finally, in NB 5.5 release55/release55_beta branchs, the first block of steps (creating and viewing the entity beans for the first time) is showing several exceptions in the log and I observed that the relationship names are "null-1", etc. which is clearly wrong. There are further problems with the data in the sun configuration editor. Referring to Rochelle to fix the ... bug and file appropriate bugs on the NB 5.5 issues.
Peter, when I go to the CMP Relationships tab in the ejb-jar.xml multiview editor, all the relationships are named null-1, null-2, etc. I think the sun config editor for cmp mappings is getting the name from there. If you agree, and that is the only problem (causing the others), then I think the category should be switched to j2eeserver. What do you think?
Also, most of the exceptions during creation of the beans are NNModelBuilder exceptions which are filed as issue 73926.
I agree with you on the probably source of the "null-#" names, but that should be filed as a new bug. This bug should remain as representing the "disabled '...' button" in NB 5.0 under the steps described by the submitter. Near as I can tell, we can't reproduce this bug in NB 5.5 until the other issues you (and I) observed are fixed. At that point, I expectd we'd see the same behavior as exhibited in 5.0.
I filed the null naming issue as issue 75757. As far as the "..." -- it is supposed to be disabled in the EJB environment. CMR field info is only supposed to be setup in the ejb-jar.xml and related editors. Is there any part of this bug remaining? If not, let's close it. If so, let's setup dependencies on the null naming and NNModelBuilder issues.
I'm ok with closing it except that it seems odd that we would have a field that deliberately cannot be edited (e.g. the disabled ... button) where the associated combo says "<Choose Related Class>", which implies to me that it _can_ be edited. Of course, if this is just misleading UI, it's definitely not a P2 and should be downgraded at least to P3. If you concur, it would also be good to know what the UI should actually display for this case (e.g. empty disabled combox instead for example.) I don't have enough domain expertise to evaluate what correct UI for this would or could be.
The related class should always be populated in the ejb environment, so if it is not, this is still a bug. Let's revisit this after the other issues are addressed - I've added them to the dependencies for this issue.
I took another look at this and see this behavior: 1) If I open sun-cmp-mappings editor and the map relationship wizard before removing the create cmr field checkbox, I end up with the red x problem described 2) If I discard changes on everything, then do it again before opening the map relationship dialog, things look okay. To me that sounds like there could be a missing delete cmr field event. Transferring back to Peter to debug the plugin's event handling.... However, given the description here, it is not a P2 - downgrading to P3.
Peter, both dependent issues are fixed and as I mentioned to you earlier, I suspect event notification problems. Does this belong in the new umbrella issue?
If this is J2EE 1.4, I don't think the event umbrella issue is related since that is JavaEE5 specific. I'll look into it.
Not sure what we are going to do with CMP relation ship events in 6.0 yet. We may have something in which case this issue will apply and should be considered.
please close this issue if you forgot to earlier. If this issue is still open, please change the target milestone to reflect the current commitment.
CMP UI not present in NB 6. "cmp" in whiteboard can be used to find these issues if we reenable the CMP UI.