0 Replies Latest reply on Nov 15, 2006 7:14 AM by isotope1145

    EntityContext ClassCastException when calling EJB 2.0 bean i

    isotope1145 Newbie

      Using an EJB 3.0 stateless session bean I am unable to call EJB 2.0 entity beans across isolated .ears:
      - I am running JBoss 4.0.4
      - I have two isolated ears: ejb3.ear is written to the EJB 3.0 spec, ejb2.ear which is a legacy ear written against the EJB 2.0 spec.
      - A stateless session bean in ejb3.ear calls findByPrimaryKey on an entity bean in ejb2.ear.
      - A ClassCastException occurs when I attempt to access the EntityContext in the ejb2.ear entity bean.

      Upon debugging the ejb2.ear entity bean, the EntityContext class loader url indicates that it was loaded by the ejb3.ear class loader. This does not seem correct.

      I have carefully followed the instructions in "Accessing EJBS in isolated ears" in

      Calls between EJB 3.0 beans across two isolated ears work fine.