• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing Simple Ejb 3.0 in weblogic 9.2  RSS feed

Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to write a simple bean inweblogic 9.2
here is my bean
public interface Calculator {
public int add(int a,int b);
import javax.ejb.Stateless;
import javax.ejb.Local;

* Created by IntelliJ IDEA.
* User: rnizamuddin
* Date: Jun 8, 2006
* Time: 11:32:03 AM
* To change this template use File | Settings | File Templates.
@Local ({Calculator.class})
public class CalculatorBean implements Calculator{
public int add(int a , int b){
return a+b;

There is no deployment descriptor as it is optional. i jar these file and when deployed in weblogic 9.2 Tech preview it is not recognised as an EJB in the deployment table but is recognized as just a library. Is there something which i am missing. Please let me know. On the client side in am using injector to inject the ejb. the cal object is always null since i can understnad the ejb is installed as library.
@EJB Calculator cal;
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
Context context = new InitialContext();
if (cal == null){
System.out.println("Calculator Object is null");
Please let me know
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!