This content has been marked as final.
Show 3 replies
-
1. Re: JBOSS auto starts main() method
jiwils Mar 30, 2006 5:21 PM (in response to _monkey_)"_monkey_" wrote:
Are there any ways to tell jboss to start running this main() method as soon as Jboss starts (instead of using a servlet)?
Write a MBean service, and implement the startService method. If you wish to not depend on JBoss-provided classes, you can implement a start method.
The wiki link below explains both of these approaches and provides example code.
http://wiki.jboss.org/wiki/Wiki.jsp?page=ExampleHelloWorldService -
2. Re: JBOSS auto starts main() method
_monkey_ Apr 2, 2006 9:14 PM (in response to _monkey_)Thank you very much, now I have a further question...
Now I can get Jboss to deploy .sar file (the service bean) when Jboss starts, but since the .sar file contains references(import statements etc) to ejbs in another .ear file, but since when Jboss deploys the .sar file, the .ear file is not yet deployed, then Jboss doesn't recognize those references, so resulting in error messages.
My question is: how can I tell jboss to deploy the .sar file AFTER those ejbs (.ear file) are deployed (instead of deploying .sar file in the first instance)?
Thank you very much!! -
3. Re: JBOSS auto starts main() method
jiwils Apr 3, 2006 10:58 AM (in response to _monkey_)"_monkey_" wrote:
My question is: how can I tell jboss to deploy the .sar file AFTER those ejbs (.ear file) are deployed (instead of deploying .sar file in the first instance)?
You can setup dependancies via the depends tag in your jboss-service.xml file. Browse to http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanAnMBeanDependOnASessionBean for more information.
Before posting questions here, you might should check out the JBoss JMX FAQ located at http://wiki.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX in order to get a faster answer.