1 Reply Latest reply on Aug 25, 2005 8:01 AM by jaikiran pai

    Invalid Invocation of Stateless Session Bean

    Manoj Pujara Newbie

      Hi

      I am having issue with invoking home interface's create() method.
      try {
      Hashtable<String,String> env = new Hashtable<String,String>();
      env.put(Context.PROVIDER_URL,"jnp://localhost:1099");
      env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      Context ctx = new InitialContext(env);
      Object objref = ctx.lookup("xpflow/Finder");
      FinderHome home =
      (FinderHome) PortableRemoteObject.narrow(objref,
      FinderHome.class);
      finder = home.create();
      }
      catch (Exception e) {
      e.printStackTrace(System.out);
      throw InternalError.Get("Big Problems", e);
      }

      Here is the home interface code

      public interface FinderHome extends EJBHome
      {
      public Finder create() throws RemoteException, CreateException;
      }

      Following is the deployment descriptor:
      ejb-jar.xml:
      <?xml version="1.0"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
      version="2.1">
      <enterprise-beans>

      <ejb-name>Finder</ejb-name>
      com.xpflow.bd.FinderHome
      com.xpflow.bd.Finder
      <ejb-class>com.xpflow.bd.FinderBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>



      <ejb-name>LocalFinder</ejb-name>
      <local-home>com.xpflow.bd.LocalFinderHome</local-home>
      com.xpflow.bd.LocalFinder
      <ejb-class>com.xpflow.bd.LocalFinderBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>

      </enterprise-beans>
      </ejb-jar>
      <?xml version='1.0' encoding='UTF-8' ?>

      <!DOCTYPE jboss PUBLIC
      "-//JBoss//DTD JBOSS 4.0//EN"
      "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">


      <enterprise-beans>

      <ejb-name>Finder</ejb-name>
      <jndi-name>xpflow/Finder</jndi-name>


      <ejb-name>LocalFinder</ejb-name>
      <jndi-name>xpflow/LocalFinder</jndi-name>

      </enterprise-beans>



      I am not sure what is wrong with this configuration.