jboss-5.1.0GA+activemq-5.3.1整合

1、分别解压

2、在jboss-5.1.0.GA/server/default/deploy下建立文件夹activemq-ra-5.3.1.rar

3、将apache-activemq-5.3.1/lib/optional/activemq-rar-5.3.1.rar解压到2中建立的文件夹中

4、修改文件jboss-5.1.0.GA/server/default/deploy/activemq-ra-5.3.1.rar/META-INF/ra.xml

     修改后结果

    <config-property-value>vm://localhost</config-property-value>

     <config-property-value>xbean:broker-config.xml</config-property-value>

5、修改文件jboss-5.1.0.GA/server/default/deploy/activemq-ra-5.3.1.rar/broker-config.xml

     修改结果

     <beans xmlns="http://activemq.apache.org/schema/core">
     <!-- put the following as the first child of the beans element -->
 <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>


  <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
  <broker useJmx="true" useShutdownHook="false" brokerName="bruce.broker1">

     <managementContext>
       <!-- use appserver provided context instead of creating one,
            for jboss use: -Djboss.platform.mbeanserver -->
       <managementContext createConnector="false"/>
     </managementContext>

    <persistenceFactory>
      <journalPersistenceAdapterFactory journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/>
    </persistenceFactory>

    <transportConnectors>
      <transportConnector name="bruce.broker1" uri="tcp://localhost:61616"/>
    </transportConnectors>
   
  </broker>
</beans>

6、新建文件jboss-5.1.0.GA/server/default/deploy/activemq-ds.xml

    文件内容

    <?xml version="1.0" encoding="UTF-8"?>
 
   <!DOCTYPE connection-factories
       PUBLIC "-//JBoss//DTD JBOSS JCA Config 5.0//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-ds_5_0.dtd">
  
   <connection-factories>
  
      <tx-connection-factory>
         <jndi-name>activemq/QueueConnectionFactory</jndi-name>
         <xa-transaction/>
         <use-java-context>false</use-java-context>
         <track-connection-by-tx/>
         <rar-name>activemq-ra-5.3.1.rar</rar-name>
         <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
         <ServerUrl>vm://localhost</ServerUrl>
         <!--
         <UserName>sa</UserName>
         <Password></Password>
         -->
         <min-pool-size>1</min-pool-size>
         <max-pool-size>200</max-pool-size>
         <blocking-timeout-millis>30000</blocking-timeout-millis>
         <idle-timeout-minutes>3</idle-timeout-minutes>
      </tx-connection-factory>
  
      <tx-connection-factory>
         <jndi-name>activemq/TopicConnectionFactory</jndi-name>
         <xa-transaction/>
         <use-java-context>false</use-java-context>
         <track-connection-by-tx/>
         <rar-name>activemq-ra-5.3.1.rar</rar-name>
         <connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
         <ServerUrl>vm://localhost</ServerUrl>
         <!--
         <UserName>sa</UserName>
         <Password></Password>
         -->
         <min-pool-size>1</min-pool-size>
         <max-pool-size>200</max-pool-size>
         <blocking-timeout-millis>30000</blocking-timeout-millis>
         <idle-timeout-minutes>3</idle-timeout-minutes>
      </tx-connection-factory>
  
      <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=outboundQueue">
         <attribute name="JNDIName">activemq/queue/outbound</attribute>
         <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-5.3.1.rar'</depends>
         <attribute name="Type">javax.jms.Queue</attribute>
         <attribute name="Properties">PhysicalName=queue.outbound</attribute>
      </mbean>
     
      <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=inboundQueue">
         <attribute name="JNDIName">activemq/queue/inbound</attribute>
         <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-5.3.1.rar'</depends>
         <attribute name="Type">javax.jms.Queue</attribute>
         <attribute name="Properties">PhysicalName=queue.inbound</attribute>
      </mbean>
  
      <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.topic:name=inboundTopic">
         <attribute name="JNDIName">activemq/topic/inbound</attribute>
         <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-5.3.1.rar'</depends>
         <attribute name="Type">javax.jms.Topic</attribute>
         <attribute name="Properties">PhysicalName=topic.inbound</attribute>
      </mbean>
     
      <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.topic:name=inboundTopic1">
         <attribute name="JNDIName">activemq/topic/inbound1</attribute>
         <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-5.3.1.rar'</depends>
         <attribute name="Type">javax.jms.Topic</attribute>
         <attribute name="Properties">PhysicalName=topic.inbound1</attribute>
      </mbean>
  
   </connection-factories>

7、将文件jboss-5.1.0.GA\server\default\deploy\activemq-ra-5.3.1.rar\xbean-spring-3.6.jar拷贝到

     jboss-5.1.0.GA\server\default\lib中

8、 使用Webservice,报异常,解决办法:

     jboss-5.1.0.GA\common\lib下

     

     jbossws-native-jaxrpc.jar

     jbossws-native-jaxws.jar

     jbossws-native-jaxws-ext.jar

     jbossws-native-saaj.jar

 

     拷贝到jboss-5.1.0.GA\lib\endorsed

9、jboss启动默认绑定的是127.0.0.1回环ip,无法从其他机器访问

     修改文件jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\server.xml

     修改结果

     <Connector protocol="HTTP/1.1" port="8090" address="本机ip地址"
               connectionTimeout="20000" redirectPort="8443" />

     或者启动时加上-b选项指定host或ip 例如:run.bat -b ip地址(推荐使用)

10、修改文件jboss-5.1.0.GA\server\default\deployers\jbossws.deployer\META-INF\jboss-beans.xml

     修改结果

     <property name="webServiceHost">IP地址</property>

    用处:编写webservice,自动生成wsdl时 soap:address location的地址如下:

   

- < service name =" EjbWebserviceBeanService ">
- < port binding =" tns:EjbWebserviceBeanBinding " name =" EjbWebserviceBeanPort ">
  < soap:address location = http://ip地址:8090/ejb_01/EjbWebserviceBean />
  </ port >
  </ service >
    默认的是localhost或者127.0.0.1 无法远程调用
11、远程用ip地址访问activeMQ  tcp://localhost:port 
    修改文件jboss-5.1.0.GA\server\default\deploy\activemq-ra-5.3.1.rar\broker-config.xml
    修改结果
    <transportConnectors>
      <transportConnector name="bruce.broker1" uri="tcp://0.0.0.0:61616"/>
    </transportConnectors>
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值