can't get a client class to run

hi all,

this is my first post and i'm a j2ee newbie.

I'm studying a book 'headfirst ejb' at the moment. i've installed the server and configurated everything. the first example in the book creates a simple application where there's a string[] full of strings which are advice eg "don't eat yellow snow" :) i've three files AdviceBean, AdviceHome and advice. i can post the code if necessary. i've used the deploytool and compiled and deployed them to the server, everythings fine so far. i then have to run a client use the bean. the client class compiles but when i try to run the client it gives me a 'java.lang.noclassdeffounderror : AdviceClient '

this is what i typed to run the client

java -cp {$CLASSPATH}:AdviceAppClient.jar;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\projects\advice\classes AdviceClient

has anyone got this book or can help?

thanks in advance

mat

[922 byte] By [jeeturtleboya] at [2007-11-26 13:55:31]
# 1

sorry to double post but here are the.java files, the 1st 3 are on the server and the forth one is the one that is giving me the error.

Advice.java

package headfirst;

import javax.ejb.*;

import java.rmi.RemoteException;

public interface Advice extends EJBObject{

public String getAdvice() throws RemoteException;

}

AdviceBean.java

package headfirst;

import javax.ejb.*;

public class AdviceBean implements SessionBean {

private String[] adviceStrings = {"bbbbbbbb", "vvvvvvv", "gggggggggg"

, "jjjjjjj", "rrrrrrr", "qqqqqqqq"};

public void ejbActivate(){

System.out.println("ejb activate");

}

public void ejbPassivate(){

System.out.println("ejb passivate");

}

public void ejbRemove(){

System.out.println("ejb remove");

}

public void setSessionContext(SessionContext ctx){

System.out.println("SessionContext");

}

public String getAdvice(){

System.out.println("in getadvice");

int random = (int) (Math.random() * adviceStrings.length);

return adviceStrings[random];

}

public void ejbCreate(){

System.out.println("in ejbCreate");

}

AdviceHome.java

package headfirst;

import javax.ejb.*;

import java.rmi.RemoteException;

public interface AdviceHome extends EJBHome{

public Advice create() throws CreateException, RemoteException;

}

AdviceClient.java

import javax.naming.*;

import java.rmi.*;

import javax.rmi.*;

import headfirst.*;

import javax.ejb.*;

public class AdviceClient {

public static void main (String[] args){

new AdviceClient().go();

} // end of main

public void go() {

try{

Context ic = new InitialContext();

Object o = ic.lookup("Advisor");

AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);

Advice advisor = home.create();

System.out.println(advisor.getAdvice());

} catch (Exception ex) {

ex.printStackTrace();

} // end of try|catch

} // end of go

} // end of class

jeeturtleboya at 2007-7-8 1:34:37 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...