<reference> does not take text content.  You can look for
referenceType in
http://geronimo.apache.org/schemas-1.0/geronimo-config-1.0.xsd

Basically, referenceType extends patternType which holds a
gbean-nameGroup, which can be either a <gbean-name> (which holds a
full GBean name) or a bunch of separate elements.

If the referenced GBean is in the same plan, as it is in your example,
you can take the separate elements approach and all you probably need
is the name (the rest should default correctly).  So:

<reference name="Aprinter"><name>gb1</name></reference>
<reference name="Bprinter"><name>gb2</name></reference>

Thanks,
    Aaron

On 1/18/06, Nelson A. Perez <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
>   I am developing a configuration plan involving
> multiple GBeans. One of them, MainGBean, will make use
> of the other GBeans. I am specifying the dependencies
> as follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <configuration
>
> xmlns="http://geronimo.apache.org/xml/ns/deployment";
>            configId="task/SampleGBean"
>            >
>
>                 <dependency>
>                         <groupId>samples</groupId>
>                        <artifactId>task</artifactId>
>                        <version>1.0</version>
>                 </dependency>
>
>         <gbean name="gb1" class="task.APrinterGBean">
>
>
>         </gbean>
>
>         <gbean name="gb2" class="task.BPrinterGBean">
>
>
>         </gbean>
>
>         <gbean name="MainGBean" class="task.MyGBean">
>                 <reference name="Aprinter">gb1</reference>
>                 <reference name="Bprinter">gb2</reference>
>                 </gbean>
>
> </configuration>
>
>
>
> The idea is that MainGBean references gb1 and gb2 and
> makes use of them. However, I get errors related to
> the  <reference> tags and as a result it cant be
> deployed. If I remove the <reference> tags, then it
> can be deployed but  NullPointerExceptions are thrown
> at run-time when MainGBean tries to make use of these
> two GBeans that it references. Any help on the proper
> use of the <reference> tag will be appreciated.
>
> Thanks,
> NP.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Reply via email to