3 Replies Latest reply on Apr 25, 2013 8:31 AM by karthimadu

    Failed to create remoting connection

    karthimadu

      Good Day!

      I am doing migration from glassfish to JBoss 7.1.3 . I have .ear application which fails to create remoting connection.I guess having problem with my EJB.

      Below is my EJB that deployed (From server log)

      10:10:56,226 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named GGICache in deployment unit subdeployment "GGI-ejb.jar" of deployment "GGI.ear" are as follows:

       

          java:global/GGI/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheHome

          java:app/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheHome

          java:module/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheHome

          java:jboss/exported/GGI/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheHome

          java:global/GGI/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheRemote

          java:app/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheRemote

          java:module/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheRemote

          java:jboss/exported/GGI/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheRemote

       

      10:10:56,268 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named GGIDBOperation in deployment unit subdeployment "GGI-ejb.jar" of deployment "GGI.ear" are as follows:

       

          java:global/GGI/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationHome

          java:app/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationHome

          java:module/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationHome

          java:jboss/exported/GGI/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationHome

          java:global/GGI/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationRemote

          java:app/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationRemote

          java:module/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationRemote

          java:jboss/exported/GGI/GGI-ejb/GGIDBOperation!ge.nbsm.weGGI.ejb.DBOperation.GGIDBOperationRemote

       

       

      Below is my context lookup from my ResoureLocator.java code

       

      Properties jndiProps = new Properties();

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

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

              jndiProps.put(Context.SECURITY_CREDENTIALS, "adminadmin");

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

              jndiProps.put(Context.PROVIDER_URL, "remote://localhost:4447");
        jndiProps.put("jboss.naming.client.ejb.context", true);

      try{


      ctx = new InitialContext(jndiProps);

      String strDSName = "java:jboss/datasources/Functional_GGI_CONNECTION_POOL";

                   ctx = new InitialContext();

       

                  DataSource ds = (DataSource) ctx.lookup(strDSName);

                  System.out.println("Context Look Up success>>" + ds.getClass());

                  return ds;

              } catch (NamingException namingException) {

                 

                  log.error(namingException.getMessage(), namingException);

      }

       

      I have attached my server.log and my application log for your reference. I am getting error like Failed to create remoting connection. I have problem in loading the intial conext with the above properties


      ctx = new InitialContext(jndiProps);

       


        • 1. Re: Failed to create remoting connection
          wdfink

          I'm not sure what you asking about.

          First part show how your EJB is deployed, but the lookup looks like a datasource, which is not possible if the client is remote btw.

           

          Could you explain what you want to achieve?

          • 2. Re: Failed to create remoting connection
            karthimadu

            Thank you for your reply..

             

            Yes you are right in first part I am doing JNDI Look up in ResourceLocator.java you can see in my server log

            12:26:14,207 ERROR [stderr] (MSC service thread 1-2) at ge.nbsm.weGGI.common.utility.ResourceLocator.lookUP(ResourceLocator.java:68)

             

            that line ResourceLocator.java:68 in my code is  ctx = new InitialContext(jndiProps); What is wrong in my properties that i have configured for JBoss?

             

            If i commented jndiProps.put("jboss.naming.client.ejb.context", true); i am not getting the above error. Instead i am getting error while creating javax.rmi.PortableRemoteObject .you can see below lines in my log

             

            12:26:13,971 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/GGI]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class

            ge.nbsm.weGGI.common.utility.GGILifeCycleListener: java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:global, moduleName:GGI, distinctName:GGI-ejb] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@d4d727

                at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:588) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.11.Final-redhat-1.jar:1.0.11.Final-redhat-1]

                at com.sun.proxy.$Proxy30.create(Unknown Source)

                at ge.nbsm.weGGI.Delegate.CacherDelegate.getGGICacheManagerRemote(CacherDelegate.java:81) [classes:]

                at ge.nbsm.weGGI.Delegate.CacherDelegate.getCacheValues(CacherDelegate.java:41) [classes:]

                at ge.nbsm.weGGI.common.utility.StartupCacher.loadCache(StartupCacher.java:49) [classes:]

                at ge.nbsm.weGGI.common.utility.GGILifeCycleListener.contextInitialized(GGILifeCycleListener.java:75) [classes:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.17.Final-redhat-1.jar:]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.17.Final-redhat-1.jar:]

             

            You can see in log at ge.nbsm.weGGI.Delegate.CacherDelegate.getGGICacheManagerRemote(CacherDelegate.java:81) [classes:] creating problem. . I am trying to create portableObject at line 81.Below is my code

                      Context ctx = new InitialContext();

                                   String cacheHome="ejb:global/GGI/GGI-ejb/GGICache!ge.nbsm.weGGI.ejb.cache.GGICacheHome";

                        log.debug("getGGICacheManagerRemote:1");

             

                                     Object obj = ctx.lookup( cacheHome);

                               log.debug("getGGICacheManagerRemote:1a");

                        GGICacheHome homeObject = (GGICacheHome) javax.rmi.PortableRemoteObject

                                .narrow(obj, GGICacheHome.class);

                           ggiManager = homeObject.create();

             

            I am getting error like Failed to connect remoting connection while trying to create Remote Connction at this line    ggiManager = homeObject.create(); ..

            Sorry if you are not able to understand what i am trying to do...I am new to JBoss ..I am trying CacheLoading mechanism in my apllication ..That is currently woking fine in Glassfish

            • 3. Re: Failed to create remoting connection
              karthimadu

              I have solved this issue by  removing properties to initialized context While doing datasource look up . Properties added while doing EJB Cache Remote look up. I have added anotations in my EJB session bean and EJB Remote and changed my above code due to class cast exception in JBoss javax.rmi.PortableRemoteObject .

               

              Many thanks to all..

               

              Below is my Datasource Look up

               

              try {

              ctx = new InitialContext();

                            String strDSName = "java:jboss/datasources/Functional_GGI_CONNECTION_POOL";
                           ctx = new InitialContext();

                          DataSource ds = (DataSource) ctx.lookup(strDSName);
                           return ds;

              }catch (NamingException e){

              }

               

              Below is my EJB remote context look up


                                      Properties prop =new Properties();
                                      prop.put("java.naming.factory.url.pkgs", "org.jboss.ejb.client.naming");
                                     Context ctx = new InitialContext(prop);
                                      String cacheHome="ejb:GGI/GGI-ejb/GGICacheBean!ge.nbsm.weGGI.ejb.cache.GGICacheRemote";

                                          ggiManager = (GGICacheRemote)ctx.lookup( cacheHome);

               

              Below is my CacheBean.java(Anotations included)

              @Stateless
              @Remote(GGICacheRemote.class)
              @TransactionManagement(TransactionManagementType.BEAN)
              public class GGICacheBean implements GGICacheRemote, SessionBean {

               

              Below is my CacheRemote.java(Anotations included)

              @Remote
              public interface GGICacheRemote extends EJBObject {

              public GGICacheVO getCacheValues() throws Exception, RemoteException;

              }

              I have removed my jboss-ejb3.xml and ejb-jar.xml .

              My application is working fine ..