2 Replies Latest reply on Dec 3, 2008 9:34 AM by meiners

    CommunicationException / ClassNotFoundException on lookup()

    meiners

      I develop a Swing Client, which by RMI a JBoss 4.0.5 (on Vista machine) accesses and services implements.

      Properties objProperties = new Properties();
      objProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      objProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
      objProperties.put(Context.PROVIDER_URL, "serverIPv4:2001" );
      javax.naming.InitialContext initial = new javax.naming.InitialContext(objProperties);
      NamingEnumeration ne=initial.list("");
      while(ne.hasMore()){
      System.out.println("Bind Objects :"+ne.next());
      }
      Object ref=initial.lookup("project_projectQ");
      


      An exception is thrown with the Swing Client on the Debian machine, here:
      initial.lookup("project_projectQ");
      The exception reads:
      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: project.query.projectQHome]
      (in this moment there is not one reaction in the server log of the JBoss (on Vista machine), also not in the Debug mode)

      The project.query.projectQHome is with us an interface in one project.ear, which is on the JBoss (the Vista machine) deployed.

      The interface project.query.projectQHome does not exist in the.jar file of the Swing Client.

      The Swing Client runs thus completely conflict-free on various Machinen, on which only one network entrance and jre 1.6.0 must be present.

      On the Debian machine all functionalities of the Swing Client normally, also an email dispatch run functioned smoothly, but the exception already becomes here with the attempt of initial.lookup("project_projectQ") thrown. All ports of the JBoss (on Vista machine) of the Debian machine are attainable and visible.

      Main question position:
      1. Why funtioniert initial.lookup("project_projectQ") not on the Debian machine?
      2. From where does the exception know the name of the interface project.query.projectQHome?
      3. Why can in the variable javax.naming.InitialContext initial = new javax.naming.InitialContext (objProperties); obviously existing information for the Naming object "project_projectQ" in initial.lookup("project_projectQ"); not to be used?


      Regards



        • 1. Re: CommunicationException / ClassNotFoundException on looku
          meiners

          The Swing Client runs without errors on any Windows machines (only jre 1.6.0 and network contact installs to the JBoss of the Vista machine).

          An exception is thrown with the Swing Client on the Debian machine, here:
          initial.lookup("project_projectQ");
          The exception reads:
          javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: project.query.projectQHome]

          The project.query.projectQHome is an interface in a file project.ear, which is on the JBoss (the Vista machine) deployed.

          package project.query;
          public interface projectQHome extends javax.ejb.EJBHome {
           public projectQ create() throws java.rmi.RemoteException, javax.ejb.CreateException;
          }
          


          If this interface in the .jar file of the Swing Client is merged, the functions run also on the Debian machine!!
          Why doesn't run the interface project.query.projectQHome from project.ear the JBoss on Debian machine? Are there Threads, which miss communication and/or the download of the interface run?



          • 2. Re: CommunicationException / ClassNotFoundException on looku
            meiners

            If the interface project.query.ProjectQHome is merged in the.jar file of the Swing Client,
            those of port 2001,2000 and 4444 are used.
            If this interface is not merged, those of port 2001,2000,4444 and 8083 are used.

            When starting of the JBoss the following is logged:

            08:47:05,244 INFO [WebService] Using RMI server codebase: http://MAINSERV:8083
            08:47:05,986 INFO [NamingService] Started jndi bootstrap jnpPort=2001, rmiPort=2000, backlog=50, bindAddress=/192.168.1.2, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076

            The WebService Using RMI server code base 8083 has here the attitude on MAINSERV.
            MAINSERV is the computer name of the Vista machine.

            In my opinion that could be the cause for the CommunicationException,
            there all Windows machines in the local network the computer 'MAINSERV' to reach (e.g. http://MAINSERV:8080/ for the starting side of the JBoss),
            the Debian distribution can so not, but only over the IP address http://192.168.1.2:8080/ for the starting side of the JBoss and http://192.168.1.2:8083/ for the WebService.

            I tried to change the codebase properties for run.bat of JBoss.
            The changes were also accepted according to JBoss for the WebService, e.g.:

            -Djava.rmi.server.codebase=http://192.168.1.2/
            -Djava.rmi.server.codebase=http://192.168.1.2:8083/

            Perhaps a possibility seems to be,
            but that does not function in such a way, because I probably set the wrong data over here.

            The local Windows machines throw then an exception, as before with the Debian machine:
            javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: project.query.ProjectQHome]