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 IBM MQ Support » Unable to connect to the target queue manager Ender

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 Unable to connect to the target queue manager Ender « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Fri Jun 12, 2009 5:57 am    Post subject: Re: Unable to connect to the target queue manager Ender Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

amoljoshi28 wrote:
Can i specify MQ_INSTALL_ROOT inside the program?


Set it in the WAS container environment for the server. See your WAS docs for specifics.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jun 13, 2009 5:53 am    Post subject: Reply with quote

Grand High Poobah

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

Quote:
javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager Ender [Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2495'.]
at com.ibm.mq.jms.context.MQContext.<init>(MQContext.java:196)
at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)

Apart from the fact that I would suggest you start with a Filesystem JNDI provider, you can set that variable in Window by using the environment.(set <varname>=<value>)

However my guess is that <mqinstallpath>/java/lib is not on your path variable and as such you are missing an essential native library (.dll) to be able to connect. I understand you want to connect to a qmgr that is on the same machine.

At the same time using -Djava.library.path="///C:/Program Files/IBM/WebSphereMQ/java/lib" might help. Keep in mind though that you might have to replace the long form of the directories containing spaces with the short form. (see dir /x)

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
amoljoshi28
PostPosted: Sat Jun 13, 2009 7:37 am    Post subject: Reply with quote

Novice

Joined: 10 Jun 2009
Posts: 24

fjb_saper wrote:
Quote:
javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager Ender [Root exception is com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2495'.]
at com.ibm.mq.jms.context.MQContext.<init>(MQContext.java:196)
at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)

Apart from the fact that I would suggest you start with a Filesystem JNDI provider, you can set that variable in Window by using the environment.(set <varname>=<value>)

However my guess is that <mqinstallpath>/java/lib is not on your path variable and as such you are missing an essential native library (.dll) to be able to connect. I understand you want to connect to a qmgr that is on the same machine.

At the same time using -Djava.library.path="///C:/Program Files/IBM/WebSphereMQ/java/lib" might help. Keep in mind though that you might have to replace the long form of the directories containing spaces with the short form. (see dir /x)

Have fun


Ok..


I have already set one system variable named "MQ_INSTALL_ROOT" having the value= C:\Program Files\IBM\WebSphere MQ\java\lib inside Environmental Variable.

Do i have to remove spaces in this path too? And is that if i delete spaces in the path then 'voila!', it becomes what you guys call "short form of directory names" ?

Yes i`m trying to connect to the qmgr on the same machine. yeah exactly what was i thinking "there`s a problem with the essential native problem (.dll file)". Though i have file mqjbnd.dll in the directory: C:\Program Files\IBM\WebSphere MQ\java\lib


There`s one system variable called "Path" having value= C:\Program Files\IBM\WebSphere MQ\Java\lib;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\IBM\WebSphere MQ\bin;C:\Program Files\IBM\WebSphere MQ\tools\c\samples\bin

Do i have to change this one too?

And i tried setting -Djava.library.path="C:/Program Files/IBM/WebSphereMQ/java/lib"..

Do i have to three slashes in the beginning of the path? so this would look like as u mentioned -Djava.library.path="///C:/Program Files/IBM/WebSphereMQ/java/lib"

Please note i`m using Eclipse Platform and setting this one inside VM Arguments..


Back to top
View user's profile Send private message
amoljoshi28
PostPosted: Sat Jun 13, 2009 8:36 am    Post subject: Reply with quote

Novice

Joined: 10 Jun 2009
Posts: 24

Well i got what u guys mean by short path names..

Short name for C:/Program Files/IBM/WebSphereMQ/java/lib would be C:/progra~1/ibm/websph~1/java/lib

Tried modifying..But No change..

It is still not detecting the native library path (.dll)..
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Jun 13, 2009 4:53 pm    Post subject: Re: Unable to connect to the target queue manager Ender Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

amoljoshi28 wrote:
I have already set one system variable named "MQ_INSTALL_ROOT" having the value= C:\Program Files\IBM\WebSphere MQ\java\lib inside Environmental Variable.

Setting MQ_INSTALL_ROOT won't help, unless the application is running in a WAS environment.

