Calling a Stateful Session bean in NetBeans30 July 2007
In the previous blog Introduction to stateful session Bean in NetBeans there was information regarding developing stateful session bean. Here we will learn how to make call business methods of a stateful session bean.
- Go to the enterprise application where your Session Bean Ejb module exists. Here you need to create a simple Java class, now in this java class Right Click and select Enterprise Resources -> Call Enterprise Bean.
- Following screen will be appeared, which will show you the enterprise beans in IDE,you can select one of these beans.
- Check the option Generate Inline Lookup Code and press OK. IDE will generate the necessary code to call the enterprise bean in Java class as shown below.
- You might need to edit some code in order to call business method of Session Bean. If the invoked EJB is deployed to the server. You can run this Java class to see the results.
It will look like this: Calling a Stateful Session bean in NetBeans