Integrating ActiveMQ 5.3.0 with JBoss 6.0.0(调试成功activemq5.8.0+jboss6.1.0)

本文指导如何将ActiveMQ 5.3.0与JBoss应用服务器6.0.0结合使用,通过安装所需的软件,配置环境,并提供详细的步骤来确保服务器正确启动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

12/15/2009

This document explains how ActiveMQ 5.3.0 can be configured in JBoss Application Server 6.0.0 as an embedded broker.

Software Requirements
Here is the list of softwares used in this document.
Apache ActiveMQ 5.3.0
JBoss AS 6.0.0
JDK 1.6+
This article used  Windows XP Professional as the operating system.

Intallation
Step 1: Install JDK 1.6 and verify it runs correctly. After installing Java set JAVA_HOME and update PATH environment variables.
C:\>java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
Step 2:  Install JBoss Application Server 6.0.0 and make sure Server starts correctly. After downloading jboss-6.0.0M1.zip, extract it to a folder. After extrating start the server using run command.

Goto JBoss extracted folder and execute below commands.
C:\>cd JBoss\jboss-6.0.0.M1\bin
C:\JBoss\jboss-6.0.0.M1\bin>run
First few line shows the configuration used by JBoss Server. Check the last line to see whether the server has started propertly.
C:\JBoss\jboss-6.0.0.M1\bin>run
Calling C:\JBoss\jboss-6.0.0.M1\bin\run.conf.bat
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: C:\JBoss\jboss-6.0.0.M1

  JAVA: C:\Program Files\Java\jdk1.6.0_14\bin\java

  JAVA_OPTS: -Dprogram.name=run.bat -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -server

  CLASSPATH: C:\Program Files\Java\jdk1.6.0_14\lib\tools.jar;C:\JBoss\jboss-6.0.0.M1\bin\run.jar

===============================================================================

17:01:33,828 INFO  [AbstractJBossASServerBase] Server Configuration:
        JBOSS_HOME URL: file:/C:/JBoss/jboss-6.0.0.M1/
        Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
        Common Base: $JBOSS_HOME\common/
        Common Library: $JBOSS_HOME\common/lib/
        Server Name: default
        Server Base: $JBOSS_HOME\server/
        Server Library: $JBOSS_HOME\server/default/lib/
        Server Config: $JBOSS_HOME\server/default/conf/
        Server Home: $JBOSS_HOME\server/default/
        Server Data: $JBOSS_HOME\server/default/data/
        Server Log: $JBOSS_HOME\server/default/log/
        Server Temp: $JBOSS_HOME\server/default/tmp/
17:01:33,875 INFO  [AbstractServer] Starting: JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)]
17:01:35,515 INFO  [AbstractMCServerBase] Starting Microcontainer, Main bootstrapURL=file:/C:/JBoss/jboss-.0.0.M1/server/default/conf/bootstrap.xml
17:01:37,250 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
17:01:37,250 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
17:01:38,140 INFO  [CopyMechanism] VFS temp dir: C:\JBoss\jboss-6.0.0.M1\server\default\tmp
17:01:38,140 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.
17:01:41,921 INFO  [ServerInfo] Java version: 1.6.0_14,Sun Microsystems Inc.
17:01:41,921 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
17:01:41,921 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 14.0-b16,Sun Microsystems Inc.
17:01:41,921 INFO  [ServerInfo] OS-System: Windows XP 5.1,x86
...............
...............
17:03:22,437 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
17:03:22,468 INFO  [AbstractServer] JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)] Started in 1m:48s:593ms
To ensure the server has started, visit  http://localhost:8080/web-console/ in your favorite browser and make sure you can see JBoss Web Console.
Now stop JBoss Server using shutdown script(inside <jboss_home>\bin folder) or use Ctrl-C.

