EJB lookup issue in JBoss EAP 7.2.8

Posted on

Hi All,
We have migrated our application from Weblogic to JBoss EAP 7.2.8 and now we are facing issue in JNDI lookup of remote interface.
EJB version is 2.1

Configuration in ejb-jar.xml:


Remote Interface: BeanSLIF
Home Interface: BeanSLHome
Class implementing Remote Interface: BeanSL

BeanSLIF beanSLIf  = null ; 
Properties p  = new Properties();
                      p.put(Context.INITIAL_CONTEXT_FACTORY, “org.wildfly.naming.client.WildFlyInitialContextFactory”);
                      p.put( Context.PROVIDER_URL, “http-remoting://localhost:8090” );
                     p.put(Context.SECURITY_PRINCIPAL, “jbossUser”); 
                      p.put(Context.SECURITY_CREDENTIALS, “jbossPassword”);
                      p.put("jboss.naming.client.ejb.context", "true");
                      ctx = new InitialContext( p );
beanSLIf = (BeanSLIF) ctx.lookup(“ejb:/ ear/jarWithEJB/BeanSL!com.project.ejb.BeanSLIF”);

On inspecting the above lookup code(cx.lookup(ejb:/...) code I am getting below ‘Proxy’:
Proxy for remote EJB StatelessEJBLocator for "/ear/jarWithEJB/BeanSL", view is interface com.project.ejb.BeanSLIF, affinity is None

And this further leads to:
com.sun.proxy.$Proxy39 cannot be cast to com.project.ejb.BeanSLIF

Any help would be really appreciated. Thanks in advance.