0 Replies Latest reply on Mar 22, 2015 2:47 AM by sumanth.datta

    Jboss remote invocation gives error

    sumanth.datta

      Hi All ,

       

       

      I have been successful in implementing Messaging , but when it came to ejb session bean invocation from a remote client i am struggling .

       

      I get the following error

       

      SEVERE: null

      javax.naming.NamingException: Failed to create proxy [Root exception is java.lang.IllegalStateException: EJBCLIENT000024: No EJB receiver available for handling [appName:EjbSessionBeans, moduleName:EjbSessionBeans-ejb, distinctName:] combination]

        at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:195)

        at org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:176)

       

       

      Iam developing the project in netbeans , When i deploy the ejb in jboss i get the log .

       

      java:global/EjbSessionBeans/EjbSessionBeans-ejb/MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote

      java:app/EjbSessionBeans-ejb/MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote

      java:module/MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote

      java:jboss/exported/EjbSessionBeans/EjbSessionBeans-ejb/MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote

      java:global/EjbSessionBeans/EjbSessionBeans-ejb/MySessionBean

      java:app/EjbSessionBeans-ejb/MySessionBean

      java:module/MySessionBean

       

       

      Following is my code

       

      Hashtable SessionBeanServerDetails=new Hashtable();

               

                SessionBeanServerDetails.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");

               

                SessionBeanServerDetails.put(Context.PROVIDER_URL,"remote://localhost:4447");

               

                SessionBeanServerDetails.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");

               

                SessionBeanServerDetails.put("jboss.naming.client.ejb.context", true);

               

                SessionBeanServerDetails.put(Context.SECURITY_PRINCIPAL,"admin");

               

                SessionBeanServerDetails.put(Context.SECURITY_CREDENTIALS,"kony1234");

             

               

              try {

                 InitialContext serverContext=new InitialContext(SessionBeanServerDetails);

                 

                 MySessionBeanRemote msbr= (MySessionBeanRemote) serverContext.lookup("ejb:EjbSessionBeans/EjbSessionBeans-ejb//MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote?stateful");

                 

                 msbr.sum(10,10);

                

                 msbr.subtract(100,90);

                

                 serverContext.close();

                

                

              } catch (NamingException ex) {

                  Logger.getLogger(MySessionBeans.class.getName()).log(Level.SEVERE, null, ex);

              }

       

       

      When i remove 

        SessionBeanServerDetails.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");

               

         SessionBeanServerDetails.put("jboss.naming.client.ejb.context", true);

       

      I get javax.naming.NameNotFoundException: ejb:EjbSessionBeans/EjbSessionBeans-ejb//MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote?stateful -- service jboss.naming.context.java.jboss.exported.ejb:EjbSessionBeans.EjbSessionBeans-ejb."MySessionBean!com.Kony.SessionBeans.MySessionBeanRemote?stateful"

       

       

       

      Thanks in Advance

       

      Regards

       

       

      Sumanth