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 » Accessing Java Libraries with different user

Post new topic  Reply to topic
 Accessing Java Libraries with different user « View previous topic :: View next topic » 
Author Message
MABeatty1978
PostPosted: Thu Jul 16, 2015 11:44 am    Post subject: Accessing Java Libraries with different user Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

I've got a java application (using Eclipse) that I wrote that works fine when running on my development box under my user name, but when I run the application using the user that will be in production, I get MQRC 4095 MQRC_MODULE_NOT_FOUND. I assume this to be a permission issue. To confirm, I exported the project and imported it into back into an instand of Eclipse using the production user. In doing so, it becomes pretty clear by all the red squiggly lines with the message "import com.ibm cannot be resolved" that this uesr is unable to access those libraries.

Any advice as to what I'm doing wrong and how to resolve?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 16, 2015 12:46 pm    Post subject: Reply with quote

Grand High Poobah

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

You did not specify the environment (Windows / Linux). I would say make the library path and everything underneath it Read eXecute for everybody
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
MABeatty1978
PostPosted: Fri Jul 17, 2015 4:26 am    Post subject: Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

Env is Linux. I changed the ownership of /opt/mqm/java/lib and the jar's beneath it, but it didn't resolve anything.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 17, 2015 5:05 am    Post subject: Reply with quote

Grand High Poobah

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

MABeatty1978 wrote:
Env is Linux. I changed the ownership of /opt/mqm/java/lib and the jar's beneath it, but it didn't resolve anything.

Sure but did you also set rx for the libraries there (*.so)?
And remember to do it for both /opt/mqm/java/lib and /opt/mqm/java/lib64
Or any corresponding non std directory you might have installed MQ into.

Don't change ownership... just add rx for all.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Fri Jul 17, 2015 5:07 am    Post subject: Reply with quote

Guardian

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

Have you tried recreating the error with an MQ Java trace enabled? -> http://www-01.ibm.com/support/docview.wss?uid=swg21174924

There are also ways to debug this with strace, if the Java trace isn't helpful in resolving it.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 17, 2015 5:15 am    Post subject: Reply with quote

Grand High Poobah

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

And by the way, when using eclipse, please create a library for the MQ jars.
You can then just add the library to your project and all the red lines should now go away...

(I don't add the jars to the classpath, I add the jars to the library.) This way if I happen to have the jars in a different path or at a different level, all I have to do is add the corresponding library to the project, an can configure the runtime execution with different versions as well depending on the libraries declared for the runtime execution....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
MABeatty1978
PostPosted: Fri Jul 17, 2015 11:26 am    Post subject: Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

I'm getting this from the stack:

com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]

but when I run dspmqver -p 4:
Name: IBM WebSphere MQ
Version: 7.0.1.7
CMVC Level: k701-107-111107 mqjbnd=k701-107-111107
Build Type: Production
Back to top
View user's profile Send private message
vennela
PostPosted: Fri Jul 17, 2015 11:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I think you might have to set LD_LIBRARY_PATH
But not sure how you would do that in Eclipse
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MABeatty1978
PostPosted: Mon Jul 20, 2015 5:06 am    Post subject: Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

vennela wrote:
I think you might have to set LD_LIBRARY_PATH
But not sure how you would do that in Eclipse


That fixed it, thatnk you! FYI, don't need to do it in eclipse, just set the path in your login profile and Eclipse will source it in when it lauches.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jul 20, 2015 1:53 pm    Post subject: Reply with quote

Grand High Poobah

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

You can also set it explicitly by using a launch profile and the JVM option:
Code:
#linux
-Djava.library.path=///${MQ_JAVA_INSTALL_PATH}/[lib|lib64]
#windows
-Djava.library.path=///%MQ_JAVA_INSTALL_PATH%/[lib|lib64]

use either lib or lib64 depending on the OS and the support of your JVM.
Or if using multiple installations an absolute path and a launch profile per installation...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jul 21, 2015 5:48 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

or export/set it in the environment of a command shell, and then run the eclipse process from that shell.

This also allows you to sudo/r u n a s or etc.
Back to top
View user's profile Send private message
tczielke
PostPosted: Tue Jul 21, 2015 5:59 am    Post subject: Reply with quote

Guardian

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

Also, Linux administrators do frown upon the use of LD_LIBRARY_PATH. I believe setting that environment variable does affect any any shared object file that your process would load and would require dynamic linking.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
vennela
PostPosted: Fri Jul 31, 2015 9:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

If he is using Eclipse, most likely his workstation is Linux based and not Windows based and I believe that is where he is doing these settings. So, in this case my best guest is he himself is the Linux administrator
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tczielke
PostPosted: Fri Jul 31, 2015 9:35 am    Post subject: Reply with quote

Guardian

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

To clarify, the use of the LD_LIBRARY_PATH environment variable is a frowned upon practice in Linux, at least based on what I have read. You at least need to be aware of the dynamic linking risks if you use it, especially in an enterprise environment.
_________________
Working with MQ since 2010.
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 » IBM MQ Java / JMS » Accessing Java Libraries with different user
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.