3 Replies Latest reply on Apr 24, 2003 7:35 PM by Ashuthosh Bhat

    How to write jboss.xml for a stateless session bean?

    Ashuthosh Bhat Newbie

      I have written a stateless session bean. How can I write my jboss.xml? Can any one please guide

      1)package customer;
      import javax.ejb.*;
      import java.rmi.*;

      public interface CustomerHome extends EJBHome
      {
      public Customer create() throws CreateException, RemoteException;
      }

      2) package customer;
      import javax.ejb.*;
      import java.rmi.*;

      public class CustomerBean implements SessionBean
      {
      SessionContext sc;
      public void ejbCreate()
      {
      System.out.println("called ejbCreate");
      }
      public void ejbPostCreate()
      {
      System.out.println("called ejbPostCreate");
      }
      public void ejbActivate()
      {
      System.out.println("called ejbActivate");
      }
      public void ejbPassivate()
      {
      System.out.println("called ejbPassivate");
      }
      public void ejbRemove()
      {
      System.out.println("called ejbRemove");
      }
      public void setSessionContext(SessionContext sc)
      {
      this.sc = sc;
      }
      public String sayHelloToCustomer()
      {
      return "Hello Friend";
      }
      }

      3) package customer;
      import javax.ejb.*;
      import java.rmi.*;

      public interface Customer extends EJBObject
      {
      public String sayHelloToCustomer() throws RemoteException;
      }

      4)<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>



      <!-- ejb-jar.xml -->


      <ejb-jar>
      <enterprise-beans>

      <ejb-name>CustomerBean</ejb-name>
      customer.CustomerHome
      customer.Customer
      <ejb-class>customer.CustomerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>

      <assembly-descriptor>
      </assembly-descriptor>

      </ejb-jar>

      Thank you