problem in running ejb client!
i am newbie to the j2ee and wirte a simple ejb jar file to depoly on jboss with no error message. beside, with a client hope to access test if my ejb jar could work correct, but i do not know how to run the client by typing java HelloClient (the client i worte)
in commond line or spesify the classpath and jndi.properties, it all doesn't work! and message poped out on conlose look like NoClassDefFoundError or something else. where did i do it wrong?
thanks in advice,
-
package examples;
import javax.ejb.EJBObject;
public interface Hello extends EJBObject {
public String hello() throws java.rmi.RemoteException;
}
--
package examples;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.SessionContext;
public class HelloBean implements SessionBean {
private SessionContext ctx;
public HelloBean() {
}
public void ejbCreate(){
System.out.println("ejbCreate() ...!");
}
public void ejbActivate() throws javax.ejb.EJBException, java.rmi.RemoteException {
System.out.println("ejbAcivate() ...!");
throw new java.lang.UnsupportedOperationException("Method ejbActivate() not yet implemented.");
}
public void ejbPassivate() throws javax.ejb.EJBException, java.rmi.RemoteException {
System.out.println("ejbPassivate() ...!");
throw new java.lang.UnsupportedOperationException("Method ejbPassivate() not yet implemented.");
}
public void ejbRemove() throws javax.ejb.EJBException, java.rmi.RemoteException {
System.out.println("ejbRemove() ...!");
throw new java.lang.UnsupportedOperationException("Method ejbRemove() not yet implemented.");
}
public void setSessionContext(SessionContext ctx) throws javax.ejb.EJBException, java.rmi.RemoteException {
this.ctx = ctx;
throw new java.lang.UnsupportedOperationException("Method setSessionContext() not yet implemented.");
}
public String hello(){
System.out.println("hello()...!");
return "Hello, World!";
}
}
-
package examples;
import javax.ejb.EJBHome;
public interface HelloHome extends EJBHome {
Hello create() throws java.rmi.RemoteException,javax.ejb.CreateException;
}
--
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>JBoss Interest Sample Application</description>
<display-name>Interest EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>examples.HelloHome</home>
<remote>examples.Hello</remote>
<ejb-class>examples.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

