If this happens only when you start ServiceMix, it may be that the
quartz component fires an event before the target endpoint is
activated...
Not sure if there is a simple way to avoid that though (unless you use
service units and the lwcontainer).

Cheers,
Guillaume Nodet


On 5/1/06, dajevu <[EMAIL PROTECTED]> wrote:

Thanks for the great suggestion -- I had somehow overlooked the EIP section
in the docs.

While it worked, I did get the following error, which seems innocous:

org.quartz.JobExecutionException: javax.jbi.messaging.MessagingException:
Failed to resolve endpoint:
org.apache.servicemix.jbi.NoServiceAvailableException: Cannot find an
instance of the service: {http://servicemix.org/demo/}pipeline [See nested
exception: javax.jbi.messaging.MessagingException: Failed to resolve
endpoint: org.apache.servicemix.jbi.NoServiceAvailableException: Cannot find
an instance of the service: {http://servicemix.org/demo/}pipeline]
        at
org.apache.servicemix.components.quartz.QuartzComponent.onJobExecute(QuartzComponent.java:127)
        at
org.apache.servicemix.components.quartz.ServiceMixJob.execute(ServiceMixJob.java:33)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
* Nested Exception (Underlying Cause) ---------------
javax.jbi.messaging.MessagingException: Failed to resolve endpoint:
org.apache.servicemix.jbi.NoServiceAvailableException: Cannot find an
instance of the service: {http://servicemix.org/demo/}pipeline
        at
org.apache.servicemix.jbi.nmr.Broker.resolveAddress(Broker.java:378)
        at
org.apache.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:284)
        at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:694)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:450)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:490)
        at
org.apache.servicemix.components.util.PojoSupport.send(PojoSupport.java:222)
        at
org.apache.servicemix.components.quartz.QuartzComponent.onJobExecute(QuartzComponent.java:124)
        at
org.apache.servicemix.components.quartz.ServiceMixJob.execute(ServiceMixJob.java:33)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.apache.servicemix.jbi.NoServiceAvailableException: Cannot
find an instance of the service: {http://servicemix.org/demo/}pipeline
        at
org.apache.servicemix.jbi.resolver.ServiceNameEndpointResolver.createServiceUnavailableException(ServiceNameEndpointResolver.java:60)
        at
org.apache.servicemix.jbi.resolver.EndpointResolverSupport.resolveEndpoint(EndpointResolverSupport.java:39)
        at
org.apache.servicemix.jbi.nmr.Broker.resolveAddress(Broker.java:375)
        ... 9 more

Below is my service.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:foo="http://servicemix.org/demo/";
       xmlns:eip="http://servicemix.apache.org/eip/1.0";>


  <!-- the JBI container -->
  <sm:container id="jbi"
                useMBeanServer="true"
                createMBeanServer="true"
                dumpStats="true"
                statsInterval="10">

        <sm:activationSpecs>

      <sm:activationSpec>
        <sm:component>
          <eip:component>
            <eip:endpoints>
                                        <eip:pipeline service="foo:pipeline" 
endpoint="endpoint">
                                          <eip:transformer>
                                            <eip:exchange-target 
service="foo:routingSlip" />
                                          </eip:transformer>
                                          <eip:target>
                                            <eip:exchange-target 
service="foo:trace" />
                                          </eip:target>
                                        </eip:pipeline>
            </eip:endpoints>
          </eip:component>
        </sm:component>
      </sm:activationSpec>

      <sm:activationSpec>
        <sm:component>
          <eip:component>
            <eip:endpoints>
                                                <eip:static-routing-slip 
service="foo:routingSlip"
endpoint="endpoint">
                                                  <eip:targets>
                                                    <eip:exchange-target 
service="foo:transformer" />
                                                    <eip:exchange-target 
service="foo:stockQuote" />
                                                    <eip:exchange-target 
service="foo:httpSender" />
                                                  </eip:targets>
                                                </eip:static-routing-slip>
            </eip:endpoints>
          </eip:component>
        </sm:component>
      </sm:activationSpec>

                        <sm:activationSpec componentName="timer" 
service="foo:timer"
destinationService="foo:pipeline">
                                <sm:component>
                                        <bean 
class="org.apache.servicemix.components.quartz.QuartzComponent">
                                                <property name="triggers">
                                                        <map>
                                                                <entry>
                                                                        <key>
                                                                                <bean 
class="org.quartz.SimpleTrigger">
                                                                                        <property 
name="repeatInterval" value="10000" />
                                                                                        <property 
name="repeatCount" value="1" />
                                                                                
</bean>
                                                                        </key>
                                                                        <bean
                                                                                
class="org.quartz.JobDetail">
                                                                                <property 
name="name" value="My Example Job" />
                                                                                <property 
name="group" value="ServiceMix" />
                                                                        </bean>
                                                                </entry>
                                                        </map>
                                                </property>
                                        </bean>
                                </sm:component>
                        </sm:activationSpec>


                <!-- Route the event to a trace component that just outputs the 
event to
the console -->
                        <sm:activationSpec componentName="trace" 
service="foo:trace">
                                <sm:component>
                                        <bean 
class="org.apache.servicemix.components.util.TraceComponent" />
                                </sm:component>
                        </sm:activationSpec>

                        <sm:activationSpec componentName="transformer" 
service="foo:transformer">
                                <sm:component><bean
class="org.apache.servicemix.components.xslt.XsltComponent">
                                        <property name="xsltResource" 
value="resources/virtualEdge.xslt"/>
                                </bean></sm:component>
                        </sm:activationSpec>

                                                <!-- post the results and monitor 
the output -->
                        <sm:activationSpec componentName="httpSender" 
service="foo:httpSender">
                                <sm:component><bean
class="org.apache.servicemix.components.http.HttpInvoker">
                                        <property name="url" 
value="http://localhost:8090/httpReceiver"/>
                                </bean></sm:component>
                        </sm:activationSpec>

                <!-- This just invokes another service -->
                <sm:activationSpec componentName="stockQuote"
                                                   service="foo:stockQuote"
                                                   endpoint="stockQuote">
                  <sm:component>
                    <bean 
class="org.apache.servicemix.components.saaj.SaajBinding">
                        <property name="soapAction"
value="http://ws.invesbot.com/GetQuote"/>
                              <property name="soapEndpoint">
                                      <bean 
class="javax.xml.messaging.URLEndpoint">
                                              <constructor-arg 
value="http://localhost:8085/stockquotes.asmx"/>
                                      </bean>
                              </property>
                    </bean>
                  </sm:component>
                </sm:activationSpec>

         </sm:activationSpecs>
  </sm:container>

</beans>

Thanks again for your help, and I'll re-ready the JBI so that I have a more
complete understanding of the message flows.

jeff
--
View this message in context: 
http://www.nabble.com/General-Question-t1531899.html#a4170186
Sent from the ServiceMix - User forum at Nabble.com.


Reply via email to