Hello,
I need to change bundle start level from default 20 into 21 to prevent some timing issues.
I've found solution via bundle activator.
Something like this:
Bundle bundle = context.getBundle();
StartLevel startLevel = (StartLevel) context.getService(context.getServiceReference(StartLevel.class.getName()));
startLevel.setBundleStartLevel(bundle, 21);
Is it possible to change start level by another way?
Thanks,
Alex
Solved! Go to Solution.
Views
Replies
Total Likes
I think that such fix will be temporary.
We have a huge team and I can't control that all team will use such workaround (Someone can change query, implement new service with QueryBuilder, etc..).
We found another solution:
Place our bundles under /apps/{project}/install/21 (Default is 20).
Thanks,
Alex
Views
Replies
Total Likes
If you need to change the startlevel of a bundle to prevent race conditions, you are doing something wrong. Just having the right service dependencies should always be sufficient. I do not recommend this approach.
kind regards,
Jörg
Definitely it's true.
But, in our application we are using in-memory cache which is initialized on service activate method.
In init method we are using Query Builder (Query contains predicate).
In error.log on AEM start up I see:
20.06.2017 08:30:47.189 ERROR [FelixStartLevel] com.day.cq.search.impl.builder.QueryBuilderImpl Unable to get PredicateEvaluator instance: group
And my query executed without some limitation (template, etc..).
It seems that we have such issues because QueryBuilder tries to get PredicateEvaluator via BundleContext.getServiceReference().
Note: Such issues reproducible from time to time.
Thanks,
Alex
Views
Replies
Total Likes
Ok, the QueryBuilder has a number of optional PredicateEvaluators. And just the availability of the QueryBuilder does not mean, that you can start a query and use this PredicateEvaluator.
I think that the PredicateEvaluators are also Services. Can you identify the correct service and build a dependency on the PredicateEvaluator you need directly in your service?
Jörg
Views
Replies
Total Likes
I think that such fix will be temporary.
We have a huge team and I can't control that all team will use such workaround (Someone can change query, implement new service with QueryBuilder, etc..).
We found another solution:
Place our bundles under /apps/{project}/install/21 (Default is 20).
Thanks,
Alex
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies