You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jmuller <je...@gmail.com> on 2007/05/15 18:00:03 UTC

received NotInitialisedYetException because my bean is never initialized

When i deployed a servicemix-bean SU with this simple code:

public class EndReceiver extends PojoSupport implements
MessageExchangeListener {

    private static final Log log = LogFactory.getLog(EndReceiver.class);

    public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
        log.info("Received exchange: " + exchange);
        done(exchange);
    }
}

I have this trace:
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
proto3-end-su
INFO  - ServiceUnitLifeCycle           - Starting service unit:
proto3-end-su
INFO  - EndReceiver                    - Received exchange: InOnly[
  id: ID:Q107049-3312-1179243580112-2:1
  status: Active
  role: provider
  service: {test}end
  endpoint: endpoint
  in: null
]
ERROR - BeanComponent                  - Error processing exchange InOnly[
  id: ID:Q107049-3312-1179243580112-2:1
  status: Done
  role: provider
  service: {test}end
  endpoint: endpoint
  in: null
]
org.apache.servicemix.jbi.NotInitialisedYetException: Cannot perform
operations on this component until it has been init
ialised via init()
        at
org.apache.servicemix.components.util.PojoSupport.getDeliveryChannel(PojoSupport.java:168)
        at
org.apache.servicemix.components.util.PojoSupport.done(PojoSupport.java:193)
        at
i2.application.tipi.proto3.end.su.EndReceiver.onMessageExchange(EndReceiver.java:28)
        at
org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:224)
        at
org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:201)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:593)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)

        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)

because my Bean/PojoSupport init() method has never be called, so my channel
is null !

If i use in my bean:

@Resource
private DeliveryChannel channel;
@Resource
private ComponentContext context;

It's OK !

How are init() method(s) called ?

-- 
View this message in context: http://www.nabble.com/received-NotInitialisedYetException-because-my-bean-is-never-initialized-tf3759433s12049.html#a10625664
Sent from the ServiceMix - User mailing list archive at Nabble.com.