| Author | 
		  Message
		 | 
		
		  | vc1981 | 
		  
		    
			  
				 Posted: Thu Apr 12, 2007 9:27 pm    Post subject: Cannot instantiate class: com.ibm.websphere.naming.WsnInitia | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Jan 2006 Posts: 46
  
  | 
		  
		    
			  
				Hi , 
 
 
 I have a java application as depicted below :
 
 
 
Hashtable env = new Hashtable ();
 
			
 
			env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
 
			env.put(Context.PROVIDER_URL,"iiop://localhost:2809");
 
			env.put(Context.REFERRAL,"throw");
 
			
 
			try{
 
				ctx = new InitialDirContext(env);
 
				
 
				
 
			}catch(Exception e){
 
				System.err.println("Error in Context Factory Lookup"+ e.getMessage() );
 
								}
 
			try{
 
				factory = (QueueConnectionFactory)ctx.lookup("jms/TestJMSMQCF");
 
				
 
			}catch(Exception e){
 
				
 
				System.err.println("Error in Queue Connection Factory lookup"+ e.getMessage());
 
			}
 
 
 
 
 
 
I have created the QCF with the JNDI name as jms/TestJMSMQCF in my WAS.This code gets compiled but when i try to execute the same i get a an error which says :
 
 
Error in Context Factory LookupCannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory _________________ Regards ,
 
VC | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Apr 13, 2007 3:52 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Use the WebSphere Application Server Client environment. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vc1981 | 
		  
		    
			  
				 Posted: Sun Apr 15, 2007 10:10 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Jan 2006 Posts: 46
  
  | 
		  
		    
			  
				
   
	| jefflowrey wrote: | 
   
  
	| Use the WebSphere Application Server Client environment. | 
   
 
 
 
Could you please point me to some documentation which tells me as to how i can go about doing this ? _________________ Regards ,
 
VC | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Mon Apr 16, 2007 12:53 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| vc1981 wrote: | 
   
  
	
   
	| jefflowrey wrote: | 
   
  
	| Use the WebSphere Application Server Client environment. | 
   
 
 
 
Could you please point me to some documentation which tells me as to how i can go about doing this ? | 
   
 
 
 
Piece of advice for new comers and JMS.
 
Start with the FILE Based JNDI. It is the most simple to setup and has the tiniest foot print.
 
 
Enjoy    _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vc1981 | 
		  
		    
			  
				 Posted: Mon Apr 16, 2007 9:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Jan 2006 Posts: 46
  
  | 
		  
		    
			  
				[quote="fjb_saper"]
   
	| vc1981 wrote: | 
   
  
	
   
	| jefflowrey wrote: | 
   
  
	| Use the WebSphere Application Server Client environment. | 
   
 
 
 
Start with the FILE Based JNDI. It is the most simple to setup and has the tiniest foot print.
 
 | 
   
 
 
 
Yeah i did that couple of days back  and now wanted to try the one with WAS and that 's when i am getting all these errors ! _________________ Regards ,
 
VC | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Tue Apr 17, 2007 6:30 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| vc1981 wrote: | 
   
  
	| Yeah i did that couple of days back and now wanted to try the one with WAS and that 's when i am getting all these errors ! | 
   
 
 
 
Well if you try to use the WAS JNDI outside of WAS app server you need to use the J2EE client footprint and that one is quite massive....
 
 
Enjoy    _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Apr 17, 2007 7:31 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |