File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with stateless session bean

 
venkateswar gayam
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic