Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ConnectionFactory lookup returns null

 
Juliana Leroy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm having a problem doing a lookup in a QueueConnectionFactory from a remote client application.
The jndi name is found but the lookup method always returns null.
I'm using JBoss 4.2.2GA, integrating with WebsphereMQ 6.0.

Here's the part of my code:



The message "null" is always displayed.

Thanks for the attention,
Juliana.
 
Amir Pourteymour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be because you have not created any connection inside the ConnectionFactory.
 
Juliana Leroy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how can I do that?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juliana,

Welcome to JavaRanch

How did you setup WebSphereMQ with JBoss? You might find this useful.

Looks like you are doing a lookup of the connection factory from a standalone client (i.e. a remote client). Based on what i have seen in one of the discussion in the forums, the reason why you might be getting a NULL connection factory maybe because the connection factory is meant to be used only in a managed environment and not through remote standalone client. Try looking up this connection factory from a servlet and see if you get the connection factory.
 
Juliana Leroy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jaikiran,

Thanks for the reply.
I setup MQ with JBoss following the part IV of the article and an article from IBM (http://www.ibm.com/developerworks/websphere/library/techarticles/0710_ritchie/0710_ritchie.html).
Yes, I'm doing a lookup of the connection factory from a standalone client and I need to do this in this way.
When I run the sample application that comes with the IBM connector, which has a servlet and an MDB, it worked fine.
Is there another way of doing that?

Juliana.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic