JBossESB的安装及部署使用HelloWorld

本文主要介绍JBossESB4.7的安装,并将其部署到JBoss 5.10中。最后利用一个HelloWorld实例来验证安装的成功与否。

1、安装软件准备

首先下载JBossESB4.7,网址:http://www.jboss.org/jbossesb/downloads.html

同时需要下载JBoss 5.10,网址:http://www.jboss.org/jbossas/downloads.html

2、安装环境的配置

将下载 JBoss 5.10 GA解压在D盘下,并设置环境变量:%JBOSS_HOME %=D:/JBOSS5

并在其CLASSPATH中添加%JBOSS_HOME%/lib;

将下载JBossESB 4.7解压在D盘,并设置其环境变量:%JBOSSESB_HOME% = D:/JBOSSESB。并在其CLASSPATH中添加%JBOSSESB_HOME%/lib;

3、修改JBOSSESB中的配置文件

修改 %JBossESB_HOME% 目录里的 product/install 下的 deployment.properties-example 并另存为 deployment.properties
  把 org.jboss.esb.appserver.home 修改为JBoss实际的路径

org.jboss.esb.appserver.home = D://JBOSS5

4、拷贝JBossESB中的文件,将JBossESBJBoss关联

%JBossESB_HOME% 目录里的 product/install 下运行 ant,这样会拷贝一堆部署文件到 JBoss 下。

internal.deploy.jbossas5:

[echo] Deploy to JBossAS5

[mkdir] Created dir: D:/JBOSS5/server/default/deployers/esb.deployer

[copy] Copying 52 files to D:/JBOSS5/server/default/deployers/esb.deployer/lib

[copy] Copying 2 files to D:/JBOSS5/server/default/deployers/esb.deployer/META-INF

[copy] Copying 5 files to D:/JBOSS5/server/default/deployers/esb.deployer

[copy] Copying 8 files to D:/JBOSS5/server/default/lib

[copy] Copying 4 files to D:/JBOSS5/server/default/deploy/jbossesb.sar

[copy] Copying 1 file to D:/JBOSS5/server/default/deploy/jbossesb.sar/META-INF

[copy] Copying 14 files to D:/JBOSS5/server/default/deploy/jbossesb-registry.sar

[copy] Copying 1 file to D:/JBOSS5/server/default/deploy/jbossesb-registry.sar/META-INF

[copy] Copying 26 files to D:/JBOSS5/server/default/deploy/jbossesb.esb

[copy] Copying 62 files to D:/JBOSS5/server/default/deploy/jbpm.esb

[copy] Copying 18 files to D:/JBOSS5/server/default/deploy/jbrules.esb

[copy] Copying 6 files to D:/JBOSS5/server/default/deploy/smooks.esb

[copy] Copying 13 files to D:/JBOSS5/server/default/deploy/spring.esb

[copy] Copying 13 files to D:/JBOSS5/server/default/deploy/soap.esb

[copy] Copying 3 files to D:/JBOSS5/server/default/deploy/slsb.esb

[copy] Copying 17 files to D:/JBOSS5/server/default/deploy/soapui-client.sar

[copy] Copying 1 file to D:/JBOSS5/server/default/deploy/soapui-client.sar/META-INF

[copy] Copying 1 file to D:/JBOSS5/server/default/deploy

[copy] Copying 1 file to D:/JBOSS5/server/default/lib

在将JBossESBJBoss 5关联起来以后,检查 jbossesb.sar 目录是否拷贝到 deploy 目录下。

5启动JBoss,并查看后台日志信息

$run –c default

利用该命令以default方式来启动JBoss 5服务器。以观察后台日志是否与没有JBoss ESB配置前有差别,应该会多许多内容,而且启动时间会加长。

若在后台日志中显示如下内容,而且没有Error信息表明服务器已经启动。

16:34:17,049 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

16:34:17,081 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009

16:34:17,096 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:41s:562ms

6、部署使用 Hello World QuickStart

a、首先进入到%JBOSSESB_HOME%/samples/quickstarts/helloworld

b、在控制台上输入ant deploy,将该应用部署到应用服务器中。

$ ant deploy

控制台输出的信息如下:

check-jbossesb-dist:

qslib-dependencies:

non-qslib-dependencies:

jbossesb-quickstart-override:

jbossesb-source-dependencies:

jbosssb-server-dependencies:

check-as-version:

[echo] D:/JBOSS5/server/default

jbossesb-dependencies-as4:

jbossesb-dependencies-as5:

messaging-config:

messaging-dependencies:

jbossmq-dependencies:

quickstart-specific-dependencies:

classpath-dependencies-as4:

claspath-dependencies-as5:

quickstart-specific-checks:

dependencies:

check-jms-dests:

undeploy-messaging:

quickstart-specific-undeploys:

[echo] No Quickstart specific undeployments being made.

undeploy:

[delete] Deleting: D:/JBOSS5/server/default/deploy/Quickstart_helloworld.esb

BUILD SUCCESSFUL

Total time: 0 seconds

D:/JBOSSESB/samples/quickstarts/helloworld>ant deploy

