Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning
titleClasspath issues when embedding servicemix-jsr181 component

When using the servicemix.xml configuration file to create jsr181 endpoints, you must include the servicemix-jsr181-xxx.jar in your classpath.
You will find this file inside the component installer (./components/servicemix-jsr181-xxx.zip).
Failing this, an IllegalArgumentException will be thrown with the following message:
Component name: xxxxxx is bound to an object which is not a JBI component, it is of type: javax.xml.namespace.QName
or aanother exception with

Proxies

You can create java proxies for JBI endpoints, provided that they expose a WSDL.

Wiki Markup
{snippet:id=proxy|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml}

You can use it from one of you client bean, or from inside another component, and call the JBI endpoint as a plain Java object.

Code Block
langjava

  private Echo echo;
  
  public void setEcho(Echo echo) {
    this.echo = echo;
  }

  public void myMethod() {
    String result = echo.echo("world");
    ...
  }

EJBs

Using spring EJB proxies, you can easily expose an existing EJB on the JBI bus.

Code Block
langxml

<jsr181:endpoint annotations="none" service="my:ejb" endpoint="ejb" 
                 serviceInterface="foo.bar.Hello">
  <jsr181:pojo>
    <bean class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="jndiName" value="my/jndi/path"/>
      <property name="businessInterface" value="foo.bar.Hello"/>
      <property name="jndiTemplate" ref="jndiTemplate"/>
    </bean>
  </jsr181:pojo>
</jsr181:endpoint>