• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NameNotFoundException

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Now I have a problem running the client.The client stops running with an exception NameNotFoundException.
While genrating deployment descriptor using the jetace tool I have specified the JNDI name and using the same in my client programme too.And I delpoy it successfully using the admin console.
I don't exactly why i getting this problem..have i missed out something while installing or should I take care of something else which I haven't done.Please help me out.
My client code goes this way...
import com.gdii.helloworld.* ;
import java.util.*;
import java.rmi.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
public class HelloClient{
public static void main(String [] args) {
try {
// Properties props = System.getProperties() ;
// Context ctx = new InitialContext(props) ;
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
properties.put(javax.naming.Context.PROVIDER_URL,"iiop://192.168.3.134");
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");

System.out.println("3");
System.out.println(properties.get(javax.naming.Context.PROVIDER_URL));
System.out.println(properties.get(javax.naming.Context.INITIAL_CONTEXT_FACTORY));
InitialContext initial= new InitialContext(properties);
System.out.println("4");
Object homeObject=initial.lookup("rita");
System.out.println("5");
HelloHome home =(HelloHome) PortableRemoteObject.narrow(homeObject,HelloHome.class);
System.out.println("6");

//Context ctx = new InitialContext() ;
//HelloHome home = (HelloHome) ctx.lookup("HelloHome") ;
Hello hello = home.create() ;
System.out.println(hello.hello()) ;
hello.remove() ;
}catch(Exception excp) {
excp.printStackTrace() ;
}
}
}

Prashanth
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prashanth
Can you post error output. Try putting the port number after ip address. Like this "iiop://192.168.3.134:900". And try this piece of code also.
javax.naming.InitialContext initial= new javax.naming.InitialContext(properties);
Thanks
Konda
 
If you're gonna buy things, buy this thing and I get a fat kickback:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic