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 » MQJE001: Completion Code '2', Reason '2495' Error

Post new topic  Reply to topic Goto page 1, 2  Next
 MQJE001: Completion Code '2', Reason '2495' Error « View previous topic :: View next topic » 
Author Message
di.wang
PostPosted: Wed Dec 07, 2011 2:47 pm    Post subject: MQJE001: Completion Code '2', Reason '2495' Error Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

Dear experts,

Very appreciate of any help!

We are having an issue with BINDDING mode connection with the following error while trying to connect to a remote MQ on a remote server box.

MQJE001: Completion Code '2', Reason '2495'

Let me give a little bit of the background of our system. Our project is a Windows based Java standalone application, which initially used V5.x MQ library to talk to a MQ manager via CLIENT mode. We recently upgraded the related java code and libs to make it V7 compatable, and try to make it flexible to be able to connect in both client mode and binding mode. Again, the MQ queue manager is on a remote server box.

After the code upgrade, the client connection mode still works, however the binding mode throw the exception as above mentioned.

The way we programmed is, if we read the cfg set up as below:

<queueManager>
<property name="name">VEPTVW02</property>
<property name="hostname">cr2rdngap17.abcompany.com</property >
<property name="port">1414</property>
<property name="channel">VEPTVW02.VEP.SVC</property>
<property name="username"></property>
<property name="password"></property>

The code assign cr2rdngap17.abcompany.com into MQEnvironment.hostname and then assign port/channel etc, and then

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);

and the program seems running as client mode and working good.

If we read cfg as below:

<queueManager>
<property name="name">VEPTVW02</property>
<property name="hostname"></property >
<property name="port">1414</property>
<property name="channel">VEPTVW02.VEP.SVC</property>
<property name="username"></property>
<property name="password"></property>

The code will NOT assign anything to MQEnvironment.hostname but still assign other values such as port/channel etc, and then same

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);

(we believe program should run as binding mode since hostname is not assigned) and then program throw the error as above.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Dec 07, 2011 3:14 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2498
Location: Melbourne, Australia

Did you look at the limitations of BINDING mode? This mode can only be used to connect to a MQ Queue Manager on the same box as the app.
_________________
Glenn
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Dec 08, 2011 3:30 pm    Post subject: Reply with quote

Jedi Knight

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

Hi,
MQ_Manual wrote:
2495 (X'09BF') MQRC_MODULE_NOT_FOUND

Explanation:
This problem could be caused by either of the two following reasons:
- A MQCB call was made with an Operation of MQOP_REGISTER specifying a CallbackName which could not be found. Ensure that the CallbackName value is specified correctly.
- The Java MQ code could not load a Java native shared library. Check the associated Exception stack and FFST. Ensure that the JNI shared library is specified correctly.

Completion Code:
MQCC_FAILED

Programmer Response:
A native shared library could not be loaded.


Check your PATH environment variable, make sure the {MQ_install}\java\lib\ directory is in your PATH environment variable because MQ is trying to load the mqjbnd.dll (on Windows) DLL.

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
di.wang
PostPosted: Fri Dec 09, 2011 8:06 am    Post subject: Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

Hi gbaddeley and RogerLacroix,

First, thank both of your response, i really appreciate it.

We have done further research and I kind of agree with gbabddeley that due to MQ queuemanager is on remote server which is different with the app, binding mode won't work no matter how the environment variable setup (actually we already tried this environment set up before asking on this forum). At this point, we would instruct our customer to move the app and queuemanager to be on the same server for binding mode, or otherwise stay on the client mode.

FogerLacroix, what do you think? Appreciate your help again.

BTW, i looked at folder under C:\Program Files\IBM\WebSphere MQ\java\lib where only the client software been installed, i couldn't find that mqjbnd.dll on that location. Will that dll be put on that location ONLY if server softward been installed as well?

Thanks again.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 09, 2011 8:10 am    Post subject: Reply with quote

Grand High Poobah

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

di.wang wrote:

BTW, i looked at folder under C:\Program Files\IBM\WebSphere MQ\java\lib where only the client software been installed, i couldn't find that mqjbnd.dll on that location. Will that dll be put on that location ONLY if server softward been installed as well?

Thanks again.

Yes you need server software installed for the mqjbnd.dll
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Dec 09, 2011 8:15 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
di.wang wrote:

BTW, i looked at folder under C:\Program Files\IBM\WebSphere MQ\java\lib where only the client software been installed, i couldn't find that mqjbnd.dll on that location. Will that dll be put on that location ONLY if server softward been installed as well?

Thanks again.

Yes you need server software installed for the mqjbnd.dll


And even if you have the server software installed on the machine, you still can't create a bindings connection to a queue manager on another machine. Bindings connections use shared memory.
Back to top
View user's profile Send private message
di.wang
PostPosted: Fri Dec 09, 2011 8:27 am    Post subject: Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

Thanks fjb_saper and mqjeff, I was about to ask this question and you answered me directly.

OK, I will see if our client still want to re-install, re-setup everything, put all together on the same box in order to use the binding mode. If so, I may come back for more help. Otherwise, i am done with this question.

Thanks again for everbody on this thread, and hope you all have a nice weekend.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 09, 2011 8:33 am    Post subject: Reply with quote

Grand High Poobah

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

di.wang wrote:
Thanks fjb_saper and mqjeff, I was about to ask this question and you answered me directly.

OK, I will see if our client still want to re-install, re-setup everything, put all together on the same box in order to use the binding mode. If so, I may come back for more help. Otherwise, i am done with this question.

Thanks again for everybody on this thread, and hope you all have a nice weekend.


And just in case you forgot to ask:
If you are using J2EE JMS and want to make a 2 phase commit, you will have to be either using a WebSphere Application Server, or an MQServer on the same hardware stack (bindings connection), or the extended transactional client (extra licensing).

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
di.wang
PostPosted: Fri Dec 16, 2011 2:31 pm    Post subject: Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

Have to come back and asking for help again.

Appreciate you read the previous posts first. Now, the client still wants to move forward with binding mode, so they installed the mq server software on this same box, and set up the mq manager on this save box, set the mq cfg as:

<queueManager>
<property name="name">VEPTVW02</property>
<property name="hostname"></property >
<property name="port">1414</property>
<property name="channel"></property>
<property name="username"></property>
<property name="password"></property>

And try to connect (this should be binding mode, as hostname is NULL, correct?), still got the same 2495 error. I verified, on their mq install folder, they do have mqjbnd.dll file under C:\program files\ibm\mq-install\mqm\java\lib

is there anything else do i need to do? Also, how do i verify if they have the mq queue manager installed on the same box?

Thanks so much.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 16, 2011 5:30 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

di.wang wrote:
is there anything else do i need to do?


Well set the property to binding rather than client would seem to be necessary. Just leaving the hostname blank isn't eneough?

di.wang wrote:
how do i verify if they have the mq queue manager installed on the same box?


How likely are they to forget to do that?

The obvious way is a dspmq. You could also look for a folder on the file system with the queue manager's name, but that's where they've defined the data location to be so you'd be better off just asking if they remember to set up a queue manager!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 16, 2011 9:19 pm    Post subject: Reply with quote

Grand High Poobah

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

Make sure your properties contain the transport mode. This way you control the type of connection (server bindings vs client) by setting the transport mode.

I also would be much more careful with the client properties and set them all to null including the port number. V 7 AFAIK is more strict with the check of the arguments passed when creating the connection. I would only set client properties on top of server properties (qmgr name) if the transport says: bindings first, then client.

Don't know if V7 still has the restriction but you could only be connected in bindings mode to a single qmgr at a time in the same JVM...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
di.wang
PostPosted: Mon Dec 19, 2011 11:27 am    Post subject: Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

Thanks vitor and saper,

:Well set the property to binding rather than client would seem to be necessary. Just leaving the hostname blank isn't eneough?

yeah, that was what i did, and seems not enough.

: Make sure your properties contain the transport mode. This way you control the type of connection (server bindings vs client) by setting the transport mode.

this is what we already did (also posted on previous post), anything else we need to do?

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);

: I also would be much more careful with the client properties and set them all to null including the port number. V 7 AFAIK is more strict with the check of the arguments passed when creating the connection. I would only set client properties on top of server properties (qmgr name) if the transport says: bindings first, then client.

well, this could be the hit, on the cfg, we set port as 1414, and actually on the java code, we also set port to 1414, if cfg is set as blank(nothing). we also set MQEnvironment.channel = "" if there is no value defined on cfg file, would you suggest we set all these to MQEnvironment.channel = null when hostname is null?

: Don't know if V7 still has the restriction but you could only be connected in bindings mode to a single qmgr at a time in the same JVM...

We have multi-threads, each thread will have its own queue manager instance (although all using to the same qmgr name) to access a particular queue to AVOID the situlation like 'one task is waiting on a get, no puts can occur'. And of cource, all these threads and qmgr instances are in the same JVM. This will be be another hit?

And, as mentioned before, all these problems only on binding mode with error 2495.

If with client mode, everything works good and as expected.

Thanks again for all the help!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Dec 19, 2011 11:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Hi, it is not clear if you have understood this point or not.

Bindings mode only works to connect to a queue manager on the same machine as the application.

So if you have a qmgr on machine A, and an application on machine B - regardless of the type of application, regardless of anything else, then the application must use a client connection and cannot use a bindings connection.
Back to top
View user's profile Send private message
di.wang
PostPosted: Mon Dec 19, 2011 11:42 am    Post subject: Reply with quote

Novice

Joined: 12 Sep 2011
Posts: 10

mqjeff, thanks for ther reply. But on earlier post, i already put as following. Please help.

"
Have to come back and asking for help again.

Appreciate you read the previous posts first. Now, the client still wants to move forward with binding mode, so they installed the mq server software on this same box, and set up the mq manager on this save box, set the mq cfg as:
...
...
...
"
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Dec 20, 2011 2:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

the only information you need for a bindings connection is the name of the queue manager - the port provides no value.

So customer should remove the port from their config.

You otherwise need to make sure that the java application/app server is started up in a command shell that has the MQ libraries configured in it properly - see the post from roger lacroix.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » MQJE001: Completion Code '2', Reason '2495' 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.