在WebLogic 10.3.5中查找JMS队列时,JNDI查找失败 [英] JNDI lookup failing when looking up JMS queue in WebLogic 10.3.5

查看:160
本文介绍了在WebLogic 10.3.5中查找JMS队列时,JNDI查找失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JMS编程的新手,并且遇到了NameNotFoundException,即使在查看管理控制台时,它显示的是失败的JNDI名称。

I'm new to JMS programming and am running into NameNotFoundException, even though, in looking at the Admin Console, it shows the JNDI name that is failing.

产生的异常是:

javax.naming.NameNotFoundException:无法解析'tutorialqueue'。解决 '';其余名称'tutorialqueue'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal。 WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)

在管理控制台中,我看到:

In the Admin Console, I see:

名称 - TutorialJmsConnectionFactory

类型 - 连接工厂

JNDI名称 - tutorialconnectionfactory

子部署 - 默认目标

目标 - 管理员


Name - TutorialJmsConnectionFactory
Type - Connection Factory
JNDI Name - tutorialconnectionfactory
Subdeployment - Default Targetting
Targets - AdminServer

名称 - TutorialJmsQueue

类型 - 队列

JNDI名称 - 辅导队

子部署 -

目标 -

Name - TutorialJmsQueue
Type - Queue
JNDI Name - tutorialqueue
Subdeployment -
Targets -

控制台显示 tutorialqueue JNDI名称,该异常表示无法找到该名称。此外,已成功找到tutorialconnectionfactory名称WAS。可能是因为Subdeployment和/或Targets是空白的吗?

The console shows the tutorialqueue JNDI name that the exception says it can't find. Also, the tutorialconnectionfactory name WAS successfully found. Might it have to do with the Subdeployment and/or Targets being blank?

这是查找发生/失败的代码:

Here is the code where the lookup occurs/fails:

QueueConnectionFactory queueFactory = ( QueueConnectionFactory ) ic.lookup( "tutorialconnectionfactory" );
QueueConnection queueConnection = queueFactory.createQueueConnection();
QueueSession queueSession = queueConnection.createQueueSession( false , Session.AUTO_ACKNOWLEDGE );
Queue queue = ( Queue ) ic.lookup( "tutorialqueue" );
QueueSender sender = queueSession.createSender( queue );

有人能指出我正确的方向吗? TIA

Can anyone point me in the right direction? TIA

推荐答案

在weblogic中,您应该将队列设置为使用与连接工厂相同的子部署和目标,两者都是需要在JVM中找到。更新队列的目标和子部署以匹配连接工厂,它应该开始工作。

In weblogic, you should setup your queue to use the same subdeployment and target(s) as the connection factory, both need to be found in a JVM. Update your queue's target and subdeployment to match the connection factory and it should start working.

这篇关于在WebLogic 10.3.5中查找JMS队列时,JNDI查找失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