-
1. Re: TestClient error
adrian.brock Mar 28, 2002 6:24 AM (in response to angelawhelan)Hi,
I don't think that example works :-(
Somebody else reported the same problem a few weeks ago.
I've not had time to find out the problem.
Regards,
Adrian -
2. Re: TestClient error
angelawhelan Mar 28, 2002 6:38 AM (in response to angelawhelan)Thanks very much for your response Adrian, I can now stop wasting time trying to figure out why it doesn't work !!
I asked this question a little while ago, but, this still leaves me with the problem of not knowing how to connect to the JBoss JMX server via RMI, and be able to query the MBeans for information.
As I am new to JBoss, the other examples that people gave me, I found difficult to figure out exactly what to do.
Does anyone have some specific and simple Java code, which is suitable for newbies to JBoss, which connects via RMI to the JBoss JMX server, and querys the MBeans ?
Thanks very much for any help offered -
3. Re: TestClient error
adrian.brock Mar 28, 2002 9:16 AM (in response to angelawhelan)If I get some spare time this weekend, I'll try
to get the example to work.
Can't promise, I'll get any spare time though.
Regards,
Adrian -
4. Re: TestClient error
adrian.brock Mar 30, 2002 4:03 AM (in response to angelawhelan)Hi,
The problem with the example is easy to fix.
Section 5 should be
[pre]
Iterator lConnectors = (Iterator) lLocalServer.invoke(
lFactoryInstance.getObjectName(),
"getConnectors",
new Object[] {
lProperties,
lTester
},
new String[] {
lProperties.getClass().getName(),
- lTester.getClass().getName()
+ ConnectorFactoryImpl.IConnectorTester.getClass().getName()
}
);
[/pre]
Where - means remove the line
and + means add the line
Regards,
Adrian -
5. Re: TestClient error
angelawhelan Apr 2, 2002 3:52 AM (in response to angelawhelan)hi Adrian,
I've made that change to the code and I get the following error :
"TestClient.java": Error #: 308 : non-static method getClass() cannot be referenced from a static context at line 113, column 54
It seems some other changes need to be made that you may have forgotten to include...any ideas ?
Thanks for your help,
Angela -
6. Re: TestClient error
adrian.brock Apr 2, 2002 4:06 AM (in response to angelawhelan)Doh!
It should be .class.getName() of course.
Regards,
Adrian -
7. Re: TestClient error
angelawhelan Apr 2, 2002 5:41 AM (in response to angelawhelan)hi Adrian,
That worked, however, when I run the TestClient now, I get the following errors, any ideas ?
---------------------------------------------------------
Testing JMX Connector from client to server
===========================================
1. Instantiate local MBeanServer and add connector factory as first MBean to search your net
=> hit any key to proceed
ConnectorFactoryService.getObjectName(), server: com.sun.management.jmx.MBeanServerImpl@6e1408, object name: Factory:name=JMX, instance: Factory:name=JMX
Found Factory: DefaultDomain:name=ConnectorFactory
2. Lookup for all available connectors with the JNDI defined by jndi.properties
=> hit any key to proceed
log4j:ERROR No appenders could be found for category (org.jboss.jmx.client.ConnectorFactoryService).
log4j:ERROR Please initialize the log4j system properly.
javax.naming.ServiceUnavailableException: yourComputer. Root exception is java.net.UnknownHostException: yourComputer
at java.net.InetAddress.getAllByName0(InetAddress.java:571)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getByName(InetAddress.java:449)
at java.net.Socket.(Socket.java:100)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:102)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:776)
at org.jnp.interfaces.NamingContext.list(NamingContext.java:527)
at org.jnp.interfaces.NamingContext.list(NamingContext.java:520)
at javax.naming.InitialContext.list(InitialContext.java:390)
at org.jboss.jmx.client.ConnectorFactoryImpl.getConnectors(ConnectorFactoryImpl.java:71)
at org.jboss.jmx.client.ConnectorFactoryService.getConnectors(ConnectorFactoryService.java:55)
at java.lang.reflect.Method.invoke(Native Method)
List of all available connectors on your net
=========================================
3. Select your connector by entering its number
=> hit any key to proceed
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at jboss_test.TestClient.main(TestClient.java:103)
TestClient.main(), caught: java.util.NoSuchElementException
java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(AbstractList.java:423)
at jboss_test.TestClient.main(TestClient.java:138)
---------------------------------------------------------
Thanks very for any help on this,
Angela -
8. Re: TestClient error
adrian.brock Apr 2, 2002 6:08 AM (in response to angelawhelan)What do you have as your jndi.properties?
Looks like it cannot find the provider.
Regards,
Adrian -
9. Re: TestClient error
angelawhelan Apr 2, 2002 8:28 AM (in response to angelawhelan)hi Adrian,
The jndi.properties was the problem, I had one of the settings wrong, the example now works :D
Thanks very much for all your help !
Angela