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?

有帮助吗?

解决方案 2

I resolve the problem. In Weblogic, I must create subdeployment of my JMS module (Oracle said it is not mandatory, but in my case it seems it is) and then everything works fine.

其他提示

From the WebLogic console, Environment -> Servers -> View JNDI Tree.

enter image description here

From there, find the queue, take note of the nested path where it's located, then use that path in the lookup.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top