LibraryToggle FramesPrintFeedback

In order to generate a project using a Fuse ESB Enterprise Maven archetype, you must have the following prerequisites:

To install and run the generated cxf-code-first-bundle project, perform the following steps:

  1. Build the project—open a command prompt and change directory to ProjectDir/cxf-code-first-bundle. Use Maven to build the demonstration by entering the following command:

    mvn install

    If this command runs successfully, the ProjectDir/cxf-code-first-bundle/target directory should contain the bundle file, cxf-code-first-bundle-1.0-SNAPSHOT.jar.

  2. Install and start the cxf-code-first-bundle bundle—at the Fuse ESB Enterprise console, enter the following command:

    karaf@root> osgi:install -s file:ProjectDir/cxf-code-first-bundle/target/cxf-code-first-bundle-1.0-SNAPSHOT.jar

    Where ProjectDir is the directory containing your Maven projects and the -s flag directs the container to start the bundle right away. For example, if your project directory is C:\Projects on a Windows machine, you would enter the following command:

    karaf@root> osgi:install -s file:C:/Projects/cxf-code-first-bundle/target/cxf-code-first-bundle-1.0-SNAPSHOT.jar
    [Note]Note

    On Windows machines, be careful how you format the file URL—for details of the syntax understood by the file URL handler, see File URL Handler.

    Alternatively, you could install the bundle from your local Maven repository, using the following PAX mvn URL:

    karaf@root> osgi:install -s mvn:org.fusesource.example/cxf-code-first-bundle/1.0-SNAPSHOT
  3. Test the Web serivce—to test the Web service deployed in the previous step, you can use a web browser to query the service's WSDL. Open your favorite web browser and navigate to the following URL:

    http://localhost:8181/cxf/PersonServiceCF?wsdl

    When the web service receives the query, ?wsdl, it returns a WSDL description of the running service.

  4. Stop the cxf-code-first-bundle bundle—to stop the cxf-code-first-bundle bundle, you first need to discover the relevant bundle number. To find the bundle number, enter the following console command:

    karaf@root> osgi:list

    At the end of the listing, you should see an entry like the following:

    [ 191] [Active     ] [            ] [       ] [   60] A CXF Code First OSGi Project (1.0.0.SNAPSHOT)

    Where, in this example, the bundle number is 191. To stop this bundle, enter the following console command:

    karaf@root> osgi:stop 191
Comments powered by Disqus
loading table of contents...