EJB CabinBean-client Monson-Haefel Book
Hi,
I am working with the Monson-Haefel Enterprise JavaBeans book (OReilly) and I have the following problem in chapter 4: I successfully deployed the Cabin EJB with J2EE deploytool (after changing the source code for the CabinHomeRemote.class [ejbCreate-method has to throw a CreateException]) but I have problems with the Client_1.class: I get the following error message java.lang.NoClassDefFoundError: javax/ejb/FinderException Exception in thread "main"
This is my source code:
public class Client_1 {
public static void main(String [] args){
try{
Context initial=new InitialContext();
Context myEnv= (Context) initial.lookup("java:comp/env");
Object objref = myEnv.lookup("MyCabinBean");
CabinHomeRemote home= (CabinHomeRemote) PortableRemoteObject.narrow(objref, CabinHomeRemote.class);
CabinRemote cabin_1=home.create(new Integer(1) );
cabin_1.setName("Master Suite");
cabin_1.setDeckLevel(1);
cabin_1.setShipId(1);
cabin_1.setBedCount(3);
Integer pk=new Integer(1);
CabinRemote cabin_2=home.findByPrimaryKey(pk);
System.out.println(cabin_2.getName());
System.out.println(cabin_2.getDeckLevel());
System.out.println(cabin_2.getShipId());
System.out.println(cabin_2.getBedCount());
}catch (java.rmi.RemoteException re) {re.printStackTrace();}
catch (javax.naming.NamingException ne) {ne.printStackTrace();}
catch (javax.ejb.CreateException ce) {ce.printStackTrace();}
catch (javax.ejb.FinderException fe) {fe.printStackTrace();}
};
}
In deploytool I set the JNDI name for the CabinBean to "MyCabinBean". Can anybody who has successfully ran the chapter 4 examples on J2EE server help me with this?
best regards,
Thomas

