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 » General Discussion » MQRC_KEY_REPOSITORY_ERROR

Post new topic  Reply to topic
 MQRC_KEY_REPOSITORY_ERROR « View previous topic :: View next topic » 
Author Message
sagitwang
PostPosted: Wed May 20, 2009 7:28 am    Post subject: MQRC_KEY_REPOSITORY_ERROR Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

Hi

Am really new to IBM MQ and want to ask one question about the MQRC_KEY_REPOSITORY_ERROR problem which occured during testing.

I need to develop an applition in .NET to connect to a MQ server, and I have only installed MQ client at my side.

public class MQSender
{
MQQueueManager qManager;
MQQueue queue;

public MQSender(string HostName, string PortNumber, string ChannelProperty, string ManagerName, string QueueName)
{
try
{

Hashtable connectionProperties = new Hashtable();

// Add the connection type
connectionProperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, "NULL_SHA");
connectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
connectionProperties.Add(MQC.HOST_NAME_PROPERTY, HostName);
connectionProperties.Add(MQC.CHANNEL_PROPERTY, ChannelProperty);
connectionProperties.Add(MQC.PORT_PROPERTY, Int32.Parse(PortNumber));

qManager = new MQQueueManager(ManagerName, connectionProperties);

queue = qManager.AccessQueue(QueueName, MQC.MQOO_OUTPUT);
}
catch (MQException mqexp)
{
Console.WriteLine("MQSeries Exception: " + mqexp.Message);
throw new Exception();
}
catch (Exception e)
{
Console.WriteLine("General Exception: " + e.Message);
throw new Exception();
}
}

public bool Send(string Msg)
{
MQPutMessageOptions qPutMessageOptions = new MQPutMessageOptions();
qPutMessageOptions.Options = MQC.MQPMO_SET_ALL_CONTEXT;
MQMessage qMessage = new MQMessage();
qMessage.WriteBytes(Msg);
qMessage.Format = MQC.MQFMT_STRING;

try
{
queue.Put(qMessage, qPutMessageOptions);
return true;
}
catch (Exception)
{
Console.WriteLine("Sending failure....");
return false;
}
}
}

Above is my example code, as I was informed that the SSL encryption with "NULL_SHA" is required, to be honst, have got no idea if the code am using is correct or not. And when I tried to AccessQueue, a MQRC_KEY_REPOSITORY_ERROR exception is caught. BTW, I have read the document about this exception. Said as following stuff

On Windows®:
set MQSSLKEYR=C:\Program Files\IBM\WebSphere MQ\ssl\keyThe key database file has the fully-qualified filename:
C:\Program Files\IBM\WebSphere MQ\ssl\key.kdb

Can not see a ssl folder at the WebSphere MQ directory.

Could someone ask my question please?

Thanks in advanced

Sagit
Back to top
View user's profile Send private message
sagitwang
PostPosted: Wed May 20, 2009 7:38 am    Post subject: Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

Anyone could answer my question? T_T
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Wed May 20, 2009 8:07 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

sagitwang wrote:
Anyone could answer my question? T_T


This request for was 10 minutes after your initial post..... how quick a response was you hoping for?

I bet funded support wouldnt be that fast!
Back to top
View user's profile Send private message
sumit
PostPosted: Wed May 20, 2009 8:34 am    Post subject: Re: MQRC_KEY_REPOSITORY_ERROR Reply with quote

Partisan

Joined: 19 Jan 2006
Posts: 398

sagitwang wrote:
And when I tried to AccessQueue, a MQRC_KEY_REPOSITORY_ERROR exception is caught. BTW, I have read the document about this exception. Said as following stuff

On Windows®:
set MQSSLKEYR=C:\Program Files\IBM\WebSphere MQ\ssl\keyThe key database file has the fully-qualified filename:
C:\Program Files\IBM\WebSphere MQ\ssl\key.kdb

Can not see a ssl folder at the WebSphere MQ directory.


What about using the path like:
C:\Program Files\IBM\WebSphere MQ\Qmgrs\your_queuemanager_name\ssl and check if you have key.kdb file there.
_________________
Regards
Sumit
Back to top
View user's profile Send private message Yahoo Messenger
sagitwang
PostPosted: Thu May 21, 2009 12:29 am    Post subject: Re: MQRC_KEY_REPOSITORY_ERROR Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

