4

I'm using MBean in Jboss 7. Mbean need to call some EJBs at startup, but I cannot control ordering of startup EJBs and MBeans. In Jboss 4, I can do that by befine MBean in jboss-service.xml with depends tag. But in Jboss 7 this way does not work anymore.

<mbean code="com.mycompany.vms.adapter.connector.SourceConnector" name="mycompany:service=SourceConnector,source=SILTERRA" xmbean-dd="META-INF/SILTERRA-SourceConnector-xmbean.xml">
    <depends>jboss.j2ee:jndiName=mycompany/vms/ImportService,service=EJB</depends>
    <depends>jboss.j2ee:service=EJB,jndiName=mycompany/vms/EJBCommandService</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/ReceiverQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/DMuxerQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/ChannelProcessorQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/TransactionProcessorQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/SynchronizerQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/CommandQueue</depends>
    <depends>jboss.mq.destination:service=Topic,name=vms/SystemAlertsTopic</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/LotIssueQueue</depends>
</mbean>

Please anyone help me on this. Anyway can do that on JBoss7?

R.Kaka
  • 167
  • 6
  • 16
  • Have you tried the solutions mentioned [here](http://stackoverflow.com/questions/9275562/port-mbean-from-jboss-4-x-to-jboss-7)? It presents you solutions on how to migrate your MXBeans from JBoss 4.X to JBoss 7. – António Ribeiro Feb 03 '16 at 13:39
  • were you able to resolve this @duykaka ? – Sampada Jun 08 '16 at 06:40

2 Answers2

0

You can convert your MBean into a @Singleton triggered @Startup, injecting on it its EJB dependencies.

You can find more information here and here.

Community
  • 1
  • 1
António Ribeiro
  • 4,129
  • 5
  • 32
  • 49
0

You can create a jboss-ejb3.xml file and list your enterprise beans in it to order the startup of your ejb's.

More details can be found here - https://docs.jboss.org/author/display/AS71/jboss-ejb3.xml+Reference

Sampada
  • 2,931
  • 7
  • 27
  • 39