4 Replies Latest reply on Oct 27, 2004 7:38 AM by diripu

    Couldn't lookup

    diripu


      Couldn't get ManagementHome and getting exception "ejb not bound"...
      My program is like the below.

      -----------------------------------
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      props.put(Context.SECURITY_PRINCIPAL, "");
      props.put(Context.SECURITY_CREDENTIALS, "");
      try{
      InitialContext context= new InitialContext(props);
      Object o = context.lookup( "ejb/mgmt/MEJB" );
      ManagementHome home = (ManagementHome) PortableRemoteObject.narrow(o,ManagementHome.class);
      Management mejb = home.create();
      ObjectName searchpattern = new ObjectName(args[1]);
      Set managedObjects = mejb.queryNames(searchpattern,null);
      System.out.println( "Found " + managedObjects.size() + " matching Managed Objects.");
      }catch(Exception ee){
      System.out.println("Error: -> "+ee.getMessage());
      }
      ---------------------------------

      Pl. help me.

      Thanks

        • 1. Re: Couldn't lookup
          darranl

          Have a look at JNDI View from jmx-console to see what is bound. Were there any errors on deployment?

          Your question would be better in the beginners corner forum.

          • 2. Re: Couldn't lookup
            diripu

            Thanks
            Will post this in beginners corner forum.

            But the program i have written is correct ?

            I couldn't see any errors on deployment. Also i couldn't find this JNDI name in the JNDI-view .

            • 3. Re: Couldn't lookup
              robisz

              What version of JBoss?
              ejb/mgmt/MEJB exist only in 4.0

              • 4. Re: Couldn't lookup
                diripu

                I could resolve the problem.
                The problem was because I didn't deploy the ejb-management.jar .
                And by default its not being deployed in version 3.2.5 and 4.0.0.

                But in the prev. version of JBoss ie (3.0.8, 3.0.4) this application was being deployed by default.

                Thanks