ear and mbeans
vishalsant Jun 20, 2002 5:25 PMhi,
i am trying to deploy an ear file which has a war file
whose servlet's init method is the one creating the Mbeanserver
MBeanServer server = MBeanServerFactory.createMBeanServer( "ResourceAdmin" );
The need of this approach is a desire to bring up mbeans
from within an ear file rather than making jboss.jcml entries and thus make the proces of deploying mbeans dynamic without the need of a server bounce.
One would assume that ear classloader would load the bean
classes required which does not seem to be the case .
i could for example using reflection instantiate the mbean
class without exception .
As soon as i hit
server.createMBean( resourceAdminClassName, resourceAdmin );
i get this exception
----------------------------------------------------------
javax.management.ReflectionException: The MBean class could not be loaded by the
default loader repository
at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.ja
va:367)
at com.gallup.g.servlets.StartupServlet.init(StartupServlet.java:102)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:916)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:80
8)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3266)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
395)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:78
5)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.createWebContext(Emb
eddedCatalinaServiceSX.java:298)
at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.performDeploy(Embedd
edCatalinaServiceSX.java:223)
at org.jboss.web.AbstractWebContainer.deploy(AbstractWebContainer.java:2
11)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
28)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:505)
at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:
459)
at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
28)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103
)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
28)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(Conf
igurationService.java:967)
at $Proxy0.start(Unknown Source)
at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
28)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.Main.(Main.java:208)
at org.jboss.Main$1.run(Main.java:110)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.Main.main(Main.java:106)
_________________________________________________________
Is their a classloader defined within Jboss that would
only pick up jar files in lib/ext as far as loading
MBeans is concerned .
Though the server is retrieved from the MbeanServerfactory.
NOTE:- if i add the jar file containing the Mbean classes
in lib/ext it works fine .
If any body could shed some light on this i'll be delighted
vishal