This is probably a long shot but I thought I would check.
Can Spring ping a localhost web services endpoint when my application is fully deployed?
This is probably a long shot but I thought I would check.
Can Spring ping a localhost web services endpoint when my application is fully deployed?
Yes, just create a bean that implements ApplicationListener<ContextStartedEvent> and place your ws calling code inside the onApplicationEvent method. Refer to chapter 3.13 of the official documentation.
I already tried something like this, but the problem is that the web server is not yet ready to accept web requests when the ApplicationContext is started.
It seems like such a basic problem when dealing with seeding of data via web service calls that they should put this into the Servlet spec as a listener event.
I get around the problem now by adding a cron job that fires every 15 seconds. Once a successful web request is made, I set a flag to abort any future cron jobs.
Is there a way to remove a job from the task scheduler programmatically?