Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB lookup - failure  RSS feed

 
Rama Raghavan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought it would have been easier. Don't know where I'm missing out..
I have configured and deployed a jar for EJB I have configured and deployed a war for my web app.
1. When I try to lookup local home interface, I get ClassCastException.
Here is snippet for this case:
InitialContext ctx = new InitialContext();
(StockManagerLocalHome) home =(StockManagerLocalHome) ctx.lookup("StockManagerLocal");
2. When I try to lookup (remote) home interface, I get javax.naming.NameNotFoundException: Unable to resolve StockManager
Here is snippet for this case:
InitialContext ctx = Environment.getInitialContext ();
Object obj = ctx.lookup("StockManager");
StockManagerHome home = (StockManagerHome) javax.rmi.PortableRemoteObject.narrow(obj,StockManagerHome.class);

Here is the section from the deployment descriptors -
weblogic descriptor:
<jndi-name>StockManager</jndi-name>
<local-jndi-name>StockManagerLocal</local-jndi-name>
EJB Descriptor:
<ejb-name>StockManager</ejb-name>
<home>ejb.sessionBeans.StockManagerHome</home>
<remote>ejb.sessionBeans.StockManagerRemote</remote>
<local-home>ejb.sessionBeans.StockManagerLocalHome</local-home>
<local>ejb.sessionBeans.StockManagerLocal</local>
<ejb-class>ejb.sessionBeans.StockManager</ejb-class>
<session-type>Stateless</session-type>
I am using Weblogic 6.1 SP2. Appreciate any help to resolve this. Thanks - Rama
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!