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 Security » Reason '2406'. MQRC_CLIENT_EXIT_LOAD_ERROR

Post new topic  Reply to topic
 Reason '2406'. MQRC_CLIENT_EXIT_LOAD_ERROR « View previous topic :: View next topic » 
Author Message
fjb_saper
PostPosted: Mon Oct 03, 2016 1:39 pm    Post subject: Reason '2406'. MQRC_CLIENT_EXIT_LOAD_ERROR Reply with quote

Grand High Poobah

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

Trying to run an application in Java Base and use the mqccred user exit...

So I am setting the properties and in particular
CMC.CHANNEL_SECURITY_EXIT_PROPERTY to "mqccred(ChlExit)"

I am specifying the -Djava.library.path to the path where the mqccred.dll is.
I am loading the dll using system.loadLibrary("mqccred.dll")

When trying to connect I am getting RC 2406 CLIENT_EXIT_LOAD_ERROR.

What am I missing there?

This used to work fine with JMS.... what is the problem with Java base?

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Mon Oct 03, 2016 2:18 pm    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

If you run an MQ Java trace, are there more details/clues on why the 2406 is being thrown?
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
hughson
PostPosted: Mon Oct 03, 2016 11:47 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

That sounds like the Java classes are expected it to be a Java exit. Does it work if you set it up using a CCDT instead?

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Tue Oct 04, 2016 5:44 am    Post subject: Reply with quote

Grand High Poobah

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

hughson wrote:
That sounds like the Java classes are expected it to be a Java exit. Does it work if you set it up using a CCDT instead?

Cheers
Morag

CCDT did not do much... until I removed the java.library.path, removed the load library, removed all props including TRANSPORT_PROPERTY.

The only property left was the WMQ_CCDTURL one an then it worked magically....
Note: the eclipse IDE was started from the MQ8 environment...

Painfull little buggers...

Switched to a multi-instance and now I am getting 2543 STANDBY_QMGR regardless of whether local or remote, it seems to only look for the local qmgr ...
Client at MQ8.0.0.5

OK so looks like setting the property CCDTURL does very little to nothing in java base.
The only way to set that in java base is to use MQEnvironment...



_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Tue Oct 04, 2016 11:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3251
Location: London, ON Canada

fjb_saper wrote:
The only way to set that in java base is to use MQEnvironment...

Don't use MQEnvironment class - it is not thread safe. Please use a Hashtable and pass it to the MQQueueManager class.

Code:
Hashtable<String, Object> mqht = new Hashtable<String, Object>();

mqht.put(CMQC.CHANNEL_PROPERTY, "TEST.CHL");
mqht.put(CMQC.HOST_NAME_PROPERTY, "10.10.10.10");

try
{
   mqht.put(CMQC.PORT_PROPERTY, new Integer(1444));
}
catch (NumberFormatException e)
{
   mqht.put(CMQC.PORT_PROPERTY, new Integer(1414));
}

mqht.put(CMQC.USER_ID_PROPERTY, "myUserId");
mqht.put(CMQC.PASSWORD_PROPERTY, "myPwd");

MQQueueManager qMgr = new MQQueueManager("TESTQMGR", mqht);


or using CCDT file:

Code:
String trustedStore = System.getenv("MQSSLKEYR");
if (trustedStore != null)
   System.setProperty("javax.net.ssl.trustStore", trustedStore + ".jks");

File file = new File("CCDTFile");
URL url = file.toURL();

Hashtable<String,Object> mqht = new Hashtable<String,Object>();

mqht.put(CMQC.USER_ID_PROPERTY, "myUserId");
mqht.put(CMQC.PASSWORD_PROPERTY, "myPwd");

MQQueueManager qMgr = new MQQueueManager("TESTQMGR", mqht, url);


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
hughson
PostPosted: Tue Oct 04, 2016 2:21 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

fjb_saper wrote:
OK so looks like setting the property CCDTURL does very little to nothing in java base.

I could believe that CCDTURL is C client only because Java could already take a URL for a file, where C couldn't. Or in other words, even pre-V8 you could use an ftp: or http: address for the CCDT in Java when you couldn't do that with the C client until recently.

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Tue Oct 04, 2016 6:12 pm    Post subject: Reply with quote

Grand High Poobah

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

So I missed the overloaded constructor where you pass the url.
I tried setting that in the hashtable and that had no effect at all.

In brief I found out the reason for the 2406. You need to both mention the path for the exit and the lib path for mq on the java library path. If the java program can't get at the exit stubs (present in the <mqinsstall>/java/lib / <mqinstall>/java/lib64.

But why oh why can't the ccdturl be passed in the hashtable, like you'd do in JMS??? Inconsistencies in design?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
hughson
PostPosted: Tue Oct 04, 2016 11:14 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

