Datasource not found in par deployment [message #963003] |
Mon, 29 October 2012 09:51  |
Eclipse User |
|
|
|
In my deployment I created a dedicated bundle with the sole purpose of providing a datasource to the other bundles. One of my services/bundles uses that datasource in its application context to configure flyway. The application context file is attached to this post. I also attached the manifest.mf of the datasource bundle. Now, when I deploy the modules one by one everything works fine. But when I deploy a par with the same bundles in it, startup fails with this message:
com.googlecode.flyway.core.exception.FlywayException: Unable to obtain Jdbc connection from DataSource. What's the difference between both types of deployment?
|
|
|
|
|
|
Re: Datasource not found in par deployment [message #968332 is a reply to message #964385] |
Fri, 02 November 2012 07:31  |
Eclipse User |
|
|
|
In general, bundles should be able to cope with starting in arbitrary orders. There are various ways to achieve this. For instance, if bundle B consumed a service that bundle A published once it has finished initialising, then this would delay the Spring processing of bundle B appropriately. In fact, if bundle A is "Spring DM powered", it will publish its application context as a service which you could then use in bundle B simply to control the ordering.
If that approach isn't practical in this case, you might replace the PAR file with a scoped plan in order to control the start order of the content bundles. (You can also put a plan file inside a PAR, but that probably defeats the object as the plan file needs to refer to content in the repository rather than in the PAR file.) But you'd still be in a race, so it probably wouldn't help much.
|
|
|
Powered by
FUDForum. Page generated in 0.03362 seconds