0

I want to create Queue and the MessageDrivenBean in Oracle 11g.
I created the JMS Module on Weblogic and into it I created Queue and ConnectionFactory. JDBC names looks like:
Queue: jms/EvZahQueue
ConnectionFactory: jms/ConnectionFactory

I tried to get them with:

Context context = new InitialContext();
connectionFactory = (QueueConnectionFactory) context.lookup("jms/QueueConnector");
queue = (Queue) context.lookup("jms/EvZahQueue");

But, I've got an exception like this:

javax.naming.NameNotFoundException: While trying to look up comp/env/jms/QueueConnector in /app/webapp/registri-view/31900933.; remaining name 'comp/env/jms/QueueConnector'

Also, I tried with:

Context context = new InitialContext();
connectionFactory = (QueueConnectionFactory) context.lookup("java:comp/env/jms/QueueConnector");
queue = (Queue) context.lookup("java:comp/env/jms/EvZahQueue");

And I tried to create default properties and to put them into new InitialContext() but nothing changed.

What should I do? Maybe I need to write something in web.xml, ejb-jar.xml, weblogic-ejb-jar.xml?

4

2 回答 2

0

从 WebLogic 控制台,Environment -> Servers -> View JNDI Tree

在此处输入图像描述

从那里找到队列,记下它所在的嵌套路径,然后在查找中使用该路径。

在此处输入图像描述

于 2013-10-25T16:28:48.897 回答
0

我解决问题。在 Weblogic 中,我必须创建 JMS 模块的子部署(Oracle 说这不是强制性的,但在我的情况下似乎是),然后一切正常。

于 2013-10-28T09:26:36.057 回答