6 Replies Latest reply on Nov 3, 2012 7:16 AM by katerchen0815

    JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server

    katerchen0815

      Hello,

      we have an Web Start application using JBoss. The client application works fine with JBoss 4.2.3.GA but throws Exception using JBoss 6. We use a code sniplet to invoke a bean home interface:

       

      try
              {
                  writeLog("connectionStr:", connectionStr);
                  writeLog("jndiName:", jndiName);
                  
                  EJBHome home = getHome(connectionStr, jndiName, homeClass);
                  writeLog("Home", "ok");
                  writeLog("Home", home.toString());
                  Method createMethod = homeClass.getMethod("create", (Class[])null);
                  writeLog("createMethod", "ok");
                  writeLog("createdMethod ", createMethod.toString());
                  
                  Object bean = createMethod.invoke(home, (Object[])null);
                  writeLog("bean", "ok");
                  // sessionCache.put(jndiName, bean);
                  return bean;
                  // }
                  // return sessionCache.get(jndiName);
              }
              catch (ILServiceLocatorException e)
              {
                  writeLog("bean", e.getMessage());
                  throw e;
              }
              catch (Exception ex)
              {
                  writeLog("Exception type", ex.toString());
                  PrintWriter pw = null;
                  try 
                  {
                      pw = new PrintWriter(new FileWriter("c:\\test\\properties.txt", true));
                      ex.printStackTrace(pw);
                      pw.flush();
                      pw.close();
                  } 
                  catch (IOException e) 
                  {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                  throw new ILServiceLocatorException(
                          getMessageString("ErrorCreateBusinessDelegate.001"), ex);
              }
      

       

       

      As a result we will get:

      --- JBoss 4.2.3.GA ---

       

      Okt 25,2012 15:26 - connectionStr:: jnp://192.168.16.220:10000

      Okt 25,2012 15:26 - jndiName:: ILUserAuthentication

      Okt 25,2012 15:26 - Home: ok

      Okt 25,2012 15:26 - Home: ILUserAuthenticationHome

      Okt 25,2012 15:26 - createMethod: ok

      Okt 25,2012 15:26 - createdMethod : public abstract com.identalink.bpauth.ILUserAuthentication com.identalink.bpauth.ILUserAuthenticationHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException

      Okt 25,2012 15:26 - bean: ok

       

       

      --- JBoss 6.1.Final ---

       

      Okt 25,2012 15:50 - connectionStr:: jnp://192.168.16.220:10000

      Okt 25,2012 15:50 - jndiName:: ILUserAuthentication

      Okt 25,2012 15:51 - Home: ok

      Okt 25,2012 15:51 - Home: ILUserAuthenticationHome

      Okt 25,2012 15:51 - createMethod: ok

      Okt 25,2012 15:51 - createdMethod : public abstract com.identalink.bpauth.ILUserAuthentication com.identalink.bpauth.ILUserAuthenticationHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException

      Okt 25,2012 15:51 - Exception type: java.lang.reflect.InvocationTargetException

      java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at com.identalink.utils.ILServiceLocator.getSessionBean(ILServiceLocator.java:283)

          ... 43 more

       

      Caused by: java.lang.Exception: Can not make remoting client invocation due to not being connected to server.

          at org.jboss.remoting.Client.invoke(Client.java:2075)

          at org.jboss.remoting.Client.invoke(Client.java:879)

          at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:184)

          at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)

          at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)

          at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

          at org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)

          at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)

          at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)

          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)

          ... 44 more

       

      We think it has something to do of changes on jboss-remoting.jar.

       

      How can we solve the problem?

       

      Thank you for your help

      Volker

        • 1. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
          ron_sigal

          Hi Volker,

           

          I really don't know what is happening here.  The message "Can not make remoting client invocation due to not being connected to server" means that the user of org.jboss.remoting.Client didn't call Client.connect(), but that should have happened in org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.init().   Do you see anything in the logs that indicates that the creation of the Client failed? 

           

          UnifiedInvokerProxy isn't part of Remoting.  It's actually in the JBoss AS codebase.  More importantly, the EJB2 code, which is using UnifiedInvokerProxy, is also in the AS codebase.   It might be worth posting the question in the AS forum.

           

          -Ron

          • 2. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
            katerchen0815

            Hi Ron,

            sorry for the delay. I took a day of.

             

            I do not see a hint inside the logs indication that creation of the client fails. Ther is only an info saying the jnlp resource is returned. Just for completeness I added the logs and the ejb related xml files. All information about other beans in the files are removed. Would you like to see the jnlp as well?

             

            I am convinced I am doing something wrong, but what?

             

            As you suggest I will also open anew discussion on the AS forum.

             

            Thank you for your help and patient.

            Volker

            • 3. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
              ron_sigal

              Hi Volker,

               

              Re: "Would you like to see the jnlp as well?"

               

              I don't know anything about Web Start, so I wouldn't know what I'm looking at. 

               

              Good luck with this problem.

               

              -Ron

              • 4. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
                katerchen0815

                Hi Ron,

                the jnlp defines security rules for using the application. More important is the list of external jars to be used. Before JBoss 5 it was quite easy. Simply load the jbossall-client.jar and some libraries for JAAS and XML. From JBoss 5 onwards jbossall-client.jar does not longer exist as such. So I have had to run the application and wait for JAVA messages to find all missing classes. Then simply add the missing jar containing the classes and do start the application again until no more missing jars are detected. Would it be possible that I used a "wrong" jar? There are no more missing classes detected.

                 

                Have a nice time

                Volker

                • 5. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
                  ron_sigal

                  Hi Volker,

                   

                  re: "Would it be possible that I used a "wrong" jar?"

                   

                  I can tell you that if you turn on DEBUG level logging for org.jboss.remoting, you will see the Remoting version that is being loaded, something like

                   

                    [13:57:08,280] [main] DEBUG (Logger.java:228) - Remoting version: 2.5.4.SP4 (Flounder)

                   

                  You should also see something like

                   

                    [13:57:08,489] [main] DEBUG (Logger.java:228) - Client[970481529:3j001-2i24b0-h8yt4qq7-1-h8yt4qrt-3].connect(null)

                   

                  which indicates that Client.connect() has been called.

                   

                  I can't tell you much about the other jars.

                   

                  -Ron

                  1 of 1 people found this helpful
                  • 6. Re: JBoss 4 to JBoss 6 - remoting client invocation - Exception due to not being connected to server
                    katerchen0815

                    Hi Ron,

                     

                    sorry for the delay. I have solved the connection problem with your help!

                     

                    Absolutely frustrated I decided to redo the list of dependent jars. JBoss tattletale works like a charm on my problem. In combination with DEBUG level for org.jboss.remoting and some debug messages inside the source all jars have been identified. Now the home interfaces of the beans are returned correctly. For the moment a message about missing user properties is displayed but this is another story. I have to check the configurations. This is not too easy for me. There are many changes between JBoss 4 and 6 and I am a JBoss novice.

                     

                    Thanks again for your help.

                     

                    Have a great time

                    Volker