ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JNDI can not be created for MQQueueConnectionFactory ?

Post new topic  Reply to topic
 JNDI can not be created for MQQueueConnectionFactory ? « View previous topic :: View next topic » 
Author Message
adi_sesha
PostPosted: Wed May 28, 2008 5:03 am    Post subject: JNDI can not be created for MQQueueConnectionFactory ? Reply with quote

Newbie

Joined: 28 May 2008
Posts: 2

Hi,

If i use INITIAL_CONTEXT_FACTORY=com.ibm.mq.jms.MQQueueConnectionFactory
PROVIDER_URL=tcp://localhost:1414/SYSTEM.DEF.SVRCONN in JMSAdmin.config (&run JMSADMIN -v xxxx)

I am getting following error.

Error: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm
.mq.jms.MQQueueConnectionFactory [Root exception is java.lang.ClassCastException: com.ibm.mq.jms.MQQueueConnectionFactory]

If i use INITIAL_CONTEXT_FACTORY=com.ibm.mq.jms.context.WMQInitialContextFactory
PROVIDER_URL=tcp://localhost:1414/SYSTEM.DEF.SVRCONN

Then it works. Let me know if we can create JNDI for MQQueueConnection Factory in MQ series or not.

Thanks in advance
Adi
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed May 28, 2008 7:48 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

I always use
com.sun.jndi.fscontext.RefFSContextFactory
as initial context factory for JNDI creation...

wandering if we can use any connection factory in place on initial context or not....
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
manicminer
PostPosted: Thu May 29, 2008 2:20 am    Post subject: Reply with quote

Disciple

Joined: 11 Jul 2007
Posts: 177

If I understand you correctly... and I might not

You are saying that if you set your initial context factory to something which isn't an inital context factory then you get a class cast exception? I am not sure why you are surprised what are you expecting to work here?

JMSAdmin uses an initial context factory to connect to before then allowing you to create appropriate connection factories and destinations. This is fundamental JMS / JNDI setup. I would suggest you read up more on JMS messaging / code patterns.

If I have miss-understood what you are trying to achieve, please clarify.
Back to top
View user's profile Send private message
adi_sesha
PostPosted: Thu May 29, 2008 5:01 am    Post subject: Reply with quote

Newbie

Joined: 28 May 2008
Posts: 2

Ok, to be more clear. I am using MQQueueConnectionFactory in axis2.xml like

<parameter name="java.naming.factory.initial">com.ibm.mq.jms.MQQueueConnectionFactory</parameter>

Where JNDIName will refer to QueueConnectionFactory created in MQ. I created QCF using .... +
INITIAL_CONTEXT_FACTORY=com.ibm.mq.jms.context.WMQInitialContextFactory

I am facing few prblems in accessing this Queue using this QCF. So i thought we need to create connection factory related to MQQueueConnec... so declared some thing like this in JMSAdmin.
INITIAL_CONTEXT_FACTORY=com.ibm.mq.jms.MQQueueConnectionFactory

It seems we do not have any factory support like this. Correct me if i am wrong?
Secondly, if not exists can i use QCF created on WMQInitialContextFactory in axis2.xml where i am referring to xxxxxMQQueueConnectionFactory?

Ofcourse i can use "<parameter name="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextFactory</parameter>" in axis2.xml, where i have some other issues & no sol yet (http://www.nabble.com/Axis2-with-JMS-Transport-td17485892.html) , so digging for options
Back to top
View user's profile Send private message
manicminer
PostPosted: Thu May 29, 2008 5:43 am    Post subject: Reply with quote

Disciple

Joined: 11 Jul 2007
Posts: 177

erm,

I don't know anything about axis...

But as I said before, you need to lookup and understand how the JNDI / Administered object messaging patterns work for JMS.

You cannot use MQQueueConnectionFactory in the xml as you suggest because it is not an initial context factory, it cannot be used as an initial context factory, it just doesn't implement the correct interface.

MQQueueConnectionFactory is used as a connection factory in JMS to create a connection to MQ, and can be stored inside some form of JNDI.

WMQInitialContextFactory provides a lookup mechanism based on an MQ back end to allow you to look up objects (such as MQQueueConnectionFactory objects).
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu May 29, 2008 1:21 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

manicminer wrote:
erm,

I don't know anything about axis...

But as I said before, you need to lookup and understand how the JNDI / Administered object messaging patterns work for JMS.

You cannot use MQQueueConnectionFactory in the xml as you suggest because it is not an initial context factory, it cannot be used as an initial context factory, it just doesn't implement the correct interface.

MQQueueConnectionFactory is used as a connection factory in JMS to create a connection to MQ, and can be stored inside some form of JNDI.

WMQInitialContextFactory provides a lookup mechanism based on an MQ back end to allow you to look up objects (such as MQQueueConnectionFactory objects).

WMQInitialContextFactory requires a fix pack and is not a good fit as it is not static...

The file context comes with the product and is a better fit.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gudiya
PostPosted: Wed Jul 24, 2013 12:59 pm    Post subject: jmeter.protocol.jms.sampler.JMSSampler: com.sun.jndi.fscont Reply with quote

Newbie

Joined: 24 Jul 2013
Posts: 1

I am using the initial context factory as "com.sun.jndi.fscontext.RefFSContextFactory" but still I am getting the
jmeter.protocol.jms.sampler.JMSSampler: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory ].

I am working on Jmeter. I need to do some performance testing and I am using Hermes JMS as the MQ. So I am trying to set up the response and request queue and send the message.
I am using the Queue Connection Factory as "com.ibm.mq.jms.MQQueueConnectionFactory"
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 24, 2013 9:31 pm    Post subject: Re: jmeter.protocol.jms.sampler.JMSSampler: com.sun.jndi.fsc Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

gudiya wrote:
[Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory ].

Something is wrong with your classpath. The relevant jar might be missing from your classpath. If using a 3rd party product like Hermes or such, make sure all the relevant jars have been defined to the product / classpath.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JNDI can not be created for MQQueueConnectionFactory ?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.