Tuesday, October 7, 2014

Build, Deploy, Test, And Debug JBoss Fuse Service Works Applications

Introduction

In my previous blog , I have explained the procedures to install and start JBoss FSW as a stand alone server. This article explains the process to build, deploy, Test, and Debug applications for JBoss FSW. After reading this, you, as a JBoss FSW developer, should be able to start develop integration applications based on the platform of JBoss FSW. For those who have used JBoss Development Studio before, this is an easy process. The only thing you need to do is to change the run time server from previous runtime server to the newly installed JBoss FSW.

Install JBoss Development Studio

The details about installation of JBDS is cover in Chapter 7 of this document.

After installing the JBDS, you need to install the runtime server. In my case, I installed my JBoss FSW at /Users/Gary2013/JBoss-FSW/. I call this FSW_HOME. Make sure you have the JBOSS_HOME defined as $FSW_HOME/jboss-eap-6.1. You may also build quickstarts examples from command line.

Import Quickstarts Project to JBDS

I have imported the follow project to my workspace

Modify pom.xml

The example comes with pom.xml with JDK 1.6. We need to change it to 1.7. Looking for 1.6 in the pom.xml file and change the two places to 1.7. You may see error. In this case, you need to update the maven project

Add JBoss FSW Server

Remove The Existing Server

You may have default runtime server, remove it.

Add JBoss FSW Runtime Server

File-->New--Other [or Command-N for macos], the type ser on search panel, you should see the following:

click Add button:
Click 6.1+ Runtime and Next
Select Configuration File. The configuration file is under $JBOSS_HOME/standalone/configuraiton/standalone-full.xml.
click Finish.

Now, your JBDS is configured to run applications on JBoss FSW runtiem. If you have already deployed the switchyard remote invoker project, remove it from the admin console.

Now, let's add the project to the runtime:

Run The Servier

Now we can run the server in either default running mode or in debug mode by click the bug button:
First let's run the server in normal mode. If you run into problem, such as, server cannot start. do the following:
  • shutdown studio
  • make sure there is not FSW runtime is running by run ps -eaf | egrep java
  • run the server outside studio by cd $JBOSS_HOME/bin, standalone.sh -c standalone-full.xml

If above procedure is all good, your application may be deployed to the runtime. There are two ways to deal with this kind of problem. The first is to go to $JBOSS_HOME/standalone/deployment. Make sure the remote-invoker jar file is not presented in the deployment dir. The other is start studio, from add/remove page to remove the war or jar file you are about to deploy.

If everything works, you should be able to see the following from the admin console:

Now, let's test the application from the studio. Do the following:
  • open the file: RemoteClient.java
  • run this client
You should see the following:
Now, you are in business!

Run Maven Project From Terminal

During our installation of FSW, we should tell the install where is our maven setting. If the setting is correct, you should be able to run mvn install command. You may take a look at your ~/.m2/settings.xml file. The RedHat related profile is added.

No comments:

Post a Comment

Anypoint Studio Error: The project is missing Munit lIbrary to run tests

Anypoint Studio 7.9 has a bug. Even if we following the article: https://help.mulesoft.com/s/article/The-project-is-missing-MUnit-libraries-...