我正在致力于将ear应用程序迁移到liberty。它是一个使用JMS和MQ消息传递提供程序的web应用程序。
例如,在我的stage.config.xml中,我们有以下属性:
MQQueue(0).CCSID
MQQueue(0).baseQueueName
MQQueue(0).jndiName
MQQueue(0).name
MQQueueConnectionFactory(0).CCSID
MQQueueConnectionFactory(0).channel
MQQueueConnectionFactory(0).connectionPool.ConnectionPool(0).maxConnections
MQQueueConnectionFactory(0).description
MQQueueConnectionFactory(0).host
MQQueueConnectionFactory(0).jndiName
MQQueueConnectionFactory(0).name
MQQueueConnectionFactory(0).port
MQQueueConnectionFactory(0).provider
MQQueueConnectionFactory(0).queueManager
MQQueueConnectionFactory(0).sessionPool.ConnectionPool(0).maxConnections
MQQueueConnectionFactory(0).transportType<featureManager>
<feature>jsp-2.3</feature>
<feature>localConnector-1.0</feature>
<feature>jndi-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>samlWeb-2.0</feature>
<feature>wasJmsClient-2.0</feature>
<feature>wasJmsClient-1.1</feature>
<feature>wmqJmsClient-1.1</feature>
<feature>jndi-1.0</feature>
<feature>jmsMdb-3.1</feature>
</featureManager>
<featureManager>
<exclude>jsf-2.2</exclude>
</featureManager>
<variable name="wmqJmsClient.rar.location"
value="${server.config.dir}/wmq/wmq.jmsra.rar"/>
<jmsQueue id="1533A.TRANSPORT.ASSIGNMENT.RESP" jndiName="jms/xyz/queue/transportAssignment/response"></jmsQueue>
<jmsQueue id="1533A.TRANSPORT.ASSIGNMENT.RQST" jndiName="jms/xyz/queue/transportAssignment/request"></jmsQueue>
<jmsQueueConnectionFactory jndiName="jms/xyz" id="xyz_qa_QCF">
<connectionManager maxPoolSize="10"/>
<properties.wmqJms providerVersion="unspecified" transportType="CLIENT" applicationName="xyz" channel="CLIENTS.xyz" hostName="host123.GOT.hst.NET" queueManager="xyz141Q" CCSID="1208"/>
</jmsQueueConnectionFactory>异常: NameNotFoundException:中间上下文不存在: jms/xyz
有没有人可以指导我在work.Kindly帮助中使用Server.xml的所有参数/配置。
发布于 2020-08-11 15:58:42
您的server.xml有几个问题
jndi-1.0 featurewasJmsClient和wmqJmsClient -如果你只使用mq而不是移除wasJmsClient的QCF版本-如果你需要连接到功能中的内部队列,只使用一个-你在哪里找到这样的结构,我不相信它是你使用<wasJmsClient>d18mq>一次作为wasJmsClient名称,一次作为上下文名称。这是不正确的。将您的QCF名称更改为其他名称,例如jms\xyz\qcf基于评论进行更新
检查您是如何使用JMS类的。
下面是我用来连接到MQ的配置和代码:
server.xml片段:
<feature>jms-2.0</feature>发送消息的Java代码:
@ApplicationScoped
public class JMSHelper {
private static Logger logger = Logger.getLogger(JMSHelper.class.getName());
@Inject
@JMSConnectionFactory("jms/myapp/NotificationQueueConnectionFactory")
private JMSContext jmsContext;
@Resource(lookup = "jms/myapp/NotificationQueue")
private Queue queue;
@Transactional
void invokeJMS(Object json) throws JMSException, NamingException {
String contents = json.toString();
logger.info("Sending "+contents+" to "+queue.getQueueName());
jmsContext.createProducer().send(queue, contents);
logger.info("JMS Message sent successfully!");
}
}发布于 2020-08-10 15:10:14
我假设您将使用资源适配器,因此请从阅读IBM文档中的Liberty and the IBM MQ resource adapter开始。
当你开始配置像IBM文档这样的东西,它仍然不起作用,请张贴自由配置和你得到的全部异常,这样我们就可以再次帮助你。
https://stackoverflow.com/questions/63334072
复制相似问题