Integrating Apache ActiveMQ with the JBoss Application Server. 
Download ApacheMQ using the link above.  After downloading, extract it to a folder and verify that ActiveMQ RAR file is included. This file can be located at [ ACTIVEMQ_INSTALL_DIR]\lib\optional folder.
C:\Softwares\apache-activemq-5.3.0\lib\optional>dir
           102,631 activeio-core-3.1.2.jar
            81,267 activemq-jmdns_1.0-5.3.0.jar
           116,081 activemq-optional-5.3.0.jar
            38,517 activemq-pool-5.3.0.jar
         6,905,784 activemq-rar-5.3.0.rar
           175,130 activemq-xmpp-5.3.0.jar
           118,726 commons-beanutils-1.6.1.jar
            30,085 commons-codec-1.2.jar
           575,389 commons-collections-3.2.1.jar
           121,757 commons-dbcp-1.2.2.jar
           305,001 commons-httpclient-3.1.jar
           197,067 commons-net-2.0.jar
            87,077 commons-pool-1.4.jar
            37,477 geronimo-j2ee-connector_1.5_spec-2.0.0.jar
            67,758 jettison-1.1.jar
           367,444 log4j-1.2.14.jar
           325,942 spring-aop-2.5.6.jar
           488,282 spring-beans-2.5.6.jar
           476,940 spring-context-2.5.6.jar
           285,491 spring-core-2.5.6.jar
           195,350 spring-jms-2.5.6.jar
            15,980 spring-oxm-tiger-1.5.8.jar
           231,173 spring-tx-2.5.6.jar
           474,413 wstx-asl-3.0.1.jar
           130,519 xbean-spring-3.6.jar
            24,544 xmlpull-1.1.3.4d_b4_min.jar
           431,406 xstream-1.3.1.jar
In our case ActiveMQ RAR file name will be  activemq-rar-5.3.0.rar.

Now go to JBoss intallation folder and create a folder for ActiveMQ inside  deploy directory for the required context. Here we are using  default JBoss context.
C:\JBoss\jboss-6.0.0.M1\server\default\deploy>mkdir activemq-rar-5.3.0.rar
Extract the contents of ActiveMQ RAR file(activemq-rar-5.3.0.rar) to this folder.
102,631 activeio-core-3.1.2.jar
         2,923,854 activemq-core-5.3.0.jar
           147,717 activemq-protobuf-1.0.jar
            85,474 activemq-ra-5.3.0.jar
             4,467 aopalliance-1.0.jar
             1,868 broker-config.xml
            52,915 commons-logging-1.1.jar
            44,598 commons-logging-api-1.1.jar
           197,067 commons-net-2.0.jar
         2,141,382 derby-10.1.3.1.jar
            16,030 geronimo-j2ee-management_1.0_spec-1.0.jar
            20,220 geronimo-j2ee-management_1.1_spec-1.0.1.jar
           152,481 kahadb-5.3.0.jar
           367,444 log4j-1.2.14.jar
             1,625 log4j.properties
    <DIR>          META-INF
           488,282 spring-beans-2.5.6.jar
           476,940 spring-context-2.5.6.jar
           285,491 spring-core-2.5.6.jar
           130,519 xbean-spring-3.6.jar
Now we can start configuring ActiveMQ.

Edit  ra.xml file inside  [JBOSS_HOME]\server\default\deploy\activemq-rar-5.3.0.rar\META-INF folder.
<config-property>
   <description>
      The URL to the ActiveMQ server that you want this connection to 
      connect to. If using an embedded broker, this value should be                
      'vm://localhost'.
   </description>
   <config-property-name>ServerUrl</config-property-name>
   <config-property-type>java.lang.String</config-property-type>
   <config-property-value>vm://localhost</config-property-value>
</config-property>
<config-property>
   <description>
     Sets the XML configuration file used to configure the embedded ActiveMQ broker via 
     Spring if using embedded mode. BrokerXmlConfig is the filename which is assumed 
     to be on the classpath unless a URL is specified. So a value of foo/bar.xml 
     would be assumed to be on the classpath whereas file:dir/file.xml would use the file system. 
     Any valid URL string is supported.              
    </description>
    <config-property-name>BrokerXmlConfig</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>xbean:broker-config.xml</config-property-value>
</config-property>
A Pre-Configured  ra.xml can be downladed.

The  broker-config.xml file inside  [JBOSS_HOME]\server\default\deploy\activemq-rar-5.3.0.rar is the ActiveMQ configuration file. This is the file used to configure ActiveMQ. The default contents of this file are usable, but should be customized to suit your environment.

A Pre-Configured  broker-config.xml can be downloaded.

Now start JBoss server to ensure it start without any errors using the same commands we used before. If JBoss Server starts without any errors you can move to next step. Stop the server and continue to next step.

Next step is to configure JBoss to initialize and start ActiveMQ whenever JBoss starts up. This is accomplished by putting an XML ( activemq-jms-ds.xml) inside  [JBOSS_HOME]\server\default\deploy.

