Hi, 

I'm trying to get the FTP poller to send a file to my pojo. I'm getting
called when I place a file in the ftp directory ok, but when I try to call
DONE (or send) I get the following exception :-

org.apache.servicemix.jbi.NotInitialisedYetException: Cannot perform
operations
on this component until it has been initialised via init()

I've put some log statements in the program, and I do seem to be getting
initialised / started. I think I'm nearly getting there with servicemix, but
I can't crack this problem. Can anyone help please?
I'm using servicemix 3.1.2

The full exception (including my debug output :-

INFO  - MyReceiver                     - Received message InOnly[
  id: ID:127.0.0.1-115f0ea2047-6:0
  status: Active
  role: provider
  service: {http://servicemix.apache.org/mytest}myreceiver
  endpoint: myreceiver
  in: <?xml version="1.0" encoding="UTF-8"?><add>
<op1 href="#id0"/>
<op2 href="#id1"/>
</add>
]
ERROR - SedaQueue                      -
org.apache.servicemix.jbi.nmr.flow.seda
[EMAIL PROTECTED] got error processing InOnly[
  id: ID:127.0.0.1-115f0ea2047-6:0
  status: Done
  role: provider
  service: {http://servicemix.apache.org/mytest}myreceiver
  endpoint: myreceiver
  in: <?xml version="1.0" encoding="UTF-8"?><add>
<op1 href="#id0"/>
<op2 href="#id1"/>
</add>
]
org.apache.servicemix.jbi.NotInitialisedYetException: Cannot perform
operations
on this component until it has been initialised via init()
        at
org.apache.servicemix.components.util.PojoSupport.getDeliveryChannel(
PojoSupport.java:168)
        at
org.apache.servicemix.components.util.PojoSupport.send(PojoSupport.ja
va:197)
        at
org.apache.servicemix.samples.helloworld.se.MyReceiver.onMessageExcha
nge(MyReceiver.java:59)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:595)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:174)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)

         <sm:activationSpec id="myreceiver" service="mytest:myreceiver">
                                <sm:component>
                                        <bean 
class="org.apache.servicemix.samples.helloworld.se.MyReceiver" >

                                        </bean>
                                </sm:component>
                        </sm:activationSpec>

################################################################

The key bits of myreceiver pojo code :-

public class MyReceiver extends ComponentSupport implements
ComponentLifeCycle, MessageExchangeListener {
private static final Log log = LogFactory.getLog(MyReceiver.class);
private ComponentContext context;
private ObjectName extensionMBeanName;
//nf private MessageList messageList = new MessageList();
// ComponentLifeCycle interface
//-------------------------------------------------------------------------
public ObjectName getExtensionMBeanName() {
return extensionMBeanName;
}
public void init(ComponentContext context) throws JBIException {
log.info("########## init called ##########");
this.context = context;
// Lets activate myself
context.activateEndpoint(new QName("http://servicemix.apache.org/mytest";,
"myreceiver"), "myreceiver");
log.info("########## completed activateEndpoint ##########");
}
public void shutDown() throws JBIException {
}
public void start() throws JBIException
{
   log.info("########## start called ##########");
}
public void stop() throws JBIException {
}
// MessageExchangeListener interface
//-------------------------------------------------------------------------
public void onMessageExchange(MessageExchange exchange) throws
MessagingException
{
    log.info("Received message " + exchange);
    NormalizedMessage message = exchange.getMessage("in");
    exchange.setStatus(ExchangeStatus.DONE);
    done(exchange);
}


##############################################################

How I've defined ftppoller and myreceiver in servicemix.xml :

         <sm:activationSpec componentName="ftpPoller"
                       service="mytest:ftpPoller"
                       destinationService="mytest:myreceiver">
                             <sm:component>
                                        <bean
class="org.apache.servicemix.components.net.FTPPoller">
                                          <property name="path"
value="myindir" />
                                          <property name="period"
value="1000" />
                                          <property name="clientPool">
                                             <bean id="ftpClientPool"
class="org.apache.servicemix.components.net.FTPClientPool">
                                                <property name="host"
value="localhost"/>
                                                <property name="username"
value="my"/>
                                                <property name="password"
value="my"/>
                                             </bean>
                                           </property>
                                         </bean>
                             </sm:component>
         </sm:activationSpec>

         <sm:activationSpec id="myreceiver" service="mytest:myreceiver">
                                <sm:component>
                                        <bean 
class="org.apache.servicemix.samples.helloworld.se.MyReceiver" >

                                        </bean>
                                </sm:component>
          </sm:activationSpec>

###############################################################

Output from servicemix startup :-

Starting Apache ServiceMix ESB: 3.1.2

Loading Apache ServiceMix from servicemix.xml on the CLASSPATH
INFO  - ConnectorServerFactoryBean     - JMX connector available at:
service:jmx
:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO  - JBIContainer                   - ServiceMix 3.1.2 JBI Container
(Service
Mix) is starting
INFO  - JBIContainer                   - For help or more informations
please se
e: http://incubator.apache.org/servicemix/
INFO  - ComponentMBeanImpl             - Initializing component:
#SubscriptionMa
nager#
INFO  - jetty                          - Logging to
org.apache.servicemix.http.j
[EMAIL PROTECTED] via org.apache.servicemix.http.jetty.JCLLogger
INFO  - DeploymentService              - Restoring service assemblies
INFO  - ComponentMBeanImpl             - Initializing component: myreceiver
INFO  - MyReceiver                     - ########## init called ##########
INFO  - MyReceiver                     - ########## completed
activateEndpoint #
#########
INFO  - ComponentMBeanImpl             - Setting running state for
Component: he
llo-world-se to Started
INFO  - ComponentMBeanImpl             - Initializing component:
hello-world-se
INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-bean to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-bean

INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-file to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-file

INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-ftp to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-ftp
INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-http to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-http

INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-jsr181 to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-jsr1
81
INFO  - ComponentMBeanImpl             - Setting running state for
Component: se
rvicemix-lwcontainer to Started
INFO  - ComponentMBeanImpl             - Initializing component:
servicemix-lwco
ntainer
INFO  - MyReceiver                     - ########## start called ##########

-- 
View this message in context: 
http://www.nabble.com/Error-calling-DONE-on-InOnly-message-tf4718625s12049.html#a13489208
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to