Create local business interface
@Local
public interface HelloWorld
{
String sayHello();
}
Create bean implementation,
@Stateless
public class HelloWorldBean implements HelloWorld {
public HelloWorldBean() {
}
public String sayHello()
{
return "Hello World !!!";
}
}
Deploy and create client according to this documentation, https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI
Add reqd jars and run the client. It works for both @Local and @Remote.
But it should NOT work for @Local.