-
1. Re: Declare a dependency on an MC bean
alesj Sep 10, 2009 7:44 AM (in response to rnicholson10)I need more info.
Where do you put this @Depends?
"I have an ServiceBean" tells me nothing.
What type of service is this?
How is it deployed?
... -
2. Re: Declare a dependency on an MC bean
jaikiran Sep 10, 2009 7:50 AM (in response to rnicholson10)1) What does the import statement for @Depends look like (there is a @Depends annotaiton in MC as well as EJB3, so want to make sure you are using the correct one).
2) In that other post, you mentioned you are adding a @Depends on the HornetQServer like this:@Depends(value={"jboss.deployment:id=HornetQServer,type=Component"})
That's a MBean created for the deployment of the HornetQServer MC bean. I don't think, adding that dependency will work (although i am not sure).
From what you have been explaining, i guess you want this:@org.jboss.beans.metadata.api.annotations.Depends(value={"HornetQServer"})
By the way, on what component are you placing this dependency? EJB? And please post the complete exception stacktrace that you see. -
3. Re: Declare a dependency on an MC bean
jaikiran Sep 10, 2009 7:52 AM (in response to rnicholson10)Ah, too slow to click on submit! Did not see Ales' reply :)
-
4. Re: Declare a dependency on an MC bean
rnicholson10 Sep 10, 2009 8:04 AM (in response to rnicholson10)Apologies,
I was using a EJB3 Service Bean.
The solution by Jakiran works correctly and is as follows:@Service @Local(InputServiceBeanLocal.class) @Remote(InputServiceBeanRemote.class) @Management(InputServiceBeanManagement.class) @Depends(value={"HornetQServer"}) public class InputServiceBean implements InputServiceBeanLocal, InputServiceBeanRemote, InputServiceBeanManagement { ... }
How would you normally figure out what the correct name is for the MC Bean? Is it simply the id values of the component from the JMX console? -
5. Re: Declare a dependency on an MC bean
alesj Sep 10, 2009 10:07 AM (in response to rnicholson10)"jaikiran" wrote:
@Depends(value={"jboss.deployment:id=HornetQServer,type=Component"})
That's a MBean created for the deployment of the HornetQServer MC bean. I don't think, adding that dependency will work (although i am not sure).
No it wouldn't.
As this is only part of MBeanServer, and not of MC. -
6. Re: Declare a dependency on an MC bean
alesj Sep 10, 2009 10:10 AM (in response to rnicholson10)"rnicholson10" wrote:
How would you normally figure out what the correct name is for the MC Bean?
There are several ways:
* look into the -jboss-beans.xml file where this bean is defined --> its name attribute
* new admin-console
* Grapher tool -
7. Re: Declare a dependency on an MC bean
rnicholson10 Sep 10, 2009 10:26 AM (in response to rnicholson10)Ok, so I looked in the -jboss-beans.xml file but every bean defined has a name. It's not easy to figure out which is the one I'm looking for.
The new admin-console (which I'd never seen before), has absolutely no mention of HornetQServer, nor can I see any mention of micro-containers in the tree listing. Should it be there? -
8. Re: Declare a dependency on an MC bean
alesj Sep 10, 2009 11:03 AM (in response to rnicholson10)"rnicholson10" wrote:
Ok, so I looked in the -jboss-beans.xml file but every bean defined has a name. It's not easy to figure out which is the one I'm looking for.
In the worst case you can ask the HornetQ guys about the name. ;-)
If they happen use custom schema, I agree, it can be non-trivial. -
9. Re: Declare a dependency on an MC bean
rnicholson10 Sep 10, 2009 11:05 AM (in response to rnicholson10)I love it!
I'll let them know the solution and they can add it to their WIKI, it'll save others the hassle of the search.
Thanks a million,
R.