A Pre-Configured  activemq-jms-ds.xml can be downloaded.

 Now start JBoss server to ensure it start without any errors using the same commands we used before.  Examine the startup messages for ActiveMQ messages.
21:20:17,453 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:
/JBoss/jboss-6.0.0.M1/server/default/deploy/mail-ra.rar/META-INF/ra.xml
21:20:17,515 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:
/JBoss/jboss-6.0.0.M1/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
21:20:17,968 INFO  [AdminObject] Bound admin object 'org.apache.activemq.command
.ActiveMQQueue' at 'activemq/queue/outbound'
21:20:17,984 INFO  [AdminObject] Bound admin object 'org.apache.activemq.command
.ActiveMQTopic' at 'activemq/topic/inbound'
21:20:18,171 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager
'jboss.jca:service=ConnectionFactoryBinding,name=activemq/QueueConnectionFactory'
to JNDI name 'java:activemq/QueueConnectionFactory'
21:20:18,281 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager
'jboss.jca:service=ConnectionFactoryBinding,name=activemq/TopicConnectionFactory' 
to JNDI name 'java:activemq/TopicConnectionFactory'

Now our environment is ready to go.
 
identity 身份认证 购VIP最低享 7 折! triangle vip 30元优惠券将在58:6:9后过期 去使用 triangle QT+Poppler+PDFviewer.zip 是一个用于在Windows操作系统下,使用QT5框架结合Poppler库开发PDF阅读器的项目。这个项目的核心是利用Poppler库解析PDF文档,并通过QT5进行用户界面的设计和交互。以下将详细介绍相关知识点: 1. **QT5框架**:QT(Qt)是一个跨平台的应用程序开发框架,支持多种操作系统,如Windows、Linux、macOS等。它提供了丰富的库函数和组件,使得开发者可以方便地构建图形用户界面(GUI)应用程序。QT5是QT的第五个主要版本,引入了许多新特性和改进,如QML(Qt Meta Object Language)用于声明式UI设计,以及更好的性能和API优化。 2. **Poppler库**:Poppler是一个开源的PDF文档处理库,源自Xpdf项目,主要用于PDF文件的解析、渲染和提取文本。Poppler提供了C++接口,使得开发者能够方便地在应用程序中集成PDF阅读和处理功能。它可以读取PDF文件,显示页面,提取文本和元数据,甚至支持对PDF文件进行注释和修改(但本项目可能仅涉及阅读功能)。 3. **PDF viewer的实现**:在本项目中,PDF viewer是基于QT5 GUI组件构建的,它利用Poppler库来加载和解析PDF文档。`mainwindow.cpp`和`mainwindow.h`包含了主窗口类的定义和实现,这是用户与应用程序交互的主要界面。`pdfcanvas.cpp`和`pdfcanvas.h`则可能包含了用于显示PDF页面的自定义画布类,该类使用Poppler库来渲染PDF页面到QT的画布上。 4. **项目构建与编译**:`newtime.pro`是QT项目的配置文件,用于指定项目依赖的库(如Poppler)、源代码文件、编译选项等。`.pro.user`文件则保存了用户的特定编译设置,如编译器路径或调试选项。开发者需要使用QT的qmake工具或直接在IDE如Qt Creator中打开此项目,进行编译和链接,确保所有依赖库都正确安装并链接。 5. **文件操作**:`main.cpp`通常是程序的入口点,负责初始化QT应用环境并运行主循环。在PDF viewer中,可能会在`main.cpp`中实例化主窗口,并调用Poppler库的相关函数来加载PDF文件。 6. **使用流程**:用户可以通过QT界面选择PDF文件,然后通过Poppler库读取文件内容,将页面渲染到QT的控件上。用户可以通过滚动、缩放等操作查看PDF内容。 Poppler库的强大功能使得PDF viewer可以支持多页显示、文本搜索、书签管理等高级特性。 7. **优化与扩展**:为了提升用户体验,开发者可能会对PDF viewer进行各种优化,比如添加平滑滚动、快速查找、页面预加载等功能。此外,还可以考虑支持批注、打印、PDF转换等更复杂的操作,以增强软件的功能性和实用性。 QT+Poppler+PDFviewer.zip项目提供了一个基础的PDF阅读器实现,开发者可以在此基础上进一步定制和扩展,以满足特定的PDF处理需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值