Hi

In order to learn about ServiceMix and Fuse, I have read docs. I have
studied the examples included in their distributions as well. Now, I am
about to begin to play with those examples, implementing tiny modifications
to them, on ServiceMix 3.0.

The first exercise I am trying to do is to add a wire tap to the Loan Broker
example. I have placed it between the Loan Broker and the Credit Agency.

To do that, I have added the following elements to the SU servicemix.xml
file:

<!-- EIP - Wire Tap -->
<sm:activationSpec>
  <sm:component>
    <eip:component>
      <eip:endpoints>
        <eip:wire-tap service="lb:wireTap" endpoint="endpoint">
          <eip:target>
            <eip:exchange-target service="lb:credit-agency" />
          </eip:target>
          <eip:inListener>
            <eip:exchange-target service="lb:trace1" />
          </eip:inListener>
        </eip:wire-tap>
      </eip:endpoints>
    </eip:component>
  </sm:component>
</sm:activationSpec>
                  
<!-- EIP - Wire Tap - JMS Provider -->
<sm:activationSpec>
  <sm:component>
    <jms:component>
      <jms:endpoints>
        <jms:endpoint service="lb:trace1"
                      endpoint="testProvider"
                      role="provider" 
                      destinationStyle="queue"
                      jmsProviderDestinationName="demo.org.servicemix.test"
                      connectionFactory="connectionFactory" />
      </jms:endpoints>
    </jms:component>
  </sm:component>
</sm:activationSpec>

I have modified the LoanBroker class as well, replacing both references to
Constants.CREDITAGENCY_SERVICE by Constants.WIRE_TAP_SERVICE, and added this
constant into Constants:

String WIRE_TAP_SERVICE = "wire-tap";

Just in case, I have attached the three files mentioned above.

http://www.nabble.com/file/5949/servicemix.xml servicemix.xml 
http://www.nabble.com/file/5950/Constants.java Constants.java 
http://www.nabble.com/file/5951/LoanBroker.java LoanBroker.java 

I have successfully packaged the SA by means of "ant setup". However, as I
try to deploy it by means of a static configuration (servicemix.xml), the
following problem, exception and stack trace are reported, and I have not
been able to find out its reason:

servicemix.bat: Ignoring predefined value for SERVICEMIX_HOME
Starting Apache ServiceMix ESB: 3.0-incubating

Loading Apache ServiceMix from file: servicemix.xml
INFO  - JBIContainer                   - ServiceMix 3.0-incubating JBI
Container (ServiceMix) is starting
INFO  - JBIContainer                   - For help or more informations
please see: http://incubator.apache.org/servicemix/
INFO  - ConnectorServerFactoryBean     - JMX connector available at:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO  - ComponentMBeanImpl             - Initializing component:
#SubscriptionManager#
INFO  - DeploymentService              - Restoring service assemblies
INFO  - ComponentMBeanImpl             - Setting running state for
Component: servicemix-lwcontainer to Shutdown
INFO  - ServiceAssemblyLifeCycle       - Stopping service assembly:
loanbroker
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
loanbroker
ERROR - DeploymentService              - Unable to restore state for service
assembly loanbroker
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message";
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>stop</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message";>
<component-name>servicemix-lwcontainer</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>Target component servicemix-lwcontainer for service unit
loanbroker is not started</loc-message>
</msg-loc-info>
</task-status-msg>
</task-result-details>
</component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>

        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:121)
        at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:107)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.stop(ServiceAssemblyLifeCycle.java:190)
        at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.restore(ServiceAssemblyLifeCycle.java:330)
        at
org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:97)
        at
org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.java:595)
        at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:79)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:957)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:924)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:415)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:242)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:239)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:155)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:303)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:149)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:100)
        at org.apache.servicemix.Main.main(Main.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
INFO  - JBIContainer                   - ServiceMix JBI Container
(ServiceMix) started
INFO  - JBIContainer                   - ServiceMix JBI Container
(ServiceMix) stopped

What am I doing wrong? What should I do?

Thanks in advance !

Luis

-- 
View this message in context: 
http://www.nabble.com/Loan-Broker-example---Adding-a-Wire-Tap-tf3124307s12049.html#a8655889
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to