• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and my servlet  RSS feed

 
Jon Rowe
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm trying to reach an EJB through my localhost. This code comes from my servlet:
InitialContext initialContext=new InitialContext();

Object homeObject=initialContext.lookup( "Subscr" );

SubscrHome subhome
=(SubscrHome)PortableRemoteObject.narrow(homeObject,SubscrHome.class);


subscr=subhome.create();
When I run this servlet I get:
javax.naming.NameNotFoundException: Subscr not found
<<no stack trace available>>
What am I doing wrong in the deployment process?
Thanks in advance
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jon,
Step #1: Have you looked in the Java API docs to see what javax.naming.NamingException says about itself?
Step #2: Have you read about what situations will raise a NamingException, and from what functions? (i.e. What functions did you call that force you to catch or declare that exception?)
Try those out, then get back to me, and we'll move on to step #3 if you still need help.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!