1

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.

Configuration in ejb-jar.xml:

<session>
                     <ejb-name>BeanSL</ejb-name>
                     <home>com.project.ejb.BeanSLHome</home>
                     <remote>com.project.ejb.BeanSLIF</remote>
                     <ejb-class>com.project.ejb.BeanSL</ejb-class>
                     <session-type>Stateless</session-type>
                     <transaction-type>Container</transaction-type>
 </session>

server.log entry in Jboss for EJB registration of above mentioned class:

        java:global/ear/jarWithEJB/BeanSL!com.project.ejb.BeanSLIF
        java:app/dbdocejb/BeanSL!com.project.ejb.BeanSLIF
        java:module/BeanSL!com.project.ejb.BeanSLIF
        java:jboss/exported/ear/jarWithEJB/BeanSL!com.project.ejb.BeanSLIF
        java:global/ear/jarWithEJB/BeanSL!com.project.ejb.BeanSLHome
        java:app/dbdocejb/BeanSL!com.project.ejb.BeanSLHome
        java:module/BeanSL!com.project.ejb.BeanSLHome
        java:jboss/exported/ear/jarWithEJB/BeanSL!com.project.ejb.BeanSLHome

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.

0 Answers0