[jboss-user] [Beginners Corner] - Limited-scope Client classpath?

rob.stryker@jboss.com do-not-reply at jboss.com
Thu Jun 28 12:10:46 EDT 2007


Hi... I'm trying to use JMX to get a value / attribute, specifically something like using twiddle to get 

get "jboss.system:type=Server" Started

I'm having problems even getting an initial context properly.  I'm wondering what's the limited number of jars I'd need to get the following to work. I don't want to include jbossall-client, for example.

	public static void main(String[] args) {
		InitialContext ctx;
        Properties props = new Properties(System.getProperties());
        props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
        props.put("java.naming.provider.url","jnp://localhost:1099");
        props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
        try {
	        ctx = new InitialContext(props);
	        Object obj = ctx.lookup("jmx/invoker/RMIAdaptor");
	        ctx.close();
	        System.out.println(obj);
        } catch( NamingException ne ) {
        	ne.printStackTrace();
        }
	}

If I include jbossall-client on the classpath, it works fine.   But if I only include jnp-client.jar, I get missing classes for jboss Logging. 

Any advice on using JMX in this fashion will be appreciated. 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058832#4058832

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058832



More information about the jboss-user mailing list