I made it depend on every EJB I have and it seems to work... if it is anything I noticed the SequenceBean that all the other beans rely on is now getting loaded before the MBean. Or maybe it's just a race condition.
Brian Macy David Jencks wrote: > If these are cmp2 beans with relationships between them it is possible that > the beans don't actually get started until the second bean in the > relationship is deployed. If so, adding depends on all beans in the > relationship to your mbean should work, although it's a bit messy. > > I don't have a good solution to starting ejbs in relationships, we've tried > various things and none seem quite right yet. > > Let us know whether or not this is/fixes the problem > > thanks > > david jencks > > On 2002.08.21 16:28:19 -0400 Brian Macy wrote: > >>Ok... I have an ejb.jar will all my EJBs and a service.sar with the >>mbean. >> >>The order isn't how us describe... it definitely does wait until the >>JNDI names of the EJBs are registered... >> >><...deployment stuff...> >>10:29:27,902 INFO [MainDeployer] Starting deployment of package: >>file:/opt/jboss-3.0.1/server/default/deploy/aa-service.sar >>10:29:27,976 INFO [MainDeployer] Deployed package: >>file:/opt/jboss-3.0.1/server/default/deploy/aa-service.sar >><...more deployment stuff...> >>10:29:33,970 INFO [MainDeployer] Starting deployment of package: >>file:/opt/jboss-3.0.1/server/default/deploy/company-ejb.jar >>10:29:35,144 INFO [EjbModule] Creating >>10:29:35,178 INFO [EjbModule] Deploying com/pany/Monitor >>10:29:35,476 INFO [EjbModule] Deploying com/pany/Alert >>10:29:35,511 INFO [EjbModule] Deploying com/pany/AlertGroup >>10:29:35,563 INFO [EjbModule] Deploying com/pany/AlertSource >>10:29:35,628 INFO [EjbModule] Deploying com/pany/Host >>10:29:35,669 INFO [EjbModule] Deploying com/pany/AlertEngine >>10:29:35,705 INFO [EjbModule] Deploying com/pany/Sequence >>10:29:35,919 INFO [AlertAggregator] Creating >>10:29:35,919 INFO [AlertAggregator] Created >>10:29:36,052 INFO [EjbModule] Created >>10:29:36,054 INFO [EjbModule] Starting >>10:29:37,409 INFO [AlertAggregator] Starting >>10:29:37,441 INFO [MainThread] Starting... >>10:29:37,491 ERROR [LogInterceptor] RuntimeException: >><...lots of exceptions related to the previous post...> >>10:29:40,464 INFO [com/pany/AlertGroup] Table 'alertgroup' already >>exists >>10:29:40,516 INFO [com/pany/Alert] Table 'alert' already exists >>10:29:40,571 INFO [com/pany/Monitor] Table 'monitor' already exists >>10:29:40,990 INFO [com/pany/AlertSource] Table 'alertsource' already >>exists >>10:29:41,075 INFO [EjbModule] Started >>10:29:41,076 INFO [MainDeployer] Deployed package: >>file:/opt/jboss-3.0.1/server/default/deploy/company-ejb.jar >><...more deployment stuff...> >> >> >>The mbean (AlertAggregator) startService() method calls methods on the >>AlertGroupHome remote EJB interface. Based on the "Table 'alertgroup' >>already exists" message and the content of the exceptions I can only >>guess that the EJB has not fully initialized. >> >>Basically I need a way to depend on the EJBs having been "deployed" and >>not "deploying" (at least that is my guess). I even tried depending on >>the ejb.jar file but it is "deploying" (and showing up in JNDI) before >>the EJBs themselves. >> >>Thanks for responding. I apologize if my answer doesn't directly address >>your question but this is my first stab at a j2ee project (let alone >>using JBoss). >> >>Brian Macy >> >> >>David Jencks wrote: >> >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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 > ------------------------------------------------------- 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