geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Weber <webe...@gmail.com>
Subject How do you access a GBean via JNDI?
Date Fri, 23 Jan 2009 09:47:08 GMT

Hi,

right now I access a GBean from a servlet using (is that the correct way?)

Kernel kernel = KernelRegistry.getSingleKernel();
URI uri = new URI(myuri);
AbstractName gBeanAN = new AbstractName(uri);
retVal = kernel.invoke(gBeanAN,"myMethod",args,paramTypes);
       
with myuri from the abstractName field of the GBean in JMX Viewer in
Console, which is quite a long uri.
Also you need Geronimo-specific code in a JEE application.

So I tried to bind the GBean into JNDI as suggested in
http://www.nabble.com/How-to-get-hold-of-a-WorkManager-in-a-web-app--td21400861s134.html

<gbean name="...BeanBinding"
class="org.apache.geronimo.gjndi.binding.GBeanBinding">
        <attribute name="name">...</attribute>
        <attribute name="abstractNameQuery">?name=MyJNIGBean#</attribute>
        <reference name="Context">
            <name>JavaContext</name>
        </reference>
    </gbean>

but then I get Classnotfound for GBeanBinding. How do you specify a
dependency for this class?
and what is the abstractNameQuery for the GBean? the full AbstractName ?

Thanks,
Juergen
-- 
View this message in context: http://www.nabble.com/How-do-you-access-a-GBean-via-JNDI--tp21621410s134p21621410.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message