2 Replies Latest reply on Jan 28, 2008 2:02 AM by roulf

    Problem Retrieving Bean Locally

    roulf

      I've been using JBoss and retrieving beans for some time now successfully, but after taking a break from a project over summer and reinstalling JBoss on my new PC it is no longer working. If it makes a difference, I upgraded to Windows XP x64 edition and NetBeans 6.0, same JBoss version (4.2.2 GA)

      The specific error from JBoss is:

      13:29:00,524 INFO [STDOUT] An error occured : There was a problem while talking to 216.19.36.215:22


      I am attempting to access the bean locally and have tried using the -b 0.0.0.0 option, with no luck. I'm confused because the JBoss server is acknowledging the connection, but there is some sort of internal error that I am unaware of.

      Here is some of the code in quesion:
      public class ManagerClient {
      
       public static InitialContext INITIAL_CONTEXT = null;
      
       /**
       *Creates the ManagerClient with the provided URL to the Application Server
       *
       *@param providerURL URL of the JBoss Application Server
       *@throws NamingException If something goes wrong with the environement naming
       */
       public ManagerClient(String providerURL) throws NamingException {
      
       Properties env = new Properties();
      
       env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       env.put(Context.PROVIDER_URL, providerURL);
      
       try {
       ManagerClient.INITIAL_CONTEXT = new InitialContext(env);
       } catch (NamingException ex) {
       ex.printStackTrace();
       System.exit(1);
       }
       }
      
       /**
       * Sets the default location of the JBoss Application Server
       *
       * @throws NamingException If something goes wrong with the environment naming
       */
       public ManagerClient() throws NamingException {
       this("jnp://localhost:1099");
       }
      
      
       /**
       * Creates the ManagerClient environment, then starts the meat of the program
       * in the ManagerFrame.
       * @param args the command line arguments
       */
       public static void main(String[] args) {
      
       try {
       new ManagerClient();
       } catch (NamingException ex) {
       ex.printStackTrace();
       System.exit(1);
       }
      
       new ManagerFrame("Manager");
      
       }
      }


      and when I retrieve in the ManagerFrame,

      dbm = (DataBaseManager) ManagerClient.INITIAL_CONTEXT.lookup("ResourceGate-server/DataBaseManagerBean/remote");
       ssh = (SSHInterface) ManagerClient.INITIAL_CONTEXT.lookup("ResourceGate-server/SSHBean/remote");
       secureTransfer = (SecureFileTransfer) ManagerClient.INITIAL_CONTEXT.lookup("ResourceGate-server/SecureFileTransfer/remote");


      Thanks for any help you can provide -- I am trying to finish this project up for deployment this week and not being able to run it at all is frustrating :(.

        • 1. Re: Problem Retrieving Bean Locally
          jaikiran

          When does this error occur? Is it when you start JBoss or when you are doing the lookup? Can you post the entire exception stacktrace.

          • 2. Re: Problem Retrieving Bean Locally
            roulf

            I have to apologize, I made a very stupid mistake...

            The reason that error message didn't come on search engines up is because... Its my own exception it ;). Turns out that the cluster I was connecting to had its IP address changed and that was causing the error -- not JBoss. I updated the IP and everything is great now.

            Sorry to waste your time, a mod should delete this if possible! I have to add though, JBoss 4.2.2 was a breeze to configure compared to 4.0.4...