amoljoshi28 wrote:
I'm not running in a WAS Environment.

That explains that.

amoljoshi28 wrote:
... i have file mqjbnd.dll in the directory: "C:\Program Files\IBM\WebSphere MQ\java\lib"
... and i tried setting -Djava.library.path="C:/Program Files/IBM/WebSphereMQ/java/lib".

Fix the spelling of "WebsphereMQ", and "/", and try again.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Jun 14, 2009 9:03 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

The path must be exact. ProgramFiles is different from Program Files. WebsphereMQ is different from WebSphere MQ.

Here's a suggestion: go to your c: drive and navigate down to the folder you want, then copy the exact path from the Windows Explorer address field.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
amoljoshi28
PostPosted: Sun Jun 14, 2009 10:15 am    Post subject: Reply with quote

Novice

Joined: 10 Jun 2009
Posts: 24

bruce2359 wrote:
The path must be exact. ProgramFiles is different from Program Files. WebsphereMQ is different from WebSphere MQ.

Here's a suggestion: go to your c: drive and navigate down to the folder you want, then copy the exact path from the Windows Explorer address field.



I`m giving these paths in VM Arguments inside Eclipse.

If i write these paths with spaces, it`s not detecting the exact directory.
It stops at the first space looking for next argument.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sun Jun 14, 2009 11:30 am    Post subject: Re: Unable to connect to the target queue manager Ender Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

amoljoshi28 wrote:
If i write these paths with spaces, it`s not detecting the exact directory.
It stops at the first space looking for next argument.

Misspelling the directory names by taking out spaces certainly doesn't help. Either enclose the path names in quotes, or substitute the alternate short filename, (as given by "dir /x"), or use a different operating system, whichever is easier.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Jun 14, 2009 12:49 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

Yes, spaces in a path will tell the parser that it has reached the end of the path. This is a DOS thing.

Put quotes around the complete path. Quotes means the double kind, not apostrophes. Like this:

"c:/Program Files/IBM/WebSphere MQ/ ..."
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sun Jun 14, 2009 1:05 pm    Post subject: Re: Unable to connect to the target queue manager Ender Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

bruce2359 wrote:
Like this:

"C:/Program Files/IBM/WebSphere MQ/ ..."

... except with '\', instead of '/'; it's a DOS thing.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Jun 14, 2009 3:45 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

you have no idea how difficult it is for me to type one of those slash characters that seems to go the wrong way...
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
amoljoshi28
PostPosted: Sun Jun 14, 2009 10:08 pm    Post subject: Reply with quote

Novice

Joined: 10 Jun 2009
Posts: 24

bruce2359 wrote:
you have no idea how difficult it is for me to type one of those slash characters that seems to go the wrong way...


Ok, i`ll try that one too.
Back to top
View user's profile Send private message
amoljoshi28
PostPosted: Mon Jun 15, 2009 3:22 am    Post subject: Success! Reply with quote

Novice

Joined: 10 Jun 2009
Posts: 24

Well, very much weird ending to my questions here..

Firstly, i tried the suggestions as told by u guys recently. But did n`t work.

Then i created a new project with same java files to connect without putting those VM arguments, but created the initial context by giving Properties object containing the INITIAL_CONTEXT_FACTORY and PROVIDER_URL.

And added external jars required to run the project..

And Voila..It worked..

Really irritated and worked my ass off for like 6 days now on the same damn code. And it`s finally accomplished the task.

Thanks a lot for ur help guys. It meant quite a lot to me.
I was thinking about moving to other MQ series from a different vendor. But ur replies made me try till i got that thing right.

Thanks a bunch!

U all are great people..

Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Jun 15, 2009 5:07 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

Quote:
other MQ series from a different vendor

Huh?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jun 15, 2009 5:12 am    Post subject: Reply with quote

Grand High Poobah

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

bruce2359 wrote:
Quote:
other MQ series from a different vendor

Huh?


Don't ask....

I presume the poster is refering to SwiftMQ or ActiveMQ. Potentially interesting conversation with whoever had paid IBM for the license to WebsphereMQ...



....unless of course the poster has direct purchasing authority....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » General IBM MQ Support » Unable to connect to the target queue manager Ender
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.