Author |
Message
|
fjb_saper |
Posted: Mon Oct 03, 2016 1:39 pm Post subject: Reason '2406'. MQRC_CLIENT_EXIT_LOAD_ERROR |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
tczielke |
Posted: Mon Oct 03, 2016 2:18 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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 |
|
 |
hughson |
Posted: Mon Oct 03, 2016 11:47 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
fjb_saper |
Posted: Tue Oct 04, 2016 5:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
RogerLacroix |
Posted: Tue Oct 04, 2016 11:21 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 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 |
|
 |
hughson |
Posted: Tue Oct 04, 2016 2:21 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
fjb_saper |
Posted: Tue Oct 04, 2016 6:12 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
hughson |
Posted: Tue Oct 04, 2016 11:14 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
fjb_saper |
Posted: Fri Oct 07, 2016 8:06 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
hughson |
Posted: Fri Oct 07, 2016 11:32 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
fjb_saper |
Posted: Sat Oct 08, 2016 6:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
RogerLacroix |
Posted: Wed Oct 12, 2016 9:58 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 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 |
|
 |
fjb_saper |
Posted: Wed Oct 12, 2016 10:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
RogerLacroix |
Posted: Wed Oct 12, 2016 2:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 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 |
|
 |
fjb_saper |
Posted: Wed Oct 12, 2016 5:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
|