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">
    ...
  </>

Cheers,
Guillaume Nodet

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

Hi,

a question regarding servicemix-lwcontainer. I have both SM lightweight
components that participate in message exchanges as well as many helper
Spring
beans outside of

  <sm:serviceunit id="jbi">
    <sm:activationSpecs>
...
    </sm:activationSpecs>
  </sm:serviceunit>

what works well is that a SM component has a property that is a reference
to a
bean outside but I have problems defining a property in a bean that
references a
SM componnt or a property between two SM components that use Spring
properterty
references

So in

  <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="...">
            <property name="other">         <!-- this works fine -->
              <ref local="other-bean"/>
            </property>
            <property name="other-sm">      <!-- this does not -->
              <ref local="other-sm-bean"/>
            </property>
          </bean>
        </sm:component>
      </sm:activationSpec>

      <sm:activationSpec componentName="other-sm-bean"
service="bes:other-sm-bean" endpoint="other-sm-bean">
        <sm:component>
          <bean id="other-sm-bean" class="..."/>
        </sm:component>
      </sm:activationSpec>
    </sm:activationSpecs>
  </sm:serviceunit>

  <bean id="bean" class="...">
    <property name="property">              <!-- this does not -->
      <ref local="sm-bean"/>
    </property>
  </bean>

  <bean id="other-bean" class="..."/>


Why would these 2 cases not work, a SM bean is a Spring bean and should
behave
like one? Or is there a trick?

Please don't come back and say why do these two beans not use a ME, the
one is a
receiver and the other a sender and a normal backend-bean might need a
sending
bean. So I really want a property here.


Thanks, Peter


Reply via email to