Topic
  • 2 replies
  • Latest Post - ‏2013-04-03T17:24:15Z by SystemAdmin
IsaacGraf
IsaacGraf
5 Posts

Pinned topic Starting up code from Liberty

‏2013-04-03T17:04:19Z |
Hello,

I am using the beta version of Liberty Profile 855 and am trying to invoke some code to run when the Liberty profile starts up. I've tried deploying this code as a startup ejb and also as a servlet with load-on-startup set in web.xml and in neither case does the code get invoked on startup.
Is there a recommended way to do this?
Thanks very much.
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Starting up code from Liberty

    ‏2013-04-03T17:11:49Z  
    How to get servlets loaded at startup is documented in our infocenter [1]. You essentially need to add this to your server.xml:

    <webContainer deferServletLoad="false"/>

    Alasdair

    [1] http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd-dist&topic=twlp_servlet_load
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Starting up code from Liberty

    ‏2013-04-03T17:24:15Z  
    Hi,
    If you want your code to follow the server lifecycle, you may also want to consider deploying it as a user feature - this is new capability in the beta.
    Regards, Alex.