On 6/27/06, Peter Klotz <[EMAIL PROTECTED]> wrote:

Guillaume Nodet wrote:
> Spring references only works with top-level beans.
> So you should also define your component as a reference, using
>   <sm:activationSpec component="#myComponent" .../>
> and
>   <bean id="myComponent">
>     ...
>   </>

as you see in my example I try this, sm-bean has componentName set,
I also tried all combinations of #sm-bean or sm-bean the error that
is reported is that in the "bean" bean the reference "sm-bean" or
"#sm-bean"
however I try it is not found.


The componentName attribute is used by ServiceMix as a display string, the
same way it is used
when put in the jbi descriptor.  The component attribute is of
javax.jbi.Component type and you
should try this one.
Also, keep in mind, that all references beans have to be top-level beans, ie
you can not reference a bean which has been defined inside a property, a
list, or something like that.

Cheers,
Guillaume Nodet

  <sm:serviceunit id="jbi">
>>     <sm:activationSpecs>
>>       <sm:activationSpec componentName="sm-bean" service="bes:sm-bean"
>> endpoint="sm-bean">
>>         <sm:component>
>>           <bean id="sm-bean" class="...">
[...]
>>           </bean>
>>         </sm:component>
>>       </sm:activationSpec>
[...]
>>     </sm:activationSpecs>
>>   </sm:serviceunit>
>>
>>   <bean id="bean" class="...">
>>     <property name="property">              <!-- this does not -->
>>       <ref local="sm-bean"/>
>>     </property>
>>   </bean>

on the SM-component both id and componentName are set but the bean outside
of
the SU bean cannot access the SM-bean anyway.


Peter


Reply via email to