Follow the instructions in this section to build and run the JBI container demonstration. These instructions assume that you have already configured your environment as described in Before You Start .
Build the servlet container demonstration as follows:
Open a command prompt and change directory to CeltixInstallDir/samples/service_creation/integration/JBI/internal_provider_external_consumer.
Enter the following command at the command prompt:
ant build
Start and prepare the ServiceMix JBI container as follows:
Enter the following command to start Apache Incubator ServiceMix (in the directory internal_provider_external_consumer):
Windows:
servicemix_start
UNIX:
servicemix_start.sh
ServiceMix should produce output similar to the following:
servicemix.bat: Ignoring predefined value for SERVICEMIX_HOME Starting Apache ServiceMix ESB: 3.0-incubating Loading Apache ServiceMix from servicemix.xml on the CLASSPATH INFO - ConnectorServerFactoryBean - JMX connector available at: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi 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 - ComponentMBeanImpl - Initializing component: #SubscriptionManager# INFO - DeploymentService - Restoring service assemblies INFO - JBIContainer - ServiceMix JBI Container (ServiceMix) started
During start-up, ServiceMix creates the following subdirectories, under the CeltixInstallDir/containers/jbi directory:
data
deploy
install
Open a new command prompt and change directory to CeltixInstallDir/samples/service_creation/integration/JBI/internal_provider_external_consumer.
Deploy the ServiceMix shared component by copying the relevant zip file to the ServiceMix deploy directory, as follows:
Windows:
> copy %CELTIX_HOME%\containers\jbi\components\servicemix-shared-3.0-incubating-installer.zip %CELTIX_HOME%\containers\jbi\deploy
UNIX:
% cp $CELTIX_HOME/containers/jbi/components/servicemix-shared-3.0-incubating-installer.zip $CELTIX_HOME/containers/jbi/deploy
Where it is assumed that the ServiceMix container is running in the internal_provider_external_consumer directory. The running ServiceMix container should produce output similar to the following:
INFO - AutoDeploymentService - Directory: deploy: Archive changed: processing servicemix-shared-3.0-incubating-installer.zip ... INFO - AutoDeploymentService - Directory: deploy: Finished installation of archive: servicemix-shared-3.0-incubating-installer.zip
Deploy the ServiceMix SOAP/HTTP binding component by copying the relevant zip file to the ServiceMix deploy directory, as follows:
Windows:
> copy %CELTIX_HOME%\containers\jbi\components\servicemix-http-3.0-incubating-installer.zip %CELTIX_HOME%\containers\jbi\deploy
UNIX:
% cp $CELTIX_HOME/containers/jbi/components/servicemix-http-3.0-incubating-installer.zip $CELTIX_HOME/containers/jbi/deploy
The running ServiceMix container should produce output similar to the following:
INFO - AutoDeploymentService - Directory: deploy: Archive changed: processing servicemix-http-3.0-incubating-installer.zip ... INFO - jetty - Logging to org.apache.servicemix.http.jetty.JCLLogger@6e56ae via org.apache.servicemix.http.jetty.JCLLogger INFO - ComponentMBeanImpl - Starting component: servicemix-http INFO - ComponentMBeanImpl - Initializing component: servicemix-http INFO - AutoDeploymentService - Directory: deploy: Finished installation of archive: servicemix-http-3.0-incubating-installer.zip
Deploy the ServiceMix JMS binding component by copying the relevant zip file to the ServiceMix deploy directory, as follows:
Windows:
> copy %CELTIX_HOME%\containers\jbi\components\servicemix-jms-3.0-incubating-installer.zip %CELTIX_HOME%\containers\jbi\deploy
UNIX:
% cp $CELTIX_HOME/containers/jbi/components/servicemix-jms-3.0-incubating-installer.zip $CELTIX_HOME/containers/jbi/deploy
The running ServiceMix container should produce output similar to the following:
INFO - AutoDeploymentService - Directory: deploy: Archive changed: processing servicemix-jms-3.0-incubating-installer.zip ... INFO - ComponentMBeanImpl - Starting component: servicemix-jms INFO - ComponentMBeanImpl - Initializing component: servicemix-jms INFO - AutoDeploymentService - Directory: deploy: Finished installation of archive: servicemix-jms-3.0-incubating-installer.zip
Enter the following command to install and start the CXF Service Engine:
Windows:
> servicemix_install_ca %CELTIX_HOME%\samples\service_creation\integration\JBI\internal_provider_externa l_consumer\service-engine\build\lib\cxf-service-engine.jar
UNIX:
% servicemix_install_ca.sh $CELTIX_HOME/samples/service_creation/integration/JBI/internal_provider_external _consumer/service-engine/build/lib/cxf-service-engine.jar
Enter the following command to deploy and start the service assembly:
Windows:
> servicemix_deploy_sa %CELTIX_HOME%\samples\service_creation\integration\JBI\internal_provider_externa l_consumer\service-assembly\build\lib\cxf-service-assembly.zip
UNIX:
% servicemix_deploy_sa.sh $CELTIX_HOME/samples/service_creation/integration/JBI/internal_provider_external _consumer/service-assembly/build/lib/cxf-service-assembly.zip
To run the client, enter the following command (from the directory internal_provider_external_consumer):
ant client
This command produces output similar to the following:
Buildfile: build.xml
client:
client:
[java] file:/C:/Programs/Celtix/samples/service_creation/integration/JBI/internal_provi
der_external_consumer/service-unit/./wsdl/hello_world_client.wsdl
[java] Invoking sayHi...
[java] Server responded with: Bonjour
[java] Invoking greetMe...
[java] Server responded with: Hello YourName
BUILD SUCCESSFUL
Total time: 6 seconds