The depends mechanism only has an effect on mbeans that implement the jboss
service lifecycle, usually by subclassing ServiceMBeanSupport.  The depends
contract is that create (or createService from ServiceMBeanSupport) will be
called after all the "depends" mbeans are created and that start (or
startService) will be called after all the "depends" mbeans are started.

Your mbean will be instantiated as soon as its configuration is
encountered, unless its class is missing.

Is this consistent with what you are seeing?

david jencks

On 2002.08.21 15:13:02 -0400 Brian Macy wrote:
> This problem is perplexing me. I have an MBean that depends on 2 EJBs as 
> noted but this *-service.xml (it's in a sar):
> 
> <server>
> <mbean code="com.pany.aggregator.AlertAggregator" 
> name=":service=AlertAggregator">
> <attribute name="JndiName">AlertAggregator</attribute>
> <depends>jboss.j2ee:service=EJB,jndiName=com/pany/AlertGroup</depends>
> <depends>jboss.j2ee:service=EJB,jndiName=com/pany/AlertEngine</depends>
> </mbean>
> </server>
> 
> As soon as the MBean is deployed it starts attempting to use the EJBs it 
> depends on. The problem is the EJBs are "deployed" before they are ready 
> to be used... they haven't even checked to see if their associate DB 
> tables (they are CMPs) exist. So as soon as I try to use AlertGroup I
> get:
> 
> 10:29:37,491 ERROR [LogInterceptor] RuntimeException:
> java.lang.NullPointerException
> at 
> 
>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:513)
> at 
> 
>org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
> at 
> 
>org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
> at 
> org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
> at 
> org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:209)
> at 
> 
>org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:76)
> at 
> org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
> at 
> 
>org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
> at 
> 
>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
> at 
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
> at 
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
> at 
> org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
> at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
> at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
> at 
> 
>org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
> at 
> org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
> at $Proxy30.findByName(Unknown Source)
> at com.pany.aggregator.AlertAggregator.startService(AlertAggregator.java:85)
> at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:164)
> 
> 
> Once the EJBs completely deploy completely the thing starts working but 
> I have some code that needs to execute once when the MBean starts up. 
> Any help would be appreciated.... this is highly annoying.
> 
> Brian Macy
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to