我有一个适用于Websphere MQ 7.5的资源适配器
<resource-adapter id="wmq.jmsra.rar">
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/ctm/ConnectionFactory" use-java-context="true" pool-name="ConnectionFactory">
<config-property name="hostName">
devel.comp.net
</config-property>
<config-property name="username">
mqm
</config-property>
<config-property name="channel">
COMP.DIR.SVRCONN
</config-property>
<config-property name="password">
mqm
</config-property>
<config-property name="transportType">
CLIENT
</config-property>
<config-property name="queueManager">
devel.queue.manager
</config-property>
<config-property name="port">
1414
</config-property>
<security>
<application/>
</security>
</connection-definition>
</connection-definitions>
如果我将端口号更改为2414,则它会获取这些属性,但如果我不更改端口号,则默认为1414 localhost和queumanager name'',就好像采用默认值一样。任何人都可以告诉我这有什么问题。
一旦我将端口号从2414恢复到1414,它就开始进行嘲弄,当我将其更改回2414时,它会正确获取主机名和队列管理器名称。
感谢
答案 0 :(得分:0)
我无法弄清楚端口更改如何以及为什么要加载属性。相反,我使用了standlaone-full.xml中的系统特性
<system-properties>
<property name="websphere.hostName" value="devel.comps.net"/>
<property name="websphere.port" value="1414"/>
<property name="websphere.channel" value="BLOBBER.DIR.SVRCONN"/>
<property name="websphere.transportType" value="CLIENT"/>
<property name="websphere.queueManager" value="devel.queue.manager"/>
并启用它
<subsystem xmlns="urn:jboss:domain:ee:3.0">
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
</subsystem>
然后使用ejb-jar.xml来识别我需要使用的属性
<message-driven>
<ejb-name>MyAppInboundBean</ejb-name>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>
destinationType
</activation-config-property-name>
<activation-config-property-value>
javax.jms.Queue
</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>
destination
</activation-config-property-name>
<activation-config-property-value>
java:/myapp/FromCTM
</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>
hostName
</activation-config-property-name>
<activation-config-property-value>${websphere.hostName}</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>
queueManager
</activation-config-property-name>
<activation-config-property-value>${websphere.queueManager}</activation-config-property-value>
</activation-config-property>