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 73307 - sunddui module sometimes overwrites CmpResource Jndi name when CMP Entity wizard is invoked multiple times.
Summary: sunddui module sometimes overwrites CmpResource Jndi name when CMP Entity wiz...
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 8 (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on: 77344
Blocks:
  Show dependency tree
 
Reported: 2006-03-06 18:43 UTC by _ pcw
Modified: 2006-09-02 02:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2006-03-06 18:43:40 UTC
Attached is thread from nbj2ee discussing this bug. I haven't narrowed down
exact steps to reproduce, but I do know the code path that is being taken that
causes this (and thus I can fix it, just not sure exactly how I'm going to do
that yet.)

-------------------------------------

Thanks, these are roughly the scenarios where it seemed this might happen.  I
have not been able to reproduce it through my own tests, but I can see the code
path that allows it so I will come up with a way to fix it.

-Peter

Antonio Varela wrote:

> Peter,
>
>  I've added a new CMP Entity Bean from database. The table already existed.
> When the wizard finished I've checked the sun-ejb-jar file and found the
> cmp-resource changed to the name of the new entity bean (i.e.
> "jdbc/IbValorBean"). I'm using netbeans 5.0.
>
> Best regards
> Antonio.
>
>
> On 2/25/06, Antonio Varela <unixlibre@gmail.com> wrote:
>  
>
>> Peter,
>>
>>  In my experience: When new tables are added to the database, the new CMP
>> From Database Wizard has to be run. In most cases, I add several tables (not
>> just one), and thus several CMP EBJ's are ae dded with one wizard execution.
>> Next, I have to fix the problem with duplicated EJBs that are created.
>> Remember that EJBs with names like Whatever1EB are created for EJBs that
>> already existed. The fix  involves the visual manipulation of the
>> ejb-jar.xml file, deleting the unneeded relations, and then deleting the
>> new unneeded EJB's.
>>
>>  I'm not certain about when you end up with de CMP Resource modified. Can
>> be just when the Wizard finishes, of maybe after the visual ejb-jar
>> manipulation. I'm about to add a new bussiness components to my enterprise
>> app, and will take a note about this.
>>
>> Hope this helps.
>>
>> Best regards.
>> Antonio.
>>
>>
>> Once the wizard finishes, you end up with the CMP resource meodified to
>> the name of the last CMP EJB addedd.
>>
>> On 2/24/06, Peter Williams <pete.williams@sun.com> wrote:
>>   
>>> Hi Christian,
>>>
>>> I work on some of the code involved here, particulary the issue you
>>> describe in #2 below.
>>>
>>> Can you describe the circumstances underwhich the field was rewritten?
>>> I have examined the code and while I can see how this might happen, the
>>> conditions are unclear and probably involve multiple invocations of the
>>> new CMP's from Database wizard against multiple database connections,
>>> which would be rather odd.
>>>
>>> Can you give me a better description of when this happens?   I would
>>> really like to fix it.
>>>
>>> -Peter
>>>
>>> Christian Fischer wrote:
>>>
>>>     
>>>> Hi there,
>>>> i just noticed two minor bugs in  5.0 RC 1 related to cmp entity beans.
>>>> 1) When you change the name of a cmp field, Netbeans changs the name
>>>> inside the IDE and also applies the changes to the related set- and
>>>> get-methods. But it is not changed in the deployment descriptor
>>>> (/src/conf/sun-cmp-mappings.xml). I had to edit this manually.
>>>> 2) Sometimes when i restart Netbeans, the jndi name for the Cmp
>>>> Resource of my ejb module (visual editor for sun-cmp-mappings.xml) is
>>>> not set correctly. In my case this should simply be "jdbc/mysql" but
>>>> sometimes the name is set to the jndi name of one of my enterprise
>>>> bean. Just entering the correct name again solves this problem, at
>>>> least until you don't restart Netbeans.
Comment 1 _ pcw 2006-06-06 07:48:48 UTC
Due to changes in how the JdbcResource named by cmp-resource is now being
created in NB 5.5 (see issue 77344), this bug is likely to become "fixed by
virtue becoming dead code".  That conclusion will have to wait until 77344 is
fixed though.
Comment 2 _ pcw 2006-09-02 02:58:09 UTC
77344 has been fixed, so closing this issue.  Code path that handles this
capability has been completely redone so the cause of this original problem no
longer applies.