1 Reply Latest reply on Sep 12, 2005 2:17 PM by Jason Brown

    JBoss Eclipse IDE tutorial

    Jason Brown Newbie

      Hello, has anyone tried the tutorial from this site that shows you how to create and deply a simple EAR (ejb + servlet) to JBoss via the Eclipse IDE ?

      It all seems to work fine for me apart from where the servlet looks up the home object for the EJB in the init() method.

      I get a ClassCast Exception on the 3rd line below

      Context context = new InitialContext();
      Object ref = context.lookup("java:comp/env/ejb/Fibo");
      home = (FiboHome)PortableRemoteObject.narrow(ref, FiboHome.class);

      on the last line above - the entries in the xml deployment desciptors look fine

      web.xml...

      <ejb-ref >
      <![CDATA[Reference to the Fibo EJB]]>
      <ejb-ref-name>ejb/Fibo</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      tutorial.interfaces.FiboHome
      tutorial.interfaces.Fibo
      </ejb-ref>

      jboss-web.xml...

      <ejb-ref>
      <ejb-ref-name>ejb/Fibo</ejb-ref-name>
      <jndi-name>ejb/Fibo</jndi-name>
      </ejb-ref>

      the JNDI name is ejb/Fibo (from the jboss,xml) so I can't see the problem.

      Can anyone help ?