Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay afterPropertiesSet not exist in SB after migration to 7.2.1DXP
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
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
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.
In the OSGi world, you want an @Activate-annotated method which will be invoked after all services have been resolved in.
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

Thanks anyway
Best regards
Attachments:
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™