-
1. Re: Exception when creating ClassPathExtension with JSP
adrian.brock Apr 3, 2002 7:13 AM (in response to susan)The ClassPathExtension MBean assumes it is running
under an Mlet classloader.
This won't be the case for a JSP or an ejb
Wrap your code with the following:
try
{
...
}
catch (RuntimeMBeanException e)
{
e.getTargetException().printStackTrace();
}
I bet it reports a ClassCastException.
Regards,
Adrian -
2. Re: Exception when creating ClassPathExtension with JSP
susan Apr 3, 2002 8:31 AM (in response to susan)Hi!
Thanks for your reply!
So I can catch the Exception, but the problem is, that the MBean for ClassPathExtension isn't registered in the right way...
Normally there is an log-output "Added library: ...".
But this log output doesnt appear. And also the classpath isnt loaded.
With the HTML Adapter everything works fine. But with the application it doesnt work
Susan -
3. Re: Exception when creating ClassPathExtension with JSP
susan Apr 3, 2002 12:28 PM (in response to susan)Hi!
I changed the source from ClassPathExtension.java:
deleted line:
MLet mlet = (MLet)Thread.currentThread().getContextClassLoader();
and added the Method:
public void addURL(URL u) throws MalformedObjectNameException, InstanceNotFoundException,MBeanException,
ReflectionException
{
ArrayList servers = MBeanServerFactory.findMBeanServer(null);
if (servers == null)
{
System.out.println("No MBean Server found");
}
else
{
MBeanServer server=(MBeanServer)servers.get(0);
ObjectName mletObjectName=null;
mletObjectName = new ObjectName ("DefaultDomain:service=MLet");
Object[] params = new Object[]{u};
String[] signature = new String[]{"java.net.URL"};
server.invoke(mletObjectName, "addURL", params, signature);
}//else
}
And every "mlet.addURL(..)" I changed to "addURL(..)", whats calling the new "addURL(URL u)" method.
Now my application works fine...
Thanks
Susan