| Author | Message | 
		
		  | imey | 
			  
				|  Posted: Tue Oct 20, 2009 1:05 am    Post subject: Creating MQHeaderIterator Problem |   |  | 
		
		  | Newbie
 
 
 Joined: 20 Oct 2009Posts: 5
 
 
 | 
			  
				| Hi, all 
 I am using MQ v7.0 and programming against a funtion to get the headers from a message, but after
 
 MQHeaderIterator iter = new MQHeaderIterator(rcvMessage);
 
 I got an exception:
 
 Exception in thread "main" java.lang.NoClassDefFoundError: com . ibm . mq. headers . internal . CachingHeader
 
 
 And i check the package, there exist no such Class or Interface named cachingheader, when google it, only 2 dated and unavailable results are displayed.
 
 Anybody any ideas?
 
 Thanks
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | imey | 
			  
				|  Posted: Tue Oct 20, 2009 1:07 am    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 20 Oct 2009Posts: 5
 
 
 | 
			  
				| stack trace: 
 Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/headers/internal/CachingHeader
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(Unknown Source)
 at java.security.SecureClassLoader.defineClass(Unknown Source)
 at java.net.URLClassLoader.defineClass(Unknown Source)
 at java.net.URLClassLoader.access$000(Unknown Source)
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at com.ibm.mq.headers.MQHeaderRegistry.class$(MQHeaderRegistry.java:91)
 at com.ibm.mq.headers.MQHeaderRegistry.getDefault(MQHeaderRegistry.java:9
   at com.ibm.mq.headers.MQHeaderIterator.<init>(MQHeaderIterator.java:9
  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | WMBDEV1 | 
			  
				|  Posted: Tue Oct 20, 2009 1:12 am    Post subject: |   |  | 
		
		  | Sentinel
 
 
 Joined: 05 Mar 2009Posts: 888
 Location: UK
 
 | 
			  
				| It seems you have a missing JAR file on your classpath. I've not yet managed to tinker with MQ V7 yet so I cant tell you which one is needed. 
 I'd check out the %MQ INSTALL%\Java\lib for candidates.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | imey | 
			  
				|  Posted: Tue Oct 20, 2009 1:58 am    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 20 Oct 2009Posts: 5
 
 
 | 
			  
				| 
   
	| WMBDEV1 wrote: |  
	| It seems you have a missing JAR file on your classpath. I've not yet managed to tinker with MQ V7 yet so I cant tell you which one is needed. 
 I'd check out the %MQ INSTALL%\Java\lib for candidates.
 |  
 the jars i am using are:
 
 com.ibm.mq.jar
 com.ibm.mq.headers.jar
 com.ibm.mq.jmqi.jar
 com.ibm.mq.commonservices.jar
 connector.jar
 
 Plz tell me if i missed somthing
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | imey | 
			  
				|  Posted: Tue Oct 20, 2009 2:14 am    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 20 Oct 2009Posts: 5
 
 
 | 
			  
				| I tried both versions of MQ 7.0 and MQC 7.0.1 
 neither of them works :S
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Tue Oct 20, 2009 4:45 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| 
   
	| imey wrote: |  
	| the jars i am using are:
 
 com.ibm.mq.jar
 com.ibm.mq.headers.jar
 com.ibm.mq.jmqi.jar
 com.ibm.mq.commonservices.jar
 connector.jar
 
 I tried both versions of MQ 7.0 and MQC 7.0.1
 
 neither of them works :S
 |  
 Before you can say that, you have to try with all the jar files in the <mqinstall>/java/lib path on your class path.
   
 You don't get to pick and choose and say it doesn't work, because our answer will be -- user error, make it work! --
  _________________
 MQ & Broker admin
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | imey | 
			  
				|  Posted: Tue Oct 20, 2009 6:00 am    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 20 Oct 2009Posts: 5
 
 
 | 
			  
				| 
   
	| fjb_saper wrote: |  
	| 
   
	| imey wrote: |  
	| the jars i am using are:
 
 com.ibm.mq.jar
 com.ibm.mq.headers.jar
 com.ibm.mq.jmqi.jar
 com.ibm.mq.commonservices.jar
 connector.jar
 
 I tried both versions of MQ 7.0 and MQC 7.0.1
 
 neither of them works :S
 |  
 Before you can say that, you have to try with all the jar files in the <mqinstall>/java/lib path on your class path.
   
 You don't get to pick and choose and say it doesn't work, because our answer will be -- user error, make it work! --
  |  
 Thanks! My bad.
 
 After adding the pfc.jar to my build path, it works!
 
 
    |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |