I am trying to deploy my first EJB in JRun.  I have a servlet that tries to get a
reference to the home interface (CabinHome).  I am receiving the error below which
I believe is a JNDI error.  I packaged my classes and the cabin.properties file (below)
into cabin.jar into the /deploy dir on the default server.  I ran the deploy tool...
Jrun seems happy.  Any ideas about what I missed that might be causing this?
 
Thanks
Joe
 
***** Error in default.err when accessing beand from servlet *****
 
javax.naming.NameNotFoundException: cabin.CabinHome not found
 at allaire.ejipt._NamingContext.lookup(_NamingContext.java:73)
 
 
 

***** Cabin.properties *****
 
ejb.homeInterfaceClassName=com.titan.cabin.CabinHome
ejb.remoteInterfaceClassName=com.titan.cabin.Cabin
ejb.enterpriseBeanClassName=com.titan.cabin.CabinBean
ejb.primaryKeyClassName=com.titan.cabin.CabinPK
 
ejb.beanHomeName=cabin.CabinHome
 
create.ejb.allowedIdentities=all
 
getBedCount.ejb.allowedIdentities=all
getDeckLevel.ejb.allowedIdentities=all
getName.ejb.allowedIdentities=all
getShip.ejb.allowedIdentities=all
setBedCount.ejb.allowedIdentities=all
setDeckLevel.ejb.allowedIdentities=all
setName.ejb.allowedIdentities=all
setShip.ejb.allowedIdentities=all
 
ejipt.isCreateSilent=true
 
 
 

***** Servlet method used to access bean *****
 
private void addCabin( int shipid, String shipname, int decklevel, int bedcount, Context context )
// -- the context is saved as a session attribute and passed in by the doPost method.
{
 try
 {
      final UserSession user = (UserSession)context.lookup("allaire.ejipt.UserSession");
      user.begin();
      try
      {
           final CabinHome home = (CabinHome)context.lookup("cabin.CabinHome");
 
           Cabin newcabin = home.create(shipid);
           newcabin.setShip(shipid);
           newcabin.setName(shipname);
           newcabin.setDeckLevel(decklevel);
           newcabin.setBedCount(bedcount);
      }
      catch( java.rmi.RemoteException re )
      {
           re.printStackTrace();
      }
      catch( javax.naming.NamingException ne )
      {
           ne.printStackTrace();
      }
      catch( javax.ejb.CreateException ce )
      {
           ce.printStackTrace();
      }
  finally
  {
   user.end();
  }
 }
 catch( javax.naming.NamingException ne )
 {
  ne.printStackTrace();
 }
}

Reply via email to