MBean depends on ExternalContext ?
nusa Apr 22, 2004 5:20 PMHi all,
Is it possible a MBean depends on ExternalContext ?
I have a MBean which depends on ExternalContext, defined in my jboss-service.xml, as shown below :
<!-- | ExtJNDIManager MBean --> <mbean code="example.jmx.ExtJNDIManager" name="nusa:service=ExtJNDIManager"> <depends>jboss.jndi:service=ExternalContext</depends> </mbean>
The ExternalContext MBean is setup in /default/deploy/user_service.xml as :
<mbean code="org.jboss.naming.ExternalContext" name="jboss.jndi:service=ExternalContext,jndiName=external/JNDI" > <attribute name="JndiName">external/JNDI</attribute> <attribute name="Properties">/conf/extjndi.properties</attribute> <attribute name="InitialContext">javax.naming.directory.InitialDirContext</attribute> </mbean>
The Properties file ( in /default/conf ) is look like this :
java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url=file:///usr/local
And the structue of my sar is :
META-INF/
META-INF/MANIFEST.MF
example/
example/jmx/
example/jmx/ExtJNDIManager.class
example/jmx/ExtJNDIManagerMBean.class
META-INF/jboss-service.xml
When I deploy my sar, I got an Incomplete Deployment error :
...
[org.jboss.management.j2ee.factory.ServiceModuleFactory] Create MBean, name:
nusa:service=ExtJNDIManager, SAR Module:
jboss.management.local:J2EEServer=Local,j2eeType=ServiceModule,name=ExtJNDI.
sar 15:33:02,505 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: ExtJNDI.sar 15:33:02,505 DEBUG [org.jboss.deployment.MainDeployer] Deployed package:
file:/C:/Java/Software/jboss-3.2.4RC2/server/default/deploy/ExtJNDI.sar
15:33:02,505 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for:
file:/C:/Java/Software/jboss-3.2.4RC2/server/default/deploy/ExtJNDI.sar -> file:/C:/Java/Software/jboss-3.2.4RC2/server/default/deploy/ExtJNDI.sar
15:33:02,505 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner]
Incomplete Deployment listing:
MBeans waiting for other MBeans:
ObjectName: nusa:service=ExtJNDIManager
state: CONFIGURED
I Depend On: jboss.jndi:service=ExternalContext
Depends On Me:
MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.jndi:service=ExternalContext
state: NOTYETINSTALLED
I Depend On:
Depends On Me: nusa:service=ExtJNDIManager
The code for ExtJNDIManager is shown below :
public class ExtJNDIManager extends ServiceMBeanSupport implements ExtJNDIManagerMBean {
/**
*
*/
public ExtJNDIManager() {
log.info("=== ExtJNDIManager.Constructor ...");
}
/**
*
*/
public void startService() throws Exception {
log.info("=== ExtJNDIManager.startService()");
}
/**
*
*/
public void stopService() throws Exception {
log.info("=== ExtJNDIManager.stopService()");
}
}
The startService() is never called, only constructor().
What's wrong with my sar ? What am I missing ?
Why startService() never get called ?
Thanks for any help,
nusa