You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Joe Bohn <jo...@earthlink.net> on 2007/10/05 19:34:31 UTC

MEJB changes and MappedName

We've been hitting some errors in the TCK tests that validate mgmt with 
MEJB.  The main problem was that we were failing the name lookup:

javax.naming.NameNotFoundException: Name 
"java:openejb/Deployment/MEJBGBean/MEJB/javax.management.j2ee.Management" 
not found

I thought this was strange because we don't include the MEJBGBean any 
longer in the geronimo assembly and I could find no reference to it in 
the Geronimo code at all.

It turns out that we map to the "GBEAN" name when there is no mappedName 
specified in the Openejb code.  In o.a.openejb.config.GeronimoMappedName 
at line 65 there is this piece of code which Geronimo is apparently very 
dependent upon

if (null == mappedName && ref.getEjbRefName().equals("ejb/MEJB")) {
     ref.setMappedName("MEJBGBean/MEJB");
}

So I assume the mappedName must always be null and we need to force this 
  mapping for Geronimo?

Once I modified the name to match the newly enabled MEJB app's id, 
"mejb/ejb/mgmt/MEJB", then I finally started to see failures that 
matched what Anita indicated we should see without the correct 
authorization.

So what should we do with this openejb change?  We were hoping to 
release Geronimo 2.0.2 with openejb 3.0-beta-1 which has the old name 
still included.  There are probably other ways around this that would 
only require Geronimo (such as making the new name match the old name 
... but that's really ugly) or perhaps TCK configuration changes.  Any 
suggestions?

Joe

Re: MEJB changes and MappedName

Posted by Anita Kulshreshtha <a_...@yahoo.com>.
--- Joe Bohn <jo...@earthlink.net> wrote:

> 
> 
> Anita Kulshreshtha wrote:
> > --- Joe Bohn <jo...@earthlink.net> wrote:

> I think this code (or some form of it) is still needed and just
> making 
> the MEJBGBean a 'nop' will not resolve the problem.  With the code 
> completely removed from GeronimoMappedName (rather than just mapping
> it 
> to the new name) the mappedName in the ejbref eventually resolves to 
> "ejb/MEJB" which of course will not match "ejb/mgmt/MEJB". 

   The new MEJB is a regular session Bean. It should not require any
hardcoded mapping in openejb code. The old one can be made harmless by
making it do nothing. In other words both will be deployed. IIRC both
can coexist peacefully. The best solution still is to release a new
openejb. 


 It looks 
> like the MEJB reference in the app might be incorrect.  The spec 
> indicates the recommended name is "ejb/mgmt/MEJB".

    The name of the session bean is ejb/mgmt/MEJB.

Thanks
Anita

> 
> Joe
> 
> 
> > 
> > The following code in MEJBGBean (geronimo-openejb)
> > StatelessBean bean = ejbJar.addEnterpriseBean(new
> > StatelessBean("MEJB",MEJBBean.class.getName()));
> > 
> >    can be modified to replace MEJBBean with a dummy class in
> > geronimo-openejb. I have not tested this...
> >    If something can be changed in TCK that would be great.
> > 
> > Thanks
> > Anita
> > 
> >> So I assume the mappedName must always be null and we need to
> force
> >> this 
> >>   mapping for Geronimo?
> >>
> >> Once I modified the name to match the newly enabled MEJB app's id,
> 
> >> "mejb/ejb/mgmt/MEJB", then I finally started to see failures that 
> >> matched what Anita indicated we should see without the correct 
> >> authorization.
> >>
> >> So what should we do with this openejb change?  We were hoping to 
> >> release Geronimo 2.0.2 with openejb 3.0-beta-1 which has the old
> name
> >>
> >> still included.  There are probably other ways around this that
> would
> >>
> >> only require Geronimo (such as making the new name match the old
> name
> >>
> >> ... but that's really ugly) or perhaps TCK configuration changes. 
> >> Any 
> >> suggestions?
> >>
> >> Joe
> >>
> > 
> > 
> > 
> >      
>
____________________________________________________________________________________
> > Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get
> listings, and more!
> > http://tv.yahoo.com/collections/3658 
> > 
> 



       
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

Re: MEJB changes and MappedName

Posted by Joe Bohn <jo...@earthlink.net>.

Anita Kulshreshtha wrote:
> --- Joe Bohn <jo...@earthlink.net> wrote:
> 
>> We've been hitting some errors in the TCK tests that validate mgmt
>> with 
>> MEJB.  The main problem was that we were failing the name lookup:
>>
>> javax.naming.NameNotFoundException: Name 
>>
> "java:openejb/Deployment/MEJBGBean/MEJB/javax.management.j2ee.Management"
>> not found
>>
>> I thought this was strange because we don't include the MEJBGBean any
>>
>> longer in the geronimo assembly and I could find no reference to it
>> in 
>> the Geronimo code at all.
>>
>> It turns out that we map to the "GBEAN" name when there is no
>> mappedName 
>> specified in the Openejb code.  In
>> o.a.openejb.config.GeronimoMappedName 
>> at line 65 there is this piece of code which Geronimo is apparently
>> very 
>> dependent upon
>>
>> if (null == mappedName && ref.getEjbRefName().equals("ejb/MEJB")) {
>>      ref.setMappedName("MEJBGBean/MEJB");
>> }
> 
>     I believe this code is there because the old MEJB was a plain
> GBean. I am not very familiar with openejb code. This code is probably
> not needed any more. If we do not want to release antoher openejb, we
> could try making MEJBGBean a 'nop' EJB. This is not gong to be any less
> ugly..

I think this code (or some form of it) is still needed and just making 
the MEJBGBean a 'nop' will not resolve the problem.  With the code 
completely removed from GeronimoMappedName (rather than just mapping it 
to the new name) the mappedName in the ejbref eventually resolves to 
"ejb/MEJB" which of course will not match "ejb/mgmt/MEJB".  It looks 
like the MEJB reference in the app might be incorrect.  The spec 
indicates the recommended name is "ejb/mgmt/MEJB".

Joe


> 
> The following code in MEJBGBean (geronimo-openejb)
> StatelessBean bean = ejbJar.addEnterpriseBean(new
> StatelessBean("MEJB",MEJBBean.class.getName()));
> 
>    can be modified to replace MEJBBean with a dummy class in
> geronimo-openejb. I have not tested this...
>    If something can be changed in TCK that would be great.
> 
> Thanks
> Anita
> 
>> So I assume the mappedName must always be null and we need to force
>> this 
>>   mapping for Geronimo?
>>
>> Once I modified the name to match the newly enabled MEJB app's id, 
>> "mejb/ejb/mgmt/MEJB", then I finally started to see failures that 
>> matched what Anita indicated we should see without the correct 
>> authorization.
>>
>> So what should we do with this openejb change?  We were hoping to 
>> release Geronimo 2.0.2 with openejb 3.0-beta-1 which has the old name
>>
>> still included.  There are probably other ways around this that would
>>
>> only require Geronimo (such as making the new name match the old name
>>
>> ... but that's really ugly) or perhaps TCK configuration changes. 
>> Any 
>> suggestions?
>>
>> Joe
>>
> 
> 
> 
>       ____________________________________________________________________________________
> Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
> http://tv.yahoo.com/collections/3658 
> 

Re: MEJB changes and MappedName

Posted by Anita Kulshreshtha <a_...@yahoo.com>.
--- Joe Bohn <jo...@earthlink.net> wrote:

> We've been hitting some errors in the TCK tests that validate mgmt
> with 
> MEJB.  The main problem was that we were failing the name lookup:
> 
> javax.naming.NameNotFoundException: Name 
>
"java:openejb/Deployment/MEJBGBean/MEJB/javax.management.j2ee.Management"
> 
> not found
> 
> I thought this was strange because we don't include the MEJBGBean any
> 
> longer in the geronimo assembly and I could find no reference to it
> in 
> the Geronimo code at all.
> 
> It turns out that we map to the "GBEAN" name when there is no
> mappedName 
> specified in the Openejb code.  In
> o.a.openejb.config.GeronimoMappedName 
> at line 65 there is this piece of code which Geronimo is apparently
> very 
> dependent upon
> 
> if (null == mappedName && ref.getEjbRefName().equals("ejb/MEJB")) {
>      ref.setMappedName("MEJBGBean/MEJB");
> }

    I believe this code is there because the old MEJB was a plain
GBean. I am not very familiar with openejb code. This code is probably
not needed any more. If we do not want to release antoher openejb, we
could try making MEJBGBean a 'nop' EJB. This is not gong to be any less
ugly..

The following code in MEJBGBean (geronimo-openejb)
StatelessBean bean = ejbJar.addEnterpriseBean(new
StatelessBean("MEJB",MEJBBean.class.getName()));

   can be modified to replace MEJBBean with a dummy class in
geronimo-openejb. I have not tested this...
   If something can be changed in TCK that would be great.

Thanks
Anita

> 
> So I assume the mappedName must always be null and we need to force
> this 
>   mapping for Geronimo?
> 
> Once I modified the name to match the newly enabled MEJB app's id, 
> "mejb/ejb/mgmt/MEJB", then I finally started to see failures that 
> matched what Anita indicated we should see without the correct 
> authorization.
> 
> So what should we do with this openejb change?  We were hoping to 
> release Geronimo 2.0.2 with openejb 3.0-beta-1 which has the old name
> 
> still included.  There are probably other ways around this that would
> 
> only require Geronimo (such as making the new name match the old name
> 
> ... but that's really ugly) or perhaps TCK configuration changes. 
> Any 
> suggestions?
> 
> Joe
> 



      ____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
http://tv.yahoo.com/collections/3658