S
Sundar
I have a requirement, I have to use the existing jar of websphere,
when my program is shipped. This program uses AdminClient of websphere
JMX. This has to run as a standalone. It installs an application using
JMX. What I require is to use URLCLassloader and load the adminclient,
objectname classes and use them. If I set classpath i am working fine,
but i do not have the luxury of that. Can I know how to use the
URLClassLoader.
A segment of my code looks like this.
AdminClient client;
Class createClass = loader.loadClass
("com.ibm.websphere.management.AdminClientFactory");
Class[] args=new Class[]{java.util.Properties.class};
Method create = createClass.getMethod("createAdminClient", args);
Object params[] = new Object[]{props};
Object obj= create.invoke((Object)"createAdminClient", params);
//works fine till this
client = (com.ibm.websphere.management.AdminClient)(obj); // casting
no success error.
String version = (client.getServerMBean()).getKeyProperty("version");
// this is my purpose.
Can anyone help me ? I am urgent schedule.
Thanks in advance,
sundar
when my program is shipped. This program uses AdminClient of websphere
JMX. This has to run as a standalone. It installs an application using
JMX. What I require is to use URLCLassloader and load the adminclient,
objectname classes and use them. If I set classpath i am working fine,
but i do not have the luxury of that. Can I know how to use the
URLClassLoader.
A segment of my code looks like this.
AdminClient client;
Class createClass = loader.loadClass
("com.ibm.websphere.management.AdminClientFactory");
Class[] args=new Class[]{java.util.Properties.class};
Method create = createClass.getMethod("createAdminClient", args);
Object params[] = new Object[]{props};
Object obj= create.invoke((Object)"createAdminClient", params);
//works fine till this
client = (com.ibm.websphere.management.AdminClient)(obj); // casting
no success error.
String version = (client.getServerMBean()).getKeyProperty("version");
// this is my purpose.
Can anyone help me ? I am urgent schedule.
Thanks in advance,
sundar