Connections are "proxy" endpoints, that will be replaced by the real
endpoint given in the sa descriptor when an exchange is sent to the
specified "proxy" endpoint.
In the servicemix.xml for the http receiver, you should set the target
interface/service/endpoint so that it will match the one in your jbi
descriptor for both the su and the sa.

Cheers,
Guillaume Nodet

On 5/15/06, SP Liu <[EMAIL PROTECTED]> wrote:

       Recently I wrote a SA with two SUs by using connections,which can
deployed successfully on Geronimo,but it will show some errors as below when
running HTTP client
...
08:01:44,484 INFO  [ServiceAssemblyLifeCycle] Starting service assembly:
stockQuote
08:01:44,500 INFO  [ServiceUnitLifeCycle] Initializing service unit:
httpReceiver
08:01:44,500 INFO  [ServiceUnitLifeCycle] Initializing service unit:
saajBinding
08:01:44,500 INFO  [ServiceUnitLifeCycle] Starting service unit:
httpReceiver
08:01:44,500 INFO  [ComponentMBeanImpl] Initializing component:
httpReceiverTwo
08:01:44,593 INFO  [log] Logging to [EMAIL PROTECTED]
via org.mortbay.log.Slf4jLog
08:01:44,593 INFO  [ComponentMBeanImpl] Starting component: httpReceiverTwo
08:01:44,828 INFO  [log] Started SocketConnector @ localhost:8912
08:01:44,828 INFO  [ServiceUnitLifeCycle] Starting service unit: saajBinding
08:01:44,828 INFO  [ComponentMBeanImpl] Initializing component:
stockQuoteTwo
08:01:44,843 INFO  [ComponentMBeanImpl] Starting component: stockQuoteTwo
08:01:44,953 INFO  [ServiceMixDeployment] Starting JBI deployment:
D:\develop\geronimo-1.0\var\temp\geronimo-deployer34777.tmpdir\http-demo-sa.zip
08:02:19,046 WARN  [log] /:
javax.jbi.messaging.MessagingException: Could not find route for exchange:
[EMAIL PROTECTED] for service: null and
interface: null
        at 
org.apache.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:309)
        at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:683)
...


Here is my code,I hope that someone can point out the problem.
Thanks!
     SP Liu

1. SA
http-demo-sa.zip with this structure:
/META-INF/jbi.xml
/httpReceiver-su.zip
/saajBinding-su.zip

the content of jbi.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi"; version="1.0"
        xmlns:my="http://servicemix.org/demos/http-request";
        xmlns:foo="http://servicemix.org/demos/saaj-request";>
   <service-assembly>
     <identification>
       <name>stockQuote</name>
       <description>stockQuote Service Assembly</description>
     </identification>
     <service-unit>
       <identification>
         <name>httpReceiver</name>
         <description>listen on port 8912 and forward to
stockQuote</description>
       </identification>
       <target>
         <artifacts-zip>httpReceiver-su.zip</artifacts-zip>
         <component-name>servicemix-lwcontainer</component-name>
       </target>
     </service-unit>
     <service-unit>
       <identification>
         <name>saajBinding</name>
         <description>invokes another service</description>
       </identification>
       <target>
         <artifacts-zip>saajBinding-su.zip</artifacts-zip>
         <component-name>servicemix-lwcontainer</component-name>
       </target>
     </service-unit>
     <connections>
        <connection>
                        <consumer service-name="my:soapbinding"
endpoint-name="soapbinding"/>
                        <provider service-name="foo:stockQuote" 
endpoint-name="stockQuote"/>
        </connection>
     </connections>
    </service-assembly>
</jbi>


2. SU
httpReceiver-su.zip with this structure:
/META-INF/jbi.xml
/servicemix.xml

the content of jbi.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi"; version="1.0"
        xmlns:my="http://servicemix.org/demos/http-request";
        xmlns:foo="http://servicemix.org/demos/saaj-request";>
        <services>
                <consumes service-name="my:soapbinding" 
endpoint-name="soapbinding"/>
                <provides interfaceName="my:httpReceiver-interface"
service-name="my:httpReceiver" endpoint-name="httpReceiver"/>
        </services>
</jbi>

the content of servicemix.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:my="http://servicemix.org/demos/http-request";
       xmlns:foo="http://servicemix.org/demos/saaj-request";>
        <sm:serviceunit id="jbi">
          <sm:activationSpecs>
                <!-- Create a http server binding on port 8912  and have it 
forward to the
foo:stockQuote -->
                <sm:activationSpec componentName="httpReceiverTwo"
                                                   
interfaceName="my:httpReceiver-interface"
                                                   service="my:httpReceiver"
                                                   endpoint="httpReceiver">        
                                        >
                  <sm:component>
                    <bean 
class="org.apache.servicemix.components.http.HttpConnector">
                              <property name="host" value="localhost"/>
                              <property name="port" value="8912"/>
                    </bean>
                  </sm:component>
                </sm:activationSpec>
        </sm:activationSpecs>
    </sm:serviceunit>
</beans>


3. SU
saajBinding-su.zip with this structure:
/META-INF/jbi.xml
/servicemix.xml

the content of jbi.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi"; version="1.0"
        xmlns:my="http://servicemix.org/demos/http-request";
        xmlns:foo="http://servicemix.org/demos/saaj-request";>
        <services>
                <provides interfaceName="foo:stockQuote-interface"
service-name="foo:stockQuote" endpoint-name="stockQuote"/>
        </services>
</jbi>

the content of servicemix.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:foo="http://servicemix.org/demos/saaj-request";>
        <sm:serviceunit id="jbi">
          <sm:activationSpecs>
             <!-- This just invokes another service -->
                <sm:activationSpec componentName="stockQuoteTwo"
                                                   
interfaceName="foo:stockQuote-interface"
                                                   service="foo:stockQuote"
                                                   endpoint="stockQuote">
                  <sm:component>
                    <bean 
class="org.apache.servicemix.components.saaj.SaajBinding">
                              <property name="soapEndpoint">
                                      <bean 
class="javax.xml.messaging.URLEndpoint">
                                              <constructor-arg 
value="http://64.124.140.30/soap"/>
                                      </bean>
                              </property>
                    </bean>
                  </sm:component>
                </sm:activationSpec>
        </sm:activationSpecs>
    </sm:serviceunit>
</beans>
--
View this message in context: 
http://www.nabble.com/SA-using-connections-error-t1618497.html#a4385958
Sent from the ServiceMix - User forum at Nabble.com.




--
Cheers,
Guillaume Nodet

Reply via email to