hi all,
   when i use org.servicemix.components.xslt.XsltComponent, i got some exceptions:

ERROR [PojoSupport] Error processing exchange
javax.jbi.messaging.MessagingException: Could not find route for exchange: org.s
[EMAIL PROTECTED] for service: null and interface: null
 
        at org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:303)
        at org.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.j
ava:567)
        at org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChann
elImpl.java:347)
        at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryCha
nnelImpl.java:422)
        at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(DeliveryCha
nnelImpl.java:398)
        at org.servicemix.components.util.TransformComponentSupport.onMessageExc
hange(TransformComponentSupport.java:57)
        at org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(Deliv
eryChannelImpl.java:588)
        at org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:
171)
        at org.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:225)
        at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
va:291)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown So
urce)
        at java.lang.Thread.run(Thread.java:536)
 
attachments are my source and resource files.
 
thanks.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0";
	xmlns:spring="http://xbean.org/schemas/spring/1.0";
	xmlns:sm="http://servicemix.org/config/1.0";
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	xsi:schemaLocation="http://xbean.org/schemas/spring/1.0 ./../conf/spring-beans.xsd
	                    http://servicemix.org/config/1.0 ./../conf/servicemix.xsd"
	xmlns:my="http://servicemix.org/demo/";>

	<!-- the 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>

			<sm:activationSpec componentName="provider" service="my:provider"
				destinationService="my:xsltRouter">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0";
						class="my.components.MsgProvider"/>
				</sm:component>
			</sm:activationSpec>
			
			<sm:activationSpec componentName="xsltRouter" service="my:xsltRouter">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0";
						class="org.servicemix.components.xslt.XsltComponent">
						<property name="xsltResource" value="router.xsl"/>
						<property name="disableOutput" value="false"/>
					</bean>
				</sm:component>
			</sm:activationSpec>

			<sm:activationSpec componentName="consumer1"
				service="my:consumer1">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0";
						class="org.servicemix.components.util.TraceComponent"/>
				</sm:component>
			</sm:activationSpec>

			<sm:activationSpec componentName="consumer2"
				service="my:consumer2">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0";
						class="my.components.MsgConsumer"/>
				</sm:component>
			</sm:activationSpec>
			
			<sm:activationSpec componentName="consumer3"
				service="my:consumer3">
				<sm:component>
					<bean xmlns="http://xbean.org/schemas/spring/1.0";
						class="my.components.MsgConsumer"/>
				</sm:component>
			</sm:activationSpec>
		</sm:activationSpecs>
	</sm:container>

	<!-- message broker -->
	<bean id="broker" class="org.activemq.spring.BrokerFactoryBean">
		<property name="config" value="classpath:activemq.xml" />
	</bean>

	<bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
	<bean id="transactionManager" class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />

	<bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
		<property name="connectionFactory">
			<bean class="org.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL">
					<value>tcp://localhost:61616</value>
				</property>
			</bean>
		</property>
	</bean>

</beans>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:jbi="xalan://org.servicemix.components.xslt.XalanExtension" 
                          extension-element-prefixes="jbi"
                xmlns:my="http://servicemix.org/demo/"; version="1.0">

  <xsl:template match="/*">
    <xsl:choose>

      <xsl:when test="@id = '0'">
        <jbi:forward service="my:consumer1"/>
      </xsl:when>
            
      <xsl:when test="@id = '1'">
        <jbi:forward service="my:consumer2"/>
      </xsl:when>
      
     <xsl:when test="@id = '2'">
        <jbi:forward service="my:consumer3"/>
     </xsl:when>
     
     <xsl:otherwise>
        <jbi:forward service="my:consumer1"/>
     </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>

Reply via email to