Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Deploying JBI Jars to JBoss

This document discusses how to deploy ServiceMix to the JBoss application server.

The JBoss deployer has been enhanced to allow We have recently added a JBoss deployer that allows you drop JBI components and service-assemblies to be installed and deployed directly into your the JBoss 4.0 deploy directory. 2 From the deploy directory and have , JBoss picks them up and and passes them to a ServiceMix JBI container running right inside of the JBoss application server. You will see your After deployment, JBI MBeans can be seen in the normal a JMX console and be able to access your J2EE resources can be accessed as you would with a standard JBoss deployable component.

The JBoss JMX Console Showing the ServiceMix Deployment:

Currently the deployer is available from CVS in tooling/jboss-deployer, the build process is completely managed by Maven, though you will first need to install a SAR plugin for Maven to allow it to build the SAR (Service Archive) for the JBoss deployer. This can be done by checking out tooling/maven-sar-plugin and running:

No Format

maven plugin:install

This will install the SAR plugin you can download the jboss-deployer code and run the following goal in Maven:

Installing the JBoss Deployer

Due to licensing reasons, the JBoss deployer is available at Codehaus.
You can build it using the following commands.

Code Block

svn co http://svn.codehaus.org/servicemix/trunk/jboss-deployer
cd jboss-deployer
mvn 
No Format

maven sar:install

You will then find a servicemix-jboss-deployer-3.1.02.jboss-SNAPSHOT.sar in the target directory, simply take this and . Rename this file to end in ".sar" and then drop it in your JBoss deploy directory (currently only tested on JBos JBoss 4.0.3 and 4.0.25), and away you go!!! Want to see it in action? You should be able to drop the JBI RI Transformation Engine example straight into the deploy directory and watch it pick up. Suddenly you have JBI enabled your JBoss Server!

Deploying standard JBI artifacts

You can deploy standard JBI components and Service Assemblies on your JBI-enabled JBoss, by simply copying these artifacts to the deploy directory in JBoss. They will all use the same JBI container and will be able to communicate together.

...

Note that if you use XBean configuration files (see below), each file dropped will create a new JBI container.
To work around that, you can change your servicemix.xml file and deploy it as a Service Unit on the lightweight container.

Deploying ServiceMix XBean Configurations

Most of the examples that ship with ServiceMix are not delivered in the JBI component/service assembly form but as servicemix.xml configurations that utilize the SpringJBIContainer XBean infrastructure in ServiceMix. This approach lets you quickly get a JBI architecture up and running and while not directly in-line with the JSR-208 specification it is a powerful approach.

Info
titleUseful Information

Note that if you are planning on using the components that ship with ServiceMix there , their libraries are not included in the ServiceMix JBoss deployer. Therefore, therefore you will need to copy your $SERVICEMIX_HOME/lib and $SERVICEMIX_HOME/lib/optional directories to your application server's library path (ie. $JBOSS_HOME/server/default/lib).

 
Since it is this approach that most people start with we added the ability to deploy this these Spring JBI configurations onto JBoss, in in JBoss.  In order to do this deploy the 1.0-SNAPSHOT deployer that you see below and then , take a servicemix.xml configuration file and rename it so that it ends in -sm.xml (ie. vfsfilebind-sm.xml), then .  Place the configuration file in the JBoss deploy directory.   Before you do that, you will need to make same basic modification some basic modifications to the configuration file to get it running:, namely you will need to make sure that the createMBeanServer property is false.  Below is the file binding example configured to run under JBoss.

Example filebindingExample vfs-sm.xml for ServiceMix 3.0

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:my:sm="http://servicemix.apache.org/config/1.0"
       xmlns:foo="http://servicemix.org/demo/">

  <!-- the JBI container -->
  <container<sm:container id="jbi">
  
   <property name="createMBeanServer" value="false"/>
   <property name="dumpStats" value="true"/>
   <property nameuseMBeanServer="statsInterval" value="10"/>  false"
    <components>
      <!-- Look for files in the inbox directory --> createMBeanServer="false"
      <component id="filePoller" service="foo:filePoller" class="org.servicemix.components.vfs.FilePoller" destinationService="foo:receiver">
        <property namedumpStats="workManager" ref="workManager"/>true"
        <property name="path" value="file:L:\\servicemix-inbox\"/>
        <property namestatsInterval="period" value="1000"/>10">

     </component>    <sm:activationSpecs>

      <!-- Write files to the outbox directory -->
     <component id <sm:activationSpec componentName="fileSender"
                        service="foo:receiver" fileSender">
        <sm:component>
          <bean class="org.apache.servicemix.components.vfsfile.FileWriter">
            <property name="pathdirectory" value="file:L:\\servicemix-outbox\" />
            <property name="marshaler">
              <bean class="org.apache.servicemix.components.util.DefaultFileMarshaler">
                <property name="fileName">
                  <bean class="org.apache.servicemix.expression.JaxenStringXPathExpression">
                     <constructor-arg value="concat('sample_', /sample/@id, '.xml')" />
                  </bean>
                </property>
              </bean>
            </property>
          </component>bean>
        </components>
sm:component>
      </container>sm:activationSpec>

      <!-- theLook workfor managerfiles (threadin pool)the forinbox this containerdirectory -->
      <sm:activationSpec componentName="filePoller"
  <bean id="workManager"                          destinationService="foo:fileSender"
                         service="foo:filePoller">
        <sm:component>
          <bean class="org.activemq.work.SpringWorkManager">
apache.servicemix.components.file.FilePoller">
            <property name="workManager" ref="workManager" />
            <property name="startMaximumPoolSizefile" value="30inbox" />
            <property name="syncMaximumPoolSizeperiod" value="301000" />
          </bean>
        </sm:component>
      </sm:activationSpec>
    </sm:activationSpecs>
  </sm:container>

  <!-- the work manager (thread pool) for this container -->
  <bean id="workManager" class="org.jencks.factory.WorkManagerFactoryBean">
    <property name="scheduledMaximumPoolSizethreadPoolSize" value="30" />
  </bean>

</beans>

Above is the VFS example, however note that to run under JBoss you need to make sure that the createMBeanServer property is false.

...