1 Reply Latest reply on Dec 3, 2005 4:57 PM by Scott Stark

    Local EJB Lookup

    arvind p Newbie

      Hi EveryOne,

      When I'm trying to look up the Local EJB through a Servlet and I'm getting the java.lang.ClassCastException.

      Here is my Client Code

      try {
       Context context = new InitialContext();
       Object object = context.lookup("LoginSLHome");
       logger.info("Object ::: "+object.getClass().getName());
       LoginSLHome home = (LoginSLHome) object;
      } catch (Exception exception) {
       logger.error("Exception while locating Home Object: ");
       logger.error(exception);
      }
      


      Output of the above logger statement is
      Object ::: $Proxy128

      In jboss.xml

      <session>
       <ejb-name>LoginSLEJB</ejb-name>
       <local-jndi-name>LoginSLHome</local-jndi-name>
      </session>
      


      In ejb-jar.xml
      <session>
       <ejb-name>LoginSLEJB</ejb-name>
       <local-home>beans.LoginSLHome</local-home>
       <local>beans.LoginSL</local>
       <ejb-class>beans.LoginSLBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      </session>
      


      I have made changes to the followinf files in Jboss i.e.

      1) default/conf/jboss-service.xml, changed to true for the following CallByValue (JNDI Configuration)
      2) default/deploy/ear-deployer.xml, changed to true for the following CallByValue
      3) Edit deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml , and changed Java2ClassLoadingCompilance and UseJbossWebLoader attributes as true

      Please help me to solve this problem.

      Thanks and Regards