| Author | 
		  Message
		 | 
		
		  | hilltops | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 6:35 am    Post subject: The libraries libmqjbnd05.so or mqjbnd05 can't be located | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 01 Mar 2006 Posts: 112
  
  | 
		  
		    
			  
				I have got difficulties getting my installation of MQ to locate the library libmqjbnd05.so. I have tried some of the solution recommended on this site.
 
 
I started with MQ version 5.3 CSD10 on Linux and using a JMS application try to connect to the queue manager. I get the following exception;
 
 
Exception in thread "main" java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path
 
at java.lang.ClassLoader.loadLibrary(Unknown Source)
 
at java.lang.Runtime.loadLibrary0(Unknown Source)
 
 
I have set the env variable LD_LIBRARY_PATH=/opt/mqm/java/lib/
 
 
I upgraded my MQ to Version 6.0.0.0 but still got similar problems
 
 
I am running a 64-bit JVM. The thrust of previous postings on this subject seems to suggest that there is  a conflict in the 64-bit classloader loading 32 bit libraries. Is that correct?  Is there a definitive solution/fix/workaround to this problem for Versions 5.3 and 6.0.
 
 
Thankx in anticipation of your responses. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 6:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				LD_LIBRARY_PATH should work.
 
 
If it doesn't, adding "-D java.library.path=/opt/mqm/java/lib" to your startup should work. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | hilltops | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 8:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 01 Mar 2006 Posts: 112
  
  | 
		  
		    
			  
				Still does not work with the env variable set:
 
 
This proves the vairable is set:
 
 
echo $LD_LIBRARY_PATH
 
/opt/mqm/java/lib/
 
 
and I run the application as follows;
 
 
java  -Djava.library.path=/opt/mqm/java/lib -jar  mqtest.jar "My Test Message"
 
 
I get the exception;
 
 
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/mqm/java/lib/libmqjbnd05.so: /opt/mqm/java/lib/libmqjbnd05.so: cannot open shared object file: No such file or directory
 
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
 
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
 
 
 
Do I need to put some sym link somewhere?
 
 
Thankx | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mvic | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 8:26 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 09 Mar 2004 Posts: 2080
  
  | 
		  
		    
			  
				What is the output from
 
   
	| Code: | 
   
  
	| ls -l /opt/mqm/java/lib/libmqjbnd05.so | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | hilltops | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 8:38 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 01 Mar 2006 Posts: 112
  
  | 
		  
		    
			  
				this is the output of ls -l /opt/mqm/java/lib/libmqjbnd05.so
 
 
-r-xr-xr-x  1 mqm mqm 93466 2005-05-19 22:09 /opt/mqm/java/lib/libmqjbnd05.so | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mvic | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 8:50 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 09 Mar 2004 Posts: 2080
  
  | 
		  
		    
			  
				
   
	| hilltops wrote: | 
   
  
	this is the output of ls -l /opt/mqm/java/lib/libmqjbnd05.so
 
 
-r-xr-xr-x  1 mqm mqm 93466 2005-05-19 22:09 /opt/mqm/java/lib/libmqjbnd05.so | 
   
 
 
Thanks.  I think the answer is in your first post; if this JVM is a 64-bit process, it will not be able to load a 32-bit shared library.  I'm assuming that libmqjbnd05.so is a 32-bit library, but maybe
 
   
	| Code: | 
   
  
	| file /opt/mqm/java/lib/libmqjbnd05.so | 
   
 
 
will say for sure.
 
 
Now, this doesn't explain why the error message written by the JVM was "cannot open shared object file: No such file or directory"    | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | hilltops | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 9:02 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 01 Mar 2006 Posts: 112
  
  | 
		  
		    
			  
				Yes, I have got a 32-bit version of MQ Version 6 as implied by /opt/mqm/lib.
 
 
64-bit would be in /opt/mqm/lib64. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mvic | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 9:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 09 Mar 2004 Posts: 2080
  
  | 
		  
		    
			  
				
   
	| hilltops wrote: | 
   
  
	Yes, I have got a 32-bit version of MQ Version 6 as implied by /opt/mqm/lib.
 
 
64-bit would be in /opt/mqm/lib64. | 
   
 
 
I think you are probably right, but NB. /opt/mqm/java/lib is neither /opt/mqm/lib nor /opt/mqm/lib64.  What do you get from the "file" command, out of interest? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mvic | 
		  
		    
			  
				 Posted: Thu Apr 20, 2006 9:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 09 Mar 2004 Posts: 2080
  
  | 
		  
		    
			  
				I just verified the point at http://www.ibm.com/developerworks/eserver/library/es-JNI_AIX_PAPER.html with a little help from Google.  (I've emphasized the most important bit).
 
 
   
	| Quote: | 
   
  
	| Trying to load a 64-bit shared library into a 32-bit JVM process address space, or vice versa, will also most likely result in java.lang.UnsatisfiedLinkError. There is no way to load a 64-bit object into a 32-bit process space, or vice versa. The linker appropriately selects objects from the library  based on the type of linking that is requested (32-bit or 64-bit), and creates an object or application of that type. | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | hilltops | 
		  
		    
			  
				 Posted: Fri Apr 21, 2006 2:02 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 01 Mar 2006 Posts: 112
  
  | 
		  
		    
			  
				I changed my JVM to a 32-bit version and resolved the problems.
 
 
Thankx everyone for your suggestions. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |