Liferay afterPropertiesSet not exist in SB after migration to 7.2.1DXP

Rafał Pydyniak, modified 5 Years ago. New Member Posts: 16 Join Date: 6/24/20 Recent Posts
Hello
I have a problem - in one of our modules we have "afterPropertiesSet" method written in XXXLocalServiceImpl. In Liferay 7.0.6 this was called after initialization of this specific service module.That method was overriding a method from XXXLocalServiceBaseImpl and it worked fine. Now I have migrated (or I'm migrating) that module to 7.2.1 DXP version and after running service builder (of course after going through other points in Liferay Upgrade Planner) everything seems to work (like dependencies) but not this one method. It seems that "afterPropertiesSet" is not generated anymore in XXXLocalServiceBaseImpl or any other class so I have an error saying that this method does not override anything (and has an @Override annotation).
I looked through breaking changes but couldn't find anything regarding this topic. Is there a solution to this? Should I perhaps override another method or something?
Best regards
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
7.0 was spring-based SB, 7.2 is OSGi-based SB.

In the OSGi world, you want an @Activate-annotated method which will be invoked after all services have been resolved in.
Olaf Kock, modified 5 Years ago. New Member Posts: 16 Join Date: 6/24/20 Recent Posts
Hello, thanks for the answer - that makes sense. I think that the Liferay upgrade planner is not exactly correct though - in the "Migrate from Spring DI to OSGI Declarative Services" it says that this step is optional so I skipped it but actually it seems that it's not optional if you use for example this method (or destroy) because old way is not working anymore.
​​​​​​​
So probably it would be good to update the Liferay Upgrade Plan and(/or) include that in breaking changes for 7.2
Thanks anyway

Best regards