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
Issues with PortalLDAP classes
Hi everyone.
I am facing issues when trying to use PortalLDAP. I am going to try to explain myself.
I wanted to use PortalLDAPUtil as it was used in Liferay 7.0, but it was moved in 7.1 to an internal package. So I was told to use this instead:
My problem is that if I try to use in the doview method of a portlet, portlet does not appear in portal so I cannot use it. And if I use in other classes, _portalLDAP is always null.
I am very lost with this new implementation of classes, so any help or orientations would be very appreciated.
Kind regards.
I am facing issues when trying to use PortalLDAP. I am going to try to explain myself.
I wanted to use PortalLDAPUtil as it was used in Liferay 7.0, but it was moved in 7.1 to an internal package. So I was told to use this instead:
@Reference( policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY )
private volatile PortalLDAP _portalLDAP;
My problem is that if I try to use in the doview method of a portlet, portlet does not appear in portal so I cannot use it. And if I use in other classes, _portalLDAP is always null.
I am very lost with this new implementation of classes, so any help or orientations would be very appreciated.
Kind regards.
I don't normally add the volatile modifier in the declaration.
Is your class where you have the @Reference declared as an @Component? If it is not a component, the @Reference will never be injected.
Is your class where you have the @Reference declared as an @Component? If it is not a component, the @Reference will never be injected.
Hi David.
I am trying to use the PortalLDAP reference in a class but it is always null, but I don't really know what can be causing this issue? Regarding this:Is your class where you have the @Reference declared as an @Component? If it is not a component, the @Reference will never be injected.
I am not sure how to do this. Could you help me?
Thanks in advance.
Regards.
I am trying to use the PortalLDAP reference in a class but it is always null, but I don't really know what can be causing this issue? Regarding this:Is your class where you have the @Reference declared as an @Component? If it is not a component, the @Reference will never be injected.
I am not sure how to do this. Could you help me?
Thanks in advance.
Regards.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™