I doesn´t work. I can obtain EJB local interface. I think this lines work as
if I do new InitialContext() without parameters.

I would like to obtain the interface as we do with EJB 3.0. I try it adding
this lines to source code...

@EJB(name="TeamBeanRemote")
TeamRemote local=null;

-- and adding a ejb-ref to gbean tag as this:


<gbean name="TestGBean" class="com.test.SSEGBean">
        <attribute name="port">4201</attribute>
        <attribute name="host">localhost</attribute>
        <ejb-ref>
        <ref-name>TeamBeanRemote</ref-name>
        <nam:pattern
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1";>
           <nam:artifactId>test_ejb3</nam:artifactId>
           <nam:name>test_ejb3</nam:name>
        </nam:pattern>
        </ejb-ref>
  </gbean>


.. but It doesn´t work.  Can I use EJB3.0 annotations inside Gbean?



Jacek Laskowski wrote:
> 
> On Jan 8, 2008 8:24 AM, ivanrc <[EMAIL PROTECTED]> wrote:
> 
>> How can Gbean obtain the global jndi?
> 
> During "the simplest and easiest approaches" day everything should be
> simplest and easiest (as well as intuitive) so your best bet would be
> to look at gbean as any other java remote client and do the following:
> 
>         Properties properties = new Properties();
>         properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.LocalInitialContextFactory");
> 
>         Context ctx = new InitialContext(properties);
>         MyEjbBeanIntf myEjbBean = (MyEjbBeanIntf)
> ctx.lookup("MyEjbBeanLocal");
> 
> As the gbean's actually part of the server environment, I'd expect you
> can leave off the Context.INITIAL_CONTEXT_FACTORY setting and look up
> ejbs without it.
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> http://www.JacekLaskowski.pl
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Gbean-and-EJBs-tp14615530s134p14685205.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.

Reply via email to