How do I create a stateless session bean with EJB 3.0?

Byron Tymvios

To create a stateless session bean you need to make use of the @Stateless annotation. You place the annotation on the line before the class declaration. You will also need to implement an interface to allow either local or remote access to the beans methods and to define the methods.

Here is the interface, I have declared as remote with the @Remote annotation.

import javax.ejb.Remote;

public interface StatelessInterface{
    public String someMethod();

Here is the bean with the method implemented.
import javax.ejb.Stateless;

public class MyStatelessSessionBean implements StatelessInterface{
    private int someInt = -1;

    public void MyStatelessSessionBean(){

    public String someMethod(){
        return "My Stateless Session Bean";