Skip to main content Skip to complementary content
Close announcements banner

Build and install the cxf-jmx sample applications

Before you begin

This sample is in <TalendRuntimePath>/examples/talend/tesb/cxf-jmx directory and consists of a number of parts:

Directory Description
client/ a sample client application that uses the CXF JAX-WS API to create a SOAP client and make several calls with it.
common/ code that is common for both the client and the server.
features/ example features for use in OSGi deployment.
service/ the CXF web service provider packaged as an OSGi bundle.
war/ A WAR archive containing code from common and service modules. This is for Servlet container use only, not used in OSGi deployment.

Procedure

  1. From the base directory of the sample, the maven pom.xml file can be used to build and run the demo.
    cd cxf-jmx
    mvn install 
  2. Start Talend Runtime Container:
    • trun.sh (on Linux)
    • trun.bat (on Windows)
  3. Add cxf-jmx example features URL. Type this command in Talend Runtime Container:
    feature:repo-add mvn:org.talend.esb.examples/cxf-jmx-feature//xml
  4. Install cxf-jmx example feature into the Talend Runtime Container
    feature:install cxf-jmx-service
  5. You can find wsdl at http://localhost:8040/services/simpleService?wsdl.
  6. Now run the client; from cxf-jmx folder run:
    mvn exec:java -pl client
    Information noteNote: This will include some deliberate errors (to simulate failed requests), which you can ignore:
        [...]
        Hi Alex!
        Hi Alex!
        Hi Alex!
        2
        4
        6
        8
        10
        [WARNING]
        java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        [...]
  7. After the SOAP calls on the web service have completed, in JConsole, under org.apache.cxf you'll see the Performance.Counter.Server folder, where CXF MBeans with their attributes will be listed.

What to do next

Now we do the Nagios monitoring:

  1. Add the template configuration file to the existing nagios.cfg, here are some examples, which depend on where your installation puts config files:
    In /usr/local/nagios/etc/nagios.cfg add:
    cfg_file=/usr/local/nagios/etc/objects/cxf_host.cfg
    Or in /etc/nagios3/nagios.cfg add:
    cfg_file=/etc/nagios3/etc/objects/cxf_host.cfg
  2. Then, restart Nagios for the changes to take effect.
    # service nagios restart
    Information noteNote: the name of this service may vary, depending on which package you used to install Nagios, so it may be called, for example, nagios3, instead of nagios.
  3. Login to the Nagios Web Interface http://<nagios_host>/<nagios_server>/ for example: http://localhost/nagios/, http://192.168.1.10/nagios3/ or http://192.168.198.5/nagios/.There, you will find the status of metrics for cxf-jmx example.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!