Buildfile: build.xml

check-jbossesb-dist:

qslib-dependencies:

non-qslib-dependencies:

jbossesb-quickstart-override:

jbossesb-source-dependencies:

jbossesb-server-dependencies:

check-as-version:

[echo] D:/JBOSS5/server/default

jbossesb-dependencies-as4:

jbossesb-dependencies-as5:

messaging-config:

messaging-dependencies:

jbossmq-dependencies:

quickstart-specific-dependencies:

classpath-dependencies-as4:

classpath-dependencies-as5:

quickstart-specific-checks:

dependencies:

compile:

config:

copy-metainf:

quickstart-specific-assemblies:

[echo] No Quickstart specific assembly tasks.

package-deployment:

prepare-deployment:

quickstart-specific-predeploys:

[echo] No Quickstart specific predeployments being made.

check-exploded:

deploy-esb:

[copy] Copying 1 file to D:/JBOSS5/server/default/deploy

deploy-exploded-esb:

quickstart-specific-deploys:

[echo] No Quickstart specific deployments being made.

display-instructions:

[echo]

[echo] ******************

[echo] Quickstart deployed to target JBoss ESB/App Server at 'D:/JBOSS5/server/default/deploy'.

[echo] 1. Check your ESB Server console to make sure the deployment was executed without errors.

[echo] 2. Run 'ant runtest' to run the Quickstart.

[echo] 3. Check your ESB Server console again. The Quickstart should have produced some output.

[echo] ******************

deploy:

BUILD SUCCESSFUL

同时在JBoss 5的控制台上会有如下对应的信息:

16:59:08,221 INFO [QueueService] Queue[/queue/quickstart_helloworld_Request_esb] started, fullSize=200000, pageSize=2000, downCacheSize=2000

16:59:16,440 INFO [QueueService] Queue[/queue/quickstart_helloworld_Request_gw] started, fullSize=200000, pageSize=2000, downCacheSize=2000

16:59:16,440 INFO [EsbDeployment] Starting ESB Deployment 'Quickstart_helloworld.esb'

c、部署完成后,采用命令ant runtest进行测试

$ ant runtest

当前控制台输出的信息如下:

D:/JBOSSESB/samples/quickstarts/helloworld>ant runtest

Buildfile: build.xml

check-jbossesb-dist:

qslib-dependencies:

non-qslib-dependencies:

jbossesb-quickstart-override:

jbossesb-source-dependencies:

jbossesb-server-dependencies:

check-as-version:

[echo] D:/JBOSS5/server/default

jbossesb-dependencies-as4:

jbossesb-dependencies-as5:

messaging-config:

messaging-dependencies:

jbossmq-dependencies:

quickstart-specific-dependencies:

classpath-dependencies-as4:

classpath-dependencies-as5:

quickstart-specific-checks:

dependencies:

compile:

runtest:

[echo] Runs Test JMS Sender

[java] Connection Started

BUILD SUCCESSFUL

同时会在JBoss 5对应的控制台上输出如下的信息:

17:02:52,674 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

17:02:52,674 INFO [STDOUT] Body: Hello World

17:02:52,674 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

17:02:52,674 INFO [STDOUT] Message structure:

17:02:52,674 INFO [STDOUT] [Hello World].

至此,JBoss 5JBossESB运行Hello World程序已经完成。

d、利用ant deploy将已经部署的服务进行卸载

$ ant undeploy

当前控制台输出的信息如下:

D:/JBOSSESB/samples/quickstarts/helloworld>ant undeploy

Buildfile: build.xml

check-jbossesb-dist:

qslib-dependencies:

non-qslib-dependencies:

jbossesb-quickstart-override:

jbossesb-source-dependencies:

jbossesb-server-dependencies:

check-as-version:

[echo] D:/JBOSS5/server/default

jbossesb-dependencies-as4:

jbossesb-dependencies-as5:

messaging-config:

messaging-dependencies:

jbossmq-dependencies:

quickstart-specific-dependencies:

classpath-dependencies-as4:

classpath-dependencies-as5:

quickstart-specific-checks:

dependencies:

check-jms-dests:

undeploy-messaging:

quickstart-specific-undeploys:

[echo] No Quickstart specific undeployments being made.

undeploy:

[delete] Deleting: D:/JBOSS5/server/default/deploy/Quickstart_helloworld.esb

BUILD SUCCESSFUL

同时JBoss 5对应的控制台上会输出如下内容:

17:06:08,393 INFO [EsbDeployment] Stopping 'Quickstart_helloworld.esb'

17:06:08,565 INFO [EsbDeployment] Destroying 'Quickstart_helloworld.esb'

17:06:08,565 WARN [ServiceMessageCounterLifecycleResource] Calling cleanup on existing service message counters for identity ID-8

17:06:08,581 INFO [QueueService] Queue[/queue/quickstart_helloworld_Request_gw] stopped

17:06:08,581 INFO [QueueService] Queue[/queue/quickstart_helloworld_Request_esb] stopped

至此,已经部署的Hello World例程已经全部从JBoss 5中卸载。

你可能感兴趣的:(helloworld)