wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes problem with stateless session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "problem with stateless session bean" Watch "problem with stateless session bean" New topic
Author

problem with stateless session bean

venkateswar gayam
Greenhorn

Joined: Nov 18, 2008
Posts: 3
here is the code
-------------------------bean class
package pkg;

import javax.ejb.Stateless;

@Stateless
public class HelloBean implements HelloRemote {
public void sayHello(String name) {
System.out.println("Hello " + name + " welcome to SCBCD");
}

}
------------------------remote interface
package pkg;

import javax.ejb.Remote;

@Remote
public interface HelloRemote {
public void sayHello(String name);

}
-------------------------client code
package ejb;
import pkg.HelloBean;
import pkg.HelloRemote;
import javax.ejb.EJB;
public class Client{
@EJB
private static Client c;
public static void main(String[] args){
c.sayHello("aishwarya rai");
}
}
----------------------------
can any body say how to run this program
problem is error at method invocation in client side
please help me
prashant k. gupta
Ranch Hand

Joined: May 15, 2008
Posts: 62
Originally posted by venkateswar gayam:

can any body say how to run this program
problem is error at method invocation in client side
please help me




Use Dependency Injection on Business interface reference.

@EJB
HelloRemote c;
 
GeeCON Prague 2014
 
subject: problem with stateless session bean