0 Replies Latest reply on Jun 19, 2014 4:33 PM by Igor Malinovskyy

    Troubles with lookup ejb bean inside other bean using session context.

    Igor Malinovskyy Newbie

      I manage succesefully to lookup remoteley beans using InvocationContext. I also manage succesefully to lookup bean using anotations. But when i tried to use sessionContext.lookup I have class cast exception. What I am doiing wrong?

      Code example:


      public class ZRepositoryBean implements ZRepository, ZLocalRepository {


        @PersistenceContext(unitName = "zert")

        private EntityManager manager;



        private SessionContext context;



        private ZLocalSecurityManager securityManager;



        private ZLocalQueryManager queryManager;


        private void invokeOtherBean() {

        Class cast exception

      ZOtherLocal other =




        //invokactio via ejb:// works good when i am not inside been or use it remotelly