Hi,
In fact, the timer component doesn't find the sm-jms component. So the
exception occured each time the timer message is sent.
You will find above my XML configuration file and the console output.
If anybody find the mistake...
Cheers,
Pierre NOTEL
Bull R&D
//**************************************************************
XML file :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:foo="http://servicemix.org/cheese"
xmlns:spring="http://xbean.org/schemas/spring/1.0"
xmlns:jms="http://servicemix.apache.org/jms/1.0"
xmlns:eip="http://servicemix.apache.org/eip/1.0"
>
<import resource="classpath:jmx.xml" />
<import resource="classpath:activemq.xml" />
<import resource="classpath:jndi.xml" />
<!-- JBI container -->
<sm:container spring:id="jbi" rootDir="./wdir" useMBeanServer="true"
createMBeanServer="true" installationDirPath="./install"
monitorInstallationDirectory="true" dumpStats="true"
statsInterval="10" transactionManager="#transactionManager">
<sm:activationSpecs>
<!-- ####################### myScreenOutput ######################## -->
<sm:activationSpec componentName="myScreenOutput"
service="foo:myScreenOutput">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.apache.servicemix.components.util.StreamWriterComponent">
</bean>
</sm:component>
</sm:activationSpec>
<!-- JMS POLLER - CONSUMER -->
<sm:activationSpec componentName="MyConsumer"
service="foo:MyConsumer">
<sm:component>
<jms:component>
<jms:endpoints>
<jms:endpoint service="foo:MyConsumer"
endpoint="MyConsumer"
targetService="foo:MyProvider"
targetEndpoint="myProvider"
role="consumer"
defaultMep="http://www.w3.org/2004/08/wsdl/in-opt-out"
destinationStyle="topic"
jmsProviderDestinationName="demo.org.servicemix.result"
jndiConnectionFactoryName="connectionFactory"
defaultOperation="" />
</jms:endpoints>
</jms:component>
</sm:component>
</sm:activationSpec>
<!-- JMS SENDER - PROVIDER -->
<sm:activationSpec componentName="MyProvider"
service="foo:MyProvider">
<sm:component>
<jms:component>
<jms:endpoints>
<jms:endpoint service="foo:MyProvider"
endpoint="myProvider"
role="provider"
defaultMep="http://www.w3.org/2004/08/wsdl/in-opt-out"
destinationStyle="topic"
jmsProviderDestinationName="demo.org.servicemix.result"
jndiConnectionFactoryName="connectionFactory"
defaultOperation="" />
</jms:endpoints>
</jms:component>
</sm:component>
</sm:activationSpec>
<!-- ####################### My input timer ######################## -->
<sm:activationSpec componentName="myTimer" service="foo:myTimer"
destinationService="foo:MyConsumer">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.apache.servicemix.components.quartz.QuartzComponent">
<property name="triggers">
<map>
<entry>
<key>
<bean class="org.quartz.SimpleTrigger">
<property name="repeatInterval"
value="5000" />
<property name="repeatCount"
value="-1" />
</bean>
</key>
<bean class="org.quartz.JobDetail">
<property name="name" value="job
name" />
<property name="group" value="job
group" />
<property name="description" value="" />
</bean>
</entry>
</map>
</property>
</bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
</beans>
//**************************************************************
Console output :
Loading Apache ServiceMix from file: basic.xml
WARN - MulticastDiscoveryAgent - brokerName not set
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=#SubscriptionManager#] with service: null
component: [EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component:
#SubscriptionManager#
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=servicemix-eip] with service: null component:
[EMAIL PROTECTED]
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=servicemix-jms] with service: null component:
[EMAIL PROTECTED]
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=servicemix-lwcontainer] with service: null
component: [EMAIL PROTECTED]
INFO - DeploymentService - Restoring service assemblies
INFO - JBIContainer - ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-SNAPSHOT
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=myScreenOutput] with service:
{http://servicemix.org/cheese}myScreenOutput component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component:
myScreenOutput
*INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=MyConsumer] with service:
{http://servicemix.org/cheese}MyConsumer component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component: MyConsumer*
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=MyProvider] with service:
{http://servicemix.org/cheese}MyProvider component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component: MyProvider
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=myTimer] with service:
{http://servicemix.org/cheese}myTimer component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component: myTimer
1 name = quartz.properties
INFO - SimpleThreadPool - Job execution threads will use
class loader of thread: main
INFO - QuartzScheduler - Quartz Scheduler v.1.5.1 created.
INFO - RAMJobStore - RAMJobStore initialized.
INFO - StdSchedulerFactory - Quartz scheduler
'DefaultQuartzScheduler' initialized from default resource file in
Quartz package: 'quartz.properties'
INFO - StdSchedulerFactory - Quartz scheduler version: 1.5.1
INFO - QuartzScheduler - Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED started.
INFO - ComponentMBeanImpl - Setting running state for
Component: servicemix-eip to Started
INFO - ComponentMBeanImpl - Initializing component:
servicemix-eip
INFO - ComponentMBeanImpl - Setting running state for
Component: servicemix-jms to Started
INFO - ComponentMBeanImpl - Initializing component:
servicemix-jms
INFO - ComponentMBeanImpl - Setting running state for
Component: servicemix-lwcontainer to Started
INFO - ComponentMBeanImpl - Initializing component:
servicemix-lwcontainer
*WARN - DefaultBroker - ServiceName
({http://servicemix.org/cheese}MyConsumer) specified for routing, but
can't find it registered*
INFO - JobRunShell - Job job group.job name threw a
JobExecutionException:
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/cheese}MyConsumer [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/cheese}MyConsumer]
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/cheese}MyConsumer
at
org.apache.servicemix.jbi.nmr.DefaultBroker.resolveAddress(DefaultBroker.java:380)
at
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:286)
at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:713)
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/cheese}MyConsumer
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.DefaultBroker.resolveAddress(DefaultBroker.java:377)
... 9 more
//**************************************************************
Guillaume Nodet wrote:
Does this only apply the first time the timer is sent ?
And which exception is thrown ?
On 8/11/06, Mouilleron Cedric <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to use the basic example with sm-jms component (in a
lightweight xml file).
When I'm loading the configuration file, all component are activated but
when the timer (first component) wakes up and sends the message into the
first sm-jms component, it cannot find this jms component so I get an
error.
When I changed the input timer by an input mail poller, the sample works
fine.
When I changed the timer destination service to the screen, its works
fine (message is printed on screen).
When I changed the timer destination service to an eip-splitter, it
fails.
When I changed the timer destination service to an standard component
(router for example), it works fine.
The message sent by the timer are received only by ligthweigth component
and not standard one.
So, I think that the timer cannot send a message to a standard
component.
Anybody has an idea ?
Cédric MOUILLERON
Bull R&D