{scrollbar}

top

1. Quick start

If you are in a hurry to have Apache ServiceMix up and running right away, this article will provide you with some basic steps for downloading, building (when needed) and running the server in no time. This is clearly not a complete guide so you may want to check the other links in the Apache ServiceMix v3.0 - User's Guide main section for further information.

All you need is 5 to 10 minutes and to follow these basic steps.

Background

Apache ServiceMix is a JBI (Java Business Integration, JSR 208) implementation that is completely open source and under the Apache License. ServiceMix v3.0 is the first official release of the JBI container by the Apache Software Foundation.

#top

Getting the software

At this time you have one option to get the software. The fastest and easiest way is to get the binary directly from the Apache site. Since this article is intended to help you to have Apache ServiceMix up and running in the fastest way only the binary download will be covered at this time.

Getting the Software

#top

Start the server

Starting ServiceMix

Problems starting the Server

  • Port 1099 already in use: that means that another application or even another ServiceMix instance has already taken that port. Please make sure that no other ServiceMix instance is running or use netstat -a to figure out which other application is using that port. Keep in mind that some tests start an in-memory ServiceMix instance which also use this port. If all else fail then try to restart your computer. If the port has to be changed to avoid a conflict the edit <SERVICEMIX_HOME>/conf/servicemix.properties file and adjust the rmi.port.

#top

Deploy a sample application

While you will learn in the remainder of this guide how to create and package a JBI application, we will just use the pre-built packaging for now.

Watch out

1. In ServiceMix 3.2.1 and above this step is done automatically when starting ServiceMix.
2. This requires at least ServiceMix 3.0

Open another command line console in the <servicemix_home> directory and run the following commands in Windows

copy components\servicemix-shared-*.zip install copy components\servicemix-http-*.zip install copy components\servicemix-jsr181-*.zip install

respectively Linux:

cp components/servicemix-shared-*.zip install cp components/servicemix-http-*.zip install cp components/servicemix-jsr181-*.zip install

These commands will:

  • install the servicemix-shared Shared Library
  • install the servicemix-http and servicemix-jsr181 JBI components
Launch directory

ServiceMix deploy and install directories are relative to the directory where ServiceMix was started. Be sure to start it from the root dir using the bin/servicemix command. If you run it from the bin dir, the previous commands will fail and you would have to copy the components to the bin/install and bin/deploy folders.

You should see the following on the command line console:

solid INFO - AutoDeploymentService - Directory: install: Archive changed: processing servicemix-shared-3.0-incubating-installer.zip ... INFO - AutoDeploymentService - Directory: install: Finished installation of archive: servicemix-shared-3.0-incubating-installer.zip INFO - AutoDeploymentService - Directory: install: Archive changed: processing servicemix-http-3.0-incubating-installer.zip ... INFO - jetty - Logging to org.apache.servicemix.http.jetty.JCLLogger@12ef4c6 via org.apache.servicemix.http.jetty.JCLLogger INFO - ComponentMBeanImpl - Starting component: servicemix-http INFO - ComponentMBeanImpl - Initializing component: servicemix-http INFO - AutoDeploymentService - Directory: install: Finished installation of archive: servicemix-http-3.0-incubating-installer.zip INFO - AutoDeploymentService - Directory: install: Archive changed: processing servicemix-jsr181-3.0-incubating-installer.zip ... INFO - ComponentMBeanImpl - Starting component: servicemix-jsr181 INFO - ComponentMBeanImpl - Initializing component: servicemix-jsr181 INFO - AutoDeploymentService - Directory: install: Finished installation of archive: servicemix-jsr181-3.0-incubating-installer.zip

Now deploy a JBI Service Assembly which exposes a service over HTTP/SOAP

Watch out

In ServiceMix 3.2.1 and above the deploy directory has been replaced by hotdeploy. Modify the commands accordingly.

Windows:

copy examples\wsdl-first\wsdl-first-sa-*.zip deploy

Linux:

cp examples/wsdl-first/wsdl-first-sa-*.zip deploy

You should see the following on the command line console:

solid INFO - AutoDeploymentService - Directory: deploy: Archive changed: processing wsdl-first-sa-3.0-incubating.zip ... INFO - ServiceAssemblyLifeCycle - Starting service assembly: wsdl-first-sa INFO - ServiceUnitLifeCycle - Initializing service unit: wsdl-first-jsr181-su INFO - ServiceUnitLifeCycle - Initializing service unit: wsdl-first-http-su INFO - ServiceUnitLifeCycle - Starting service unit: wsdl-first-jsr181-su INFO - ServiceUnitLifeCycle - Starting service unit: wsdl-first-http-su INFO - jetty - jetty-6.0.0rc4 INFO - jetty - Started SelectChannelConnector @ localhost:8192 INFO - AutoDeploymentService - Directory: deploy: Finished installation of archive: wsdl-first-sa-3.0-incubating.zip

Now, open a web browser to the following location:

http://localhost:8192/PersonService/main.wsdl

You should see the WSDL of the web service that has just deployed!

Now, open a web browser and point it to the following location: [servicemix_home]/examples/wsdl-first/client.html. Then, click on the SEND button to see the web service response.

IE users

If your version of ServiceMix is older than 3.0.1, and you are using Internet Explorer, you will have to comment out the following line in the client.html web page.

/* netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite"); */

This has been be fixed in the 3.1 release.

#top

Summary

This article showed you how simple it is to have Apache ServiceMix up and running. The overall time for getting the server running should be less than five minutes if you have the prerequisite (Java 1.5) already installed. Additionally, this article also showed you how to deploy and test a simple Web Service in less than five minutes.

#top

{scrollbar}
  • No labels