sumit wrote:
sagitwang wrote:
And when I tried to AccessQueue, a MQRC_KEY_REPOSITORY_ERROR exception is caught. BTW, I have read the document about this exception. Said as following stuff

On Windows®:
set MQSSLKEYR=C:\Program Files\IBM\WebSphere MQ\ssl\keyThe key database file has the fully-qualified filename:
C:\Program Files\IBM\WebSphere MQ\ssl\key.kdb

Can not see a ssl folder at the WebSphere MQ directory.


What about using the path like:
C:\Program Files\IBM\WebSphere MQ\Qmgrs\your_queuemanager_name\ssl and check if you have key.kdb file there.


No..... the Qmgrs folder is empty
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 21, 2009 4:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Of course the Qmgrs folder is empty. If sumit had read where you said that you had only the MQ Client installed, sumit likely wouldn't have asked the question.

You need to create the key repository. There is not one created for you when you install anything, either MQServer or MQClient. The ssl folder is mostly only a suggestion about where to keep it. You can actually keep the key repository anywhere you want, as long as you know the location and know that the location is properly secure.

Full step-by-step instructions are available at your friendly neighborhood Info Center.
Back to top
View user's profile Send private message
sumit
PostPosted: Thu May 21, 2009 6:40 am    Post subject: Reply with quote

Partisan

Joined: 19 Jan 2006
Posts: 398

mqjeff wrote:
Of course the Qmgrs folder is empty. If sumit had read where you said that you had only the MQ Client installed, sumit likely wouldn't have asked the question.


oops, I missed that bit. Thnx mqjeff for pointing it out.
_________________
Regards
Sumit
Back to top
View user's profile Send private message Yahoo Messenger
sagitwang
PostPosted: Thu May 21, 2009 8:05 am    Post subject: Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

I have created a key.kdb and set the MQSSLKEYR environment variable.
Now it is showing me a MQRC_Q_MGR_NOT_AVAILABLE, which indicates that the AMQCLCHL.TAB file is not available.

I do not have this file for sure, but got a little bit confused.

Following is from http://www.ibm.com/developerworks/websphere/library/techarticles/0704_xu/0704_xu.html

The client channel definition table (CCDT) contains details of all client-connection channels defined in an IBM® WebSphere® MQ session. The table is a binary file named AMQCLCHL.TAB, and it is automatically generated when a client connection channel is created in WebSphere MQ. Each client connection requires the details of the server host name, server channel name, and listening port on the server.

As I have put all these values: host name, channel name ....etc in the .NET code, why do I still need this file? As the MQ server which I need to connect is created by another authority.

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 21, 2009 8:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

sagitwang wrote:
Now it is showing me a MQRC_Q_MGR_NOT_AVAILABLE, which indicates that the AMQCLCHL.TAB file is not available.

No, that's not what it indicates.

You can get MQRC_Q_MGR_NOT_AVALIABLE even if the AMQCLCHL.TAB exists and is available and correct.

MQRC 2059 can mean a lot of things. Try confirming that you have the correct channel name, hostname, and port.

And then try telnetting to that hostname/port from your machine.

And then make sure that you've set the right NMQ_ options to specify that you're using a client connection, rather than a server connection.
Back to top
View user's profile Send private message
sagitwang
PostPosted: Fri May 22, 2009 12:48 am    Post subject: Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

mqjeff wrote:
sagitwang wrote:
Now it is showing me a MQRC_Q_MGR_NOT_AVAILABLE, which indicates that the AMQCLCHL.TAB file is not available.

No, that's not what it indicates.

You can get MQRC_Q_MGR_NOT_AVALIABLE even if the AMQCLCHL.TAB exists and is available and correct.

MQRC 2059 can mean a lot of things. Try confirming that you have the correct channel name, hostname, and port.

And then try telnetting to that hostname/port from your machine.

And then make sure that you've set the right NMQ_ options to specify that you're using a client connection, rather than a server connection.


Thanks a lot mqjeff. Will try what you have said and have a look
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » MQRC_KEY_REPOSITORY_ERROR
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.