このコンテンツは選択した言語では利用できません。

31.2. Running the Demonstrations


Building the demonstrations

Use Apache Maven to build the demonstrations. Open a new command prompt, change directory to cxf-webinars-jboss-fuse-6.1, and enter the following commands:
cd parent
mvn install
cd ..
mvn install
The first invocation of mvn install is to install the parent POM in your local Maven repository (so that it is available for the main build step).
The second invocation of mvn install is the main build step. This command builds all of the demonstrations under the cxf-webinars-jboss-fuse-6.1 directory (where the demonstrations are defined to be submodules of the cxf-webinars-jboss-fuse-6.1/pom.xml project). While Maven is building the demonstration code, it downloads whatever dependencies it needs from the Internet and installs them in the local Maven repository.

Starting and configuring the Red Hat JBoss Fuse container

Start and configure the Red Hat JBoss Fuse container as follows:
  1. (Optional) If your local Maven repository is in a non-standard location, you might need to edit the JBoss Fuse configuration to specify your custom location. Edit the InstallDir/etc/org.ops4j.pax.url.mvn.cfg file and set the org.ops4j.pax.url.mvn.localRepository property to the location of your local Maven repository:
    #
    # Path to the local maven repository which is used to avoid downloading
    # artifacts when they already exist locally.
    # The value of this property will be extracted from the settings.xml file
    # above, or defaulted to:
    #     System.getProperty( "user.home" ) + "/.m2/repository"
    #
    #org.ops4j.pax.url.mvn.localRepository=
    org.ops4j.pax.url.mvn.localRepository=file:E:/Data/.m2/repository
  2. Launch the JBoss Fuse container. Open a new command prompt, change directory to InstallDir/bin, and enter the following command:
    ./fuse

Running the customer-ws-osgi-bundle demonstration

It is now a relatively straightforward task to run each of the demonstrations by installing the relevant OSGi bundles.
For example, to start up the WSDL-first Web service (discussed in Chapter 33, WSDL-First Service Implementation), enter the following console commands:
JBossFuse:karaf@root> install -s mvn:com.fusesource.byexample.cxf-webinars/customer-ws-osgi-bundle
To see the Web service in action, start up the sample Web service client (discussed in Chapter 34, Implementing a WS Client), by entering the following console command:
JBossFuse:karaf@root> install -s mvn:com.fusesource.byexample.cxf-webinars/customer-ws-client
The bundle creates a thread that invokes the Web service once a second and logs the response. View the log by entering the following console command:
JBossFuse:karaf@root> log:tail -n 4
You should see log output like the following:
18:03:58,609 | INFO  | qtp5581640-231   | CustomerServiceImpl              | ?                                   ? |
 218 - org.fusesource.sparks.fuse-webinars.cxf-webinars.customer-ws-osgi-bundle - 1.1.4 | Getting status for custome
 r 1234
18:03:58,687 | INFO  |  invoker thread. | ClientInvoker                    | ?                                   ? |
 219 - org.fusesource.sparks.fuse-webinars.cxf-webinars.customer-ws-client - 1.1.4 | Got back: status = Active, stat
 usMessage = In the park, playing with my frisbee.
18:04:00,687 | INFO  | qtp5581640-232   | CustomerServiceImpl              | ?                                   ? |
 218 - org.fusesource.sparks.fuse-webinars.cxf-webinars.customer-ws-osgi-bundle - 1.1.4 | Getting status for custome
 r 1234
18:04:00,703 | INFO  |  invoker thread. | ClientInvoker                    | ?                                   ? |
 219 - org.fusesource.sparks.fuse-webinars.cxf-webinars.customer-ws-client - 1.1.4 | Got back: status = Active, stat
 usMessage = In the park, playing with my frisbee.
To stop viewing the log, type the interrupt character (usually Ctrl-C).
To stop the client, first discover the client's bundle ID using the osgi:list console command. For example:
JBossFuse:karaf@root> list | grep customer-ws-client
[ 219] [Active     ] [            ] [Started] [   60] customer-ws-client (1.1.4)
You can then stop the client using the osgi:stop console command. For example:
JBossFuse:karaf@root> stop 219
To shut down the container completely, enter the following console command:
JBossFuse:karaf@root> shutdown -f

Running the other demonstrations

The remaining demonstrations are all based on the Camel CXF component. You can only run one of these demonstrations at a time, because they all use the same Web service port and would clash, if started at the same time:
  • customer-ws-camel-cxf-pojo
  • customer-ws-camel-cxf-payload
  • customer-ws-camel-cxf-provider
The preceding demonstrations all require the Camel CXF component and some of them require the Camel Velocity component as well. Before you run the demonstrations, you must install the requisite features for these Camel components, as follows:
JBossFuse:karaf@root> features:install camel-cxf
JBossFuse:karaf@root> features:install camel-velocity
You can test these demonstrations using the provided customer-ws-client client or using the third-party SoapUI utility.
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.