You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by tb...@yahoo.com on 2006/07/14 22:31:20 UTC

GBean use and deployment

I have successfully deployed a GBean using a
deployment plan. I have added a new jar to the
repository, and I reference the class in the
deployment plan.

Now, my question is: How do I access the deployed
class via the GBean from my web service/application?

Thanks.
Tyler


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Re: GBean use and deployment

Posted by tb...@yahoo.com.
Thanks Aaron,

We're still having issues, so I've attached my plans.

ClusterMonitorPlan.xml is for the GBean jar.
 - Contains the <gbean> declaration
geronimo-web.xml is for the ClusterManager-1.0.war
 - contains the <gbean-ref> tag
web.xml is also for the ClusterManager-1.0.war

The interface class is:
org.cait.ClusterMonitor.ClusterMonitorGBeanInterface

The GBean class is:
org.cait.ClusterMonitor.CustomDeltaManageGBean

Still getting this error:
----------------------
     Error: Unable to distribute
ClusterManager-1.0.war: Could not
     resolve reference at deploy time for queries
 
[?name=CustomDeltaManagerGBean#org.cait.ClusterMonitor.ClusterMonitorGBeanInterface]

         No matches for referencePatterns:
 
[?name=CustomDeltaManagerGBean#org.cait.ClusterMonitor.ClusterMonitorGBeanInterface]
---------------------

Can you see anything obvious from the plans?

Thanks!
Tyler



--- Aaron Mulder <am...@alumni.princeton.edu>
wrote:

> You're right -- gbean-ref only works in 1.1.  Your
> GBean needs to
> implement an interface, and the gbean-ref and lookup
> should go by the
> interface -- like this:
> 
> public interface MyInterface {
>     public void doSomething();
> }
> 
> public class MyGBean implements MyInterface {
>     public void doSomething() {...}
> 
>     ...
>     infoFactory.addInterface(MyInterface.class);
>     ...
> }
> 
> 
> <gbean-ref>
>   <ref-name>AGBean</ref-name>
>   <ref-type>MyInterface</ref-type>
>  
> <pattern><name>MyGBeanInstanceName</name></pattern>
> </gbean-ref>
> 
> 
> MyInterface mine = (MyInterface)new
> InitialContext().lookup("java:comp/env/AGBean");
> mine.doSomething();
> ...
> 
> Thanks,
>      Aaron
> 
> On 7/15/06, tbot55@yahoo.com <tb...@yahoo.com>
> wrote:
> > I have 1.1 up and running, and am now getting an
> error
> > with the <gbean-ref>:
> >
> >     Error: Unable to distribute example-1.0.war:
> Could
> > not
> >     resolve reference at deploy time for queries
> >     [?name=InstanceName#com.example.GBean]
> >
> >         No matches for referencePatterns:
> >     [?name=InstanceName#com.example.GBean]
> >
> > In my deployment plan for the GBean I have:
> >   <gbean name="InstanceName"
> > class="com.example.GBean"/>
> >
> > Can anyone see where I've gone astray?
> >
> > Thanks!
> > Tyler
> >
> >
> >
> > --- tbot55@yahoo.com wrote:
> >
> > > Aaron,
> > >
> > > Found this note in your book:
> > >
> > > The schema includes a placeholder element
> > > (gbean-ref)
> > > for GBean references (that is, putting a
> reference
> > > to
> > > an arbitrary GBean in the component's
> java:comp/env
> > > JNDI space), but that is not yet working in
> Geronimo
> > > 1.0 so it is not covered here.
> > >
> > > I guess we need to upgrade to 1.0, huh? Please
> > > verify.
> > >
> > > Tyler
> > >
> > >
> > > --- Aaron Mulder <am...@alumni.princeton.edu>
> > > wrote:
> > >
> > > > The GBean should implement at least one
> interface,
> > > > say
> > > > com.example.Foo, which includes all the
> methods
> > > your
> > > > web app wants to
> > > > call on it.
> > > >
> > > > Then you add a block like this to the
> deployment
> > > > plan for the web app
> > > > (geronimo-web.xml):
> > > >
> > > > <gbean-ref>
> > > >     <ref-name>MyGBean</ref-name>
> > > >     <ref-type>com.example.Foo</ref-type>
> > > >     <pattern>
> > > >         <name>YourGbeanInstanceName</name>
> > > >     </pattern>
> > > > </gbean-ref>
> > > >
> > > > That will stick the GBean named
> > > > YourGbeanInstanceName (e.g. plan has
> > > > <gbean name="YourGbeanInstanceName"
> class=...>) in
> > > > JNDI for the web
> > > > app at java:comp/env/MyGBean (java:comp/env/
> plus
> > > > the <ref-name>
> > > > above).  When you access that JNDI location,
> > > you'll
> > > > get something that
> > > > implements com.example.Foo (the <ref-type>
> above),
> > > > so you can use it
> > > > like this:
> > > >
> > > > Foo foo = (Foo)new
> > > >
> InitialContext().lookup("java:comp/env/MyGBean");
> > > >
> > > > Make sure that the GBeanInfo for your GBean
> has a
> > > > line like
> > > >
> infoFactory.addInterface(com.example.Foo.class);
> > > for
> > > > this to work.
> > > >
> > > > Thanks,
> > > >     Aaron
> > > >
> > > > On 7/14/06, tbot55@yahoo.com
> <tb...@yahoo.com>
> > > > wrote:
> > > > > I have successfully deployed a GBean using a
> > > > > deployment plan. I have added a new jar to
> the
> > > > > repository, and I reference the class in the
> > > > > deployment plan.
> > > > >
> > > > > Now, my question is: How do I access the
> > > deployed
> > > > > class via the GBean from my web
> > > > service/application?
> > > > >
> > > > > Thanks.
> > > > > Tyler
> > > > >
> > > > >
> > > > >
> > >
> __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best
> spam
> > > > protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > >
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Re: GBean use and deployment

Posted by tb...@yahoo.com.
Also, does
<context-priority-classloader>false</context-priority-classloader>
no longer work in geronimo-web.xml following the
<context-root> tag? Is there a replacement?

Tyler


--- Aaron Mulder <am...@alumni.princeton.edu>
wrote:

> You're right -- gbean-ref only works in 1.1.  Your
> GBean needs to
> implement an interface, and the gbean-ref and lookup
> should go by the
> interface -- like this:
> 
> public interface MyInterface {
>     public void doSomething();
> }
> 
> public class MyGBean implements MyInterface {
>     public void doSomething() {...}
> 
>     ...
>     infoFactory.addInterface(MyInterface.class);
>     ...
> }
> 
> 
> <gbean-ref>
>   <ref-name>AGBean</ref-name>
>   <ref-type>MyInterface</ref-type>
>  
> <pattern><name>MyGBeanInstanceName</name></pattern>
> </gbean-ref>
> 
> 
> MyInterface mine = (MyInterface)new
> InitialContext().lookup("java:comp/env/AGBean");
> mine.doSomething();
> ...
> 
> Thanks,
>      Aaron
> 
> On 7/15/06, tbot55@yahoo.com <tb...@yahoo.com>
> wrote:
> > I have 1.1 up and running, and am now getting an
> error
> > with the <gbean-ref>:
> >
> >     Error: Unable to distribute example-1.0.war:
> Could
> > not
> >     resolve reference at deploy time for queries
> >     [?name=InstanceName#com.example.GBean]
> >
> >         No matches for referencePatterns:
> >     [?name=InstanceName#com.example.GBean]
> >
> > In my deployment plan for the GBean I have:
> >   <gbean name="InstanceName"
> > class="com.example.GBean"/>
> >
> > Can anyone see where I've gone astray?
> >
> > Thanks!
> > Tyler
> >
> >
> >
> > --- tbot55@yahoo.com wrote:
> >
> > > Aaron,
> > >
> > > Found this note in your book:
> > >
> > > The schema includes a placeholder element
> > > (gbean-ref)
> > > for GBean references (that is, putting a
> reference
> > > to
> > > an arbitrary GBean in the component's
> java:comp/env
> > > JNDI space), but that is not yet working in
> Geronimo
> > > 1.0 so it is not covered here.
> > >
> > > I guess we need to upgrade to 1.0, huh? Please
> > > verify.
> > >
> > > Tyler
> > >
> > >
> > > --- Aaron Mulder <am...@alumni.princeton.edu>
> > > wrote:
> > >
> > > > The GBean should implement at least one
> interface,
> > > > say
> > > > com.example.Foo, which includes all the
> methods
> > > your
> > > > web app wants to
> > > > call on it.
> > > >
> > > > Then you add a block like this to the
> deployment
> > > > plan for the web app
> > > > (geronimo-web.xml):
> > > >
> > > > <gbean-ref>
> > > >     <ref-name>MyGBean</ref-name>
> > > >     <ref-type>com.example.Foo</ref-type>
> > > >     <pattern>
> > > >         <name>YourGbeanInstanceName</name>
> > > >     </pattern>
> > > > </gbean-ref>
> > > >
> > > > That will stick the GBean named
> > > > YourGbeanInstanceName (e.g. plan has
> > > > <gbean name="YourGbeanInstanceName"
> class=...>) in
> > > > JNDI for the web
> > > > app at java:comp/env/MyGBean (java:comp/env/
> plus
> > > > the <ref-name>
> > > > above).  When you access that JNDI location,
> > > you'll
> > > > get something that
> > > > implements com.example.Foo (the <ref-type>
> above),
> > > > so you can use it
> > > > like this:
> > > >
> > > > Foo foo = (Foo)new
> > > >
> InitialContext().lookup("java:comp/env/MyGBean");
> > > >
> > > > Make sure that the GBeanInfo for your GBean
> has a
> > > > line like
> > > >
> infoFactory.addInterface(com.example.Foo.class);
> > > for
> > > > this to work.
> > > >
> > > > Thanks,
> > > >     Aaron
> > > >
> > > > On 7/14/06, tbot55@yahoo.com
> <tb...@yahoo.com>
> > > > wrote:
> > > > > I have successfully deployed a GBean using a
> > > > > deployment plan. I have added a new jar to
> the
> > > > > repository, and I reference the class in the
> > > > > deployment plan.
> > > > >
> > > > > Now, my question is: How do I access the
> > > deployed
> > > > > class via the GBean from my web
> > > > service/application?
> > > > >
> > > > > Thanks.
> > > > > Tyler
> > > > >
> > > > >
> > > > >
> > >
> __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best
> spam
> > > > protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > >
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Re: GBean use and deployment

Posted by tb...@yahoo.com.
Sorry if these messages are munged, but I believe the
plans are correct (please still correct me if I'm
wrong).

I believe a new problem has emerged:
-----------------
Exception in thread "Thread-3"
java.lang.NoClassDefFoundError: 
javax/servlet/http/HttpSession
         at java.lang.ClassLoader.defineClass1(Native
Method)
         at
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
----------------------

The problem may be caused by the fact that I had to
remove the following line from the geronimo-web.xml
for the war to begin to deploy:
<context-priority-classloader>false</context-priority-classloader>

Was this removed from the Geronimo 1.1 schema for
geronimo-web.xml? And if so, is there a replacement?
The geronimo-web.xml plan is attached again for your
convenience.

Thanks,
Tyler


--- Aaron Mulder <am...@alumni.princeton.edu>
wrote:

> You're right -- gbean-ref only works in 1.1.  Your
> GBean needs to
> implement an interface, and the gbean-ref and lookup
> should go by the
> interface -- like this:
> 
> public interface MyInterface {
>     public void doSomething();
> }
> 
> public class MyGBean implements MyInterface {
>     public void doSomething() {...}
> 
>     ...
>     infoFactory.addInterface(MyInterface.class);
>     ...
> }
> 
> 
> <gbean-ref>
>   <ref-name>AGBean</ref-name>
>   <ref-type>MyInterface</ref-type>
>  
> <pattern><name>MyGBeanInstanceName</name></pattern>
> </gbean-ref>
> 
> 
> MyInterface mine = (MyInterface)new
> InitialContext().lookup("java:comp/env/AGBean");
> mine.doSomething();
> ...
> 
> Thanks,
>      Aaron
> 
> On 7/15/06, tbot55@yahoo.com <tb...@yahoo.com>
> wrote:
> > I have 1.1 up and running, and am now getting an
> error
> > with the <gbean-ref>:
> >
> >     Error: Unable to distribute example-1.0.war:
> Could
> > not
> >     resolve reference at deploy time for queries
> >     [?name=InstanceName#com.example.GBean]
> >
> >         No matches for referencePatterns:
> >     [?name=InstanceName#com.example.GBean]
> >
> > In my deployment plan for the GBean I have:
> >   <gbean name="InstanceName"
> > class="com.example.GBean"/>
> >
> > Can anyone see where I've gone astray?
> >
> > Thanks!
> > Tyler
> >
> >
> >
> > --- tbot55@yahoo.com wrote:
> >
> > > Aaron,
> > >
> > > Found this note in your book:
> > >
> > > The schema includes a placeholder element
> > > (gbean-ref)
> > > for GBean references (that is, putting a
> reference
> > > to
> > > an arbitrary GBean in the component's
> java:comp/env
> > > JNDI space), but that is not yet working in
> Geronimo
> > > 1.0 so it is not covered here.
> > >
> > > I guess we need to upgrade to 1.0, huh? Please
> > > verify.
> > >
> > > Tyler
> > >
> > >
> > > --- Aaron Mulder <am...@alumni.princeton.edu>
> > > wrote:
> > >
> > > > The GBean should implement at least one
> interface,
> > > > say
> > > > com.example.Foo, which includes all the
> methods
> > > your
> > > > web app wants to
> > > > call on it.
> > > >
> > > > Then you add a block like this to the
> deployment
> > > > plan for the web app
> > > > (geronimo-web.xml):
> > > >
> > > > <gbean-ref>
> > > >     <ref-name>MyGBean</ref-name>
> > > >     <ref-type>com.example.Foo</ref-type>
> > > >     <pattern>
> > > >         <name>YourGbeanInstanceName</name>
> > > >     </pattern>
> > > > </gbean-ref>
> > > >
> > > > That will stick the GBean named
> > > > YourGbeanInstanceName (e.g. plan has
> > > > <gbean name="YourGbeanInstanceName"
> class=...>) in
> > > > JNDI for the web
> > > > app at java:comp/env/MyGBean (java:comp/env/
> plus
> > > > the <ref-name>
> > > > above).  When you access that JNDI location,
> > > you'll
> > > > get something that
> > > > implements com.example.Foo (the <ref-type>
> above),
> > > > so you can use it
> > > > like this:
> > > >
> > > > Foo foo = (Foo)new
> > > >
> InitialContext().lookup("java:comp/env/MyGBean");
> > > >
> > > > Make sure that the GBeanInfo for your GBean
> has a
> > > > line like
> > > >
> infoFactory.addInterface(com.example.Foo.class);
> > > for
> > > > this to work.
> > > >
> > > > Thanks,
> > > >     Aaron
> > > >
> > > > On 7/14/06, tbot55@yahoo.com
> <tb...@yahoo.com>
> > > > wrote:
> > > > > I have successfully deployed a GBean using a
> > > > > deployment plan. I have added a new jar to
> the
> > > > > repository, and I reference the class in the
> > > > > deployment plan.
> > > > >
> > > > > Now, my question is: How do I access the
> > > deployed
> > > > > class via the GBean from my web
> > > > service/application?
> > > > >
> > > > > Thanks.
> > > > > Tyler
> > > > >
> > > > >
> > > > >
> > >
> __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best
> spam
> > > > protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > >
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Re: GBean use and deployment

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
You're right -- gbean-ref only works in 1.1.  Your GBean needs to
implement an interface, and the gbean-ref and lookup should go by the
interface -- like this:

public interface MyInterface {
    public void doSomething();
}

public class MyGBean implements MyInterface {
    public void doSomething() {...}

    ...
    infoFactory.addInterface(MyInterface.class);
    ...
}


<gbean-ref>
  <ref-name>AGBean</ref-name>
  <ref-type>MyInterface</ref-type>
  <pattern><name>MyGBeanInstanceName</name></pattern>
</gbean-ref>


MyInterface mine = (MyInterface)new
InitialContext().lookup("java:comp/env/AGBean");
mine.doSomething();
...

Thanks,
     Aaron

On 7/15/06, tbot55@yahoo.com <tb...@yahoo.com> wrote:
> I have 1.1 up and running, and am now getting an error
> with the <gbean-ref>:
>
>     Error: Unable to distribute example-1.0.war: Could
> not
>     resolve reference at deploy time for queries
>     [?name=InstanceName#com.example.GBean]
>
>         No matches for referencePatterns:
>     [?name=InstanceName#com.example.GBean]
>
> In my deployment plan for the GBean I have:
>   <gbean name="InstanceName"
> class="com.example.GBean"/>
>
> Can anyone see where I've gone astray?
>
> Thanks!
> Tyler
>
>
>
> --- tbot55@yahoo.com wrote:
>
> > Aaron,
> >
> > Found this note in your book:
> >
> > The schema includes a placeholder element
> > (gbean-ref)
> > for GBean references (that is, putting a reference
> > to
> > an arbitrary GBean in the component's java:comp/env
> > JNDI space), but that is not yet working in Geronimo
> > 1.0 so it is not covered here.
> >
> > I guess we need to upgrade to 1.0, huh? Please
> > verify.
> >
> > Tyler
> >
> >
> > --- Aaron Mulder <am...@alumni.princeton.edu>
> > wrote:
> >
> > > The GBean should implement at least one interface,
> > > say
> > > com.example.Foo, which includes all the methods
> > your
> > > web app wants to
> > > call on it.
> > >
> > > Then you add a block like this to the deployment
> > > plan for the web app
> > > (geronimo-web.xml):
> > >
> > > <gbean-ref>
> > >     <ref-name>MyGBean</ref-name>
> > >     <ref-type>com.example.Foo</ref-type>
> > >     <pattern>
> > >         <name>YourGbeanInstanceName</name>
> > >     </pattern>
> > > </gbean-ref>
> > >
> > > That will stick the GBean named
> > > YourGbeanInstanceName (e.g. plan has
> > > <gbean name="YourGbeanInstanceName" class=...>) in
> > > JNDI for the web
> > > app at java:comp/env/MyGBean (java:comp/env/ plus
> > > the <ref-name>
> > > above).  When you access that JNDI location,
> > you'll
> > > get something that
> > > implements com.example.Foo (the <ref-type> above),
> > > so you can use it
> > > like this:
> > >
> > > Foo foo = (Foo)new
> > > InitialContext().lookup("java:comp/env/MyGBean");
> > >
> > > Make sure that the GBeanInfo for your GBean has a
> > > line like
> > > infoFactory.addInterface(com.example.Foo.class);
> > for
> > > this to work.
> > >
> > > Thanks,
> > >     Aaron
> > >
> > > On 7/14/06, tbot55@yahoo.com <tb...@yahoo.com>
> > > wrote:
> > > > I have successfully deployed a GBean using a
> > > > deployment plan. I have added a new jar to the
> > > > repository, and I reference the class in the
> > > > deployment plan.
> > > >
> > > > Now, my question is: How do I access the
> > deployed
> > > > class via the GBean from my web
> > > service/application?
> > > >
> > > > Thanks.
> > > > Tyler
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > http://mail.yahoo.com
> > > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Re: GBean use and deployment

Posted by tb...@yahoo.com.
I have 1.1 up and running, and am now getting an error
with the <gbean-ref>:

    Error: Unable to distribute example-1.0.war: Could
not
    resolve reference at deploy time for queries
    [?name=InstanceName#com.example.GBean]

        No matches for referencePatterns:
    [?name=InstanceName#com.example.GBean]

In my deployment plan for the GBean I have:
  <gbean name="InstanceName"
class="com.example.GBean"/>

Can anyone see where I've gone astray?

Thanks!
Tyler



--- tbot55@yahoo.com wrote:

> Aaron,
> 
> Found this note in your book:
> 
> The schema includes a placeholder element
> (gbean-ref)
> for GBean references (that is, putting a reference
> to
> an arbitrary GBean in the component's java:comp/env
> JNDI space), but that is not yet working in Geronimo
> 1.0 so it is not covered here.
> 
> I guess we need to upgrade to 1.0, huh? Please
> verify.
> 
> Tyler
> 
> 
> --- Aaron Mulder <am...@alumni.princeton.edu>
> wrote:
> 
> > The GBean should implement at least one interface,
> > say
> > com.example.Foo, which includes all the methods
> your
> > web app wants to
> > call on it.
> > 
> > Then you add a block like this to the deployment
> > plan for the web app
> > (geronimo-web.xml):
> > 
> > <gbean-ref>
> >     <ref-name>MyGBean</ref-name>
> >     <ref-type>com.example.Foo</ref-type>
> >     <pattern>
> >         <name>YourGbeanInstanceName</name>
> >     </pattern>
> > </gbean-ref>
> > 
> > That will stick the GBean named
> > YourGbeanInstanceName (e.g. plan has
> > <gbean name="YourGbeanInstanceName" class=...>) in
> > JNDI for the web
> > app at java:comp/env/MyGBean (java:comp/env/ plus
> > the <ref-name>
> > above).  When you access that JNDI location,
> you'll
> > get something that
> > implements com.example.Foo (the <ref-type> above),
> > so you can use it
> > like this:
> > 
> > Foo foo = (Foo)new
> > InitialContext().lookup("java:comp/env/MyGBean");
> > 
> > Make sure that the GBeanInfo for your GBean has a
> > line like
> > infoFactory.addInterface(com.example.Foo.class);
> for
> > this to work.
> > 
> > Thanks,
> >     Aaron
> > 
> > On 7/14/06, tbot55@yahoo.com <tb...@yahoo.com>
> > wrote:
> > > I have successfully deployed a GBean using a
> > > deployment plan. I have added a new jar to the
> > > repository, and I reference the class in the
> > > deployment plan.
> > >
> > > Now, my question is: How do I access the
> deployed
> > > class via the GBean from my web
> > service/application?
> > >
> > > Thanks.
> > > Tyler
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: GBean use and deployment

Posted by tb...@yahoo.com.
Aaron,

Found this note in your book:

The schema includes a placeholder element (gbean-ref)
for GBean references (that is, putting a reference to
an arbitrary GBean in the component's java:comp/env
JNDI space), but that is not yet working in Geronimo
1.0 so it is not covered here.

I guess we need to upgrade to 1.0, huh? Please verify.

Tyler


--- Aaron Mulder <am...@alumni.princeton.edu>
wrote:

> The GBean should implement at least one interface,
> say
> com.example.Foo, which includes all the methods your
> web app wants to
> call on it.
> 
> Then you add a block like this to the deployment
> plan for the web app
> (geronimo-web.xml):
> 
> <gbean-ref>
>     <ref-name>MyGBean</ref-name>
>     <ref-type>com.example.Foo</ref-type>
>     <pattern>
>         <name>YourGbeanInstanceName</name>
>     </pattern>
> </gbean-ref>
> 
> That will stick the GBean named
> YourGbeanInstanceName (e.g. plan has
> <gbean name="YourGbeanInstanceName" class=...>) in
> JNDI for the web
> app at java:comp/env/MyGBean (java:comp/env/ plus
> the <ref-name>
> above).  When you access that JNDI location, you'll
> get something that
> implements com.example.Foo (the <ref-type> above),
> so you can use it
> like this:
> 
> Foo foo = (Foo)new
> InitialContext().lookup("java:comp/env/MyGBean");
> 
> Make sure that the GBeanInfo for your GBean has a
> line like
> infoFactory.addInterface(com.example.Foo.class); for
> this to work.
> 
> Thanks,
>     Aaron
> 
> On 7/14/06, tbot55@yahoo.com <tb...@yahoo.com>
> wrote:
> > I have successfully deployed a GBean using a
> > deployment plan. I have added a new jar to the
> > repository, and I reference the class in the
> > deployment plan.
> >
> > Now, my question is: How do I access the deployed
> > class via the GBean from my web
> service/application?
> >
> > Thanks.
> > Tyler
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: GBean use and deployment

Posted by tb...@yahoo.com.
Thanks!

I tried it, the only problem is the <gbean-ref>
configuration.
Geronimo does not like <gbean-ref>. Is this something
specific to Geronimo 1.1?

So now the code is modified correctly, as you have
pointed out, and compiles. However, Geronimo doesn't
like the geronimo-web.xml modifications. Is the
<gbean-ref> a standalone tag?

Tyler



--- Aaron Mulder <am...@alumni.princeton.edu>
wrote:

> The GBean should implement at least one interface,
> say
> com.example.Foo, which includes all the methods your
> web app wants to
> call on it.
> 
> Then you add a block like this to the deployment
> plan for the web app
> (geronimo-web.xml):
> 
> <gbean-ref>
>     <ref-name>MyGBean</ref-name>
>     <ref-type>com.example.Foo</ref-type>
>     <pattern>
>         <name>YourGbeanInstanceName</name>
>     </pattern>
> </gbean-ref>
> 
> That will stick the GBean named
> YourGbeanInstanceName (e.g. plan has
> <gbean name="YourGbeanInstanceName" class=...>) in
> JNDI for the web
> app at java:comp/env/MyGBean (java:comp/env/ plus
> the <ref-name>
> above).  When you access that JNDI location, you'll
> get something that
> implements com.example.Foo (the <ref-type> above),
> so you can use it
> like this:
> 
> Foo foo = (Foo)new
> InitialContext().lookup("java:comp/env/MyGBean");
> 
> Make sure that the GBeanInfo for your GBean has a
> line like
> infoFactory.addInterface(com.example.Foo.class); for
> this to work.
> 
> Thanks,
>     Aaron
> 
> On 7/14/06, tbot55@yahoo.com <tb...@yahoo.com>
> wrote:
> > I have successfully deployed a GBean using a
> > deployment plan. I have added a new jar to the
> > repository, and I reference the class in the
> > deployment plan.
> >
> > Now, my question is: How do I access the deployed
> > class via the GBean from my web
> service/application?
> >
> > Thanks.
> > Tyler
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: GBean use and deployment

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
The GBean should implement at least one interface, say
com.example.Foo, which includes all the methods your web app wants to
call on it.

Then you add a block like this to the deployment plan for the web app
(geronimo-web.xml):

<gbean-ref>
    <ref-name>MyGBean</ref-name>
    <ref-type>com.example.Foo</ref-type>
    <pattern>
        <name>YourGbeanInstanceName</name>
    </pattern>
</gbean-ref>

That will stick the GBean named YourGbeanInstanceName (e.g. plan has
<gbean name="YourGbeanInstanceName" class=...>) in JNDI for the web
app at java:comp/env/MyGBean (java:comp/env/ plus the <ref-name>
above).  When you access that JNDI location, you'll get something that
implements com.example.Foo (the <ref-type> above), so you can use it
like this:

Foo foo = (Foo)new InitialContext().lookup("java:comp/env/MyGBean");

Make sure that the GBeanInfo for your GBean has a line like
infoFactory.addInterface(com.example.Foo.class); for this to work.

Thanks,
    Aaron

On 7/14/06, tbot55@yahoo.com <tb...@yahoo.com> wrote:
> I have successfully deployed a GBean using a
> deployment plan. I have added a new jar to the
> repository, and I reference the class in the
> deployment plan.
>
> Now, my question is: How do I access the deployed
> class via the GBean from my web service/application?
>
> Thanks.
> Tyler
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>