fjb_saper wrote:
You need to both mention the path for the exit and the lib path for mq on the java library path. If the java program can't get at the exit stubs (present in the <mqinsstall>/java/lib / <mqinstall>/java/lib64.

I'm surprised mqccred works doing that, it's not a java exit, it's a C exit. It's not in Java/lib?

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Fri Oct 07, 2016 8:06 pm    Post subject: Reply with quote

Grand High Poobah

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

hughson wrote:
fjb_saper wrote:
You need to both mention the path for the exit and the lib path for mq on the java library path. If the java program can't get at the exit stubs (present in the <mqinsstall>/java/lib / <mqinstall>/java/lib64.

I'm surprised mqccred works doing that, it's not a java exit, it's a C exit. It's not in Java/lib?

Cheers
Morag

Since 7.5 (I believe) you're supposed to be able to load any exits (i.e. java or C) when running a java program... Just be sure you load the library (and the stubs) when using a C exit...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
hughson
PostPosted: Fri Oct 07, 2016 11:32 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

fjb_saper wrote:
hughson wrote:
fjb_saper wrote:
You need to both mention the path for the exit and the lib path for mq on the java library path. If the java program can't get at the exit stubs (present in the <mqinsstall>/java/lib / <mqinstall>/java/lib64.

I'm surprised mqccred works doing that, it's not a java exit, it's a C exit. It's not in Java/lib?

Cheers
Morag

Since 7.5 (I believe) you're supposed to be able to load any exits (i.e. java or C) when running a java program... Just be sure you load the library (and the stubs) when using a C exit...

Certainly it is true that you can call a C exit from a Java client, I was just questioning the exit path in use.
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Sat Oct 08, 2016 6:07 am    Post subject: Reply with quote

Grand High Poobah

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

Sorry.
No the exit is in <MQDATA>/exits[64]/<MQversion>
The stubs are in <MQinstall>/java/lib[64]


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Wed Oct 12, 2016 9:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3251
Location: London, ON Canada

fjb_saper wrote:
No the exit is in <MQDATA>/exits[64]/<MQversion>
The stubs are in <MQinstall>/java/lib[64]

Why did you need to create a stub?

I have Java/MQ applications that directly invokes a native DLL or shared library without the use of a stub. I prefer to put everything in a CCDT then use it when instantiating the MQQueueManager class.

Your method seems way more complicated.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed Oct 12, 2016 10:55 am    Post subject: Reply with quote

Grand High Poobah

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

RogerLacroix wrote:
fjb_saper wrote:
No the exit is in <MQDATA>/exits[64]/<MQversion>
The stubs are in <MQinstall>/java/lib[64]

Why did you need to create a stub?

I have Java/MQ applications that directly invokes a native DLL or shared library without the use of a stub. I prefer to put everything in a CCDT then use it when instantiating the MQQueueManager class.

Your method seems way more complicated.

Regards,
Roger Lacroix
Capitalware Inc.

No the stubs come with the product and are what allows you to use a native / C dll in the exit when running java. It's just that the mqccred.dll and the stubs are in different directories and you have to have both in the java.library.path...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Wed Oct 12, 2016 2:49 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3251
Location: London, ON Canada

fjb_saper wrote:
No the stubs come with the product

Ahh. Got you.

fjb_saper wrote:
It's just that the mqccred.dll and the stubs are in different directories and you have to have both in the java.library.path...

Now I understand - we have different styles of setting and using native exits.

(1) On Windows or Unix/Linux, I have run setmqinst which will set the path correctly so that when I run a Java application, the JVM will put the 'path' as the 'java.library.path'. So, I don't get bit by 'java.library.path' not having <MQinstall>/java/lib[64] in the 'java.library.path'.

(2) I explicitly set the path and exit name in field for either CCDT or directly in the code:

Code:
DEFINE CHANNEL('TEST.CHL') CHLTYPE(CLNTCONN) +
   TRPTYPE(TCP) +
   SCYEXIT('/opt/mqm/samp/mqccred/lib64/mqccred(ChlExit)') +
   REPLACE

or
Code:
mqht.put(CMQC.CHANNEL_SECURITY_EXIT_PROPERTY, "/opt/mqm/samp/mqccred/lib64/mqccred(ChlExit)");


So, I can see your issue of needing to add "<MQDATA>/exits[64]/<MQversion>" to 'java.library.path'.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed Oct 12, 2016 5:42 pm    Post subject: Reply with quote

Grand High Poobah

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

I see what you mean.
My SCYEXIT just holds ('mqccred(ChlExit)') and as such I have to load the exit in java prior to running the program. System.loadLibrary("mqccred") requires the library to be on the java.library.path...
_________________
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 Security » Reason '2406'. MQRC_CLIENT_EXIT_LOAD_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.