-
1. Re: Set additional classpath for my own MBeanResourceCompone
mazz Apr 23, 2009 11:16 PM (in response to jim.ma)First, I believe you must package your third-party or custom classes into .jar files (you cannot put .class files directly in the plugin's lib directory).
To learn how to use the additional class path entries property, see these:
http://management-platform.blogspot.com/2008/11/monitoring-hibernate-with-jopr.html
http://support.rhq-project.org/display/RHQ/Plugins+-+Demos+-+Monitoring+Hibernate
http://jira.rhq-project.org/browse/RHQ-1094
Because your service is injected directly in a JBossAS server, I'm wondering if we'll need to do something extra. The connection properties that you use to connect to JBossAS are different than those when connecting to a generic VM. I'm thinking we might need to add the ability to add additional classpath entries to JBossAS connection properties. Its late and I can't think straight :) read those URLs above and see if you can do the same. I'm not sure if you can tell the JBoss plugin to add arbitrary jars to the classpath of the EMS connection today, but if you can't it shouldn't be hard to add another plugin-configuration simple-property to the jboss plugin rhq-plugin.xml descriptor to enable this. -
2. Re: Set additional classpath for my own MBeanResourceCompone
jim.ma Apr 24, 2009 2:40 AM (in response to jim.ma)Thanks for your quick reply, Mazz.
So far there is no code to handle adding classpath entry to EMSconnection in jboss plugin, so it looks like we can not enable it by adding a simple-property in rhq-plugin.xml .
When we add the adding classpath entry function to jboss plugin , how can we enable EMSConnection to load a class in a nested jar (in the custom jar file packaged in plugin) ? At present whether ChilldFirstClassLoader or URLClassLoader working with EmsConnection can not load this kind of class . Is it possible to set the current plugin classloader to EmsConnection dynamically before retrieve the MyValue object through jmx? -
3. Re: Set additional classpath for my own MBeanResourceCompone
ghinkle Apr 24, 2009 4:11 AM (in response to jim.ma)If you need custom connection properties and classes you can build your own EMS connection rather than trying to use the parent plugin component's. You should be able to use the AS plugin as an example of how to do that.
After connectionFactory.discoverServerClasses is run you can add jar paths to the ConnectionSettings classPathEntries
-Greg