This content has been marked as final.
Show 8 replies
-
1. Re: Getting an
vickyk Oct 4, 2005 6:50 AM (in response to sdwood)Why is there space in "jboss.mq.destination :name=THRequest" , remove that and check the results ?
Vicky -
2. Re: Getting an
sdwood Oct 4, 2005 6:58 AM (in response to sdwood)Still getting the same error :(
-
3. Re: Getting an
darranl Oct 4, 2005 7:13 AM (in response to sdwood)There is a bit missing from your name, the following works fine on 4.0.2
Properties props = new Properties(); props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099"); InitialContext ctx = new InitialContext(props); RMIAdaptor server = (RMIAdaptor) ctx.lookup("jmx/invoker/RMIAdaptor"); ObjectName name = new ObjectName("jboss.mq.destination:name=A,service=Queue"); // error happens here.. System.out.println(server.getAttribute(name, "JNDIName"));
-
4. Re: Getting an
sdwood Oct 4, 2005 7:36 AM (in response to sdwood)Properties props = new Properties(); props.setProperty( Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.setProperty(Context.PROVIDER_URL, "jnp://ifdevdoc2:6999"); InitialContext ctx = new InitialContext(props); RMIAdaptor server = (RMIAdaptor) ctx.lookup("jmx/invoker/RMIAdaptor"); ObjectName name = new ObjectName("jboss.mq.destination:name=THRequest,service=Queue"); //error here System.out.println(server.getAttribute(name, "JNDIName"));
I still get the same error. We're using JBoss 3.2.3 here, it may also be of note that if I try a method with no parameters e.g. "getDefaultDomain" it works fine. Using reflection determines that "getAttribute" has two parameters as well... -
5. Re: Getting an
vickyk Oct 4, 2005 7:41 AM (in response to sdwood)try using
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
throws InstanceNotFoundException, MBeanException, ReflectionException, IOException;
Vicky -
6. Re: Getting an
vickyk Oct 4, 2005 7:53 AM (in response to sdwood)getAttribute Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IOExceptionGets the value of a specific attribute of a named MBean. The MBean is identified by its object name. Parameters: name - The object name of the MBean from which the attribute is to be retrieved. attribute - A String specifying the name of the attribute to be retrieved. Returns: The value of the retrieved attribute. Throws: AttributeNotFoundException - The attribute specified is not accessible in the MBean. MBeanException - Wraps an exception thrown by the MBean's getter. InstanceNotFoundException - The MBean specified is not registered in the MBean server. ReflectionException - Wraps a java.lang.Exception thrown when trying to invoke the setter. RuntimeOperationsException - Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or the attribute in parameter is null. IOException - A communication problem occurred when talking to the MBean server. See Also: setAttribute(javax.management.ObjectName, javax.management.Attribute)
Emphasis on the underlined part to get the actual cause of the error you are getting .
Vicky -
7. Re: Getting an
sdwood Oct 4, 2005 7:59 AM (in response to sdwood)Thanks for all your help ! Using that last suggestion I got an error that enabled me to find out it was due to having the wrong version of the javax.management classes on my client side.
many thanks,
Steve. -
8. Re: Getting an
darranl Oct 4, 2005 8:03 AM (in response to sdwood)I have just tested the code I posted and it also works fine against 3.2.3.