I have EJB module that I want to make RESTFULL api.
I do not have any war files. Only EJB.jar file which has been deployed on glassfish server.
Following is my SessionBean class.
@Stateless
@LocalBean
public class TestSessionBean {
@GET
@Path("/test")
@Produces(MediaType.APPLICATION_JSON)
public JSONObject getObjects(@QueryParam("city") String city) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put(city, "test");
return jSONObject;
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
}
My ejb module name as TestEJB
. I am using JEE6
. I tried to get resource from googling. but did not get any idea.
I went Inject a EJB into JAX-RS (RESTfull service) and so on. But could not get any usefull resources.
Note: I heard from one of my friend that it is possible in EJB3 so I tried to do.
I do not know is it possible or not please kindly guide me.