Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

ProfileManager is deprecated in AEM6.3

Avatar

Level 2

Hi,

AS per release notes of AEM 6.3, com.day.cq.security.profile.ProfileManager API is deprecated in this version.

Could you please tell me replacement for this or any other way of getting profile?

1 Accepted Solution

Avatar

Correct answer by
Employee

Start by using apis from org.apache.jackrabbit.api.security

View solution in original post

5 Replies

Avatar

Level 10

This could be a doc bug. Typically if an API is depricated - the API reference will inform you what API to use.

This API is still used in AEM 6.3 - see:

Dep.png

Avatar

Level 2

but I am getting following exception

23.08.2017 14:44:05.036 *ERROR* [10.75.37.198 [1503479645027] GET /apps/logincomponents/components/loader.json HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

java.lang.UnsupportedOperationException: No longer supported (ProfileManager#getProfile(String,String)).

        at com.day.cq.security.impl.CQUserManagerFactoryImpl.getProfile(CQUserManagerFactoryImpl.java:99)

        at org.apache.jsp.apps.logincomponents.components.personnalization.loader.json_jsp._jspService(json_jsp.java:203)

        at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:346)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:101)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:607)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)

        at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)

        at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)

        at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:156)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

        at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:375)

        at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

        at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

Avatar

Correct answer by
Employee

Start by using apis from org.apache.jackrabbit.api.security

Avatar

Level 2

We had similar exception:

Caused by: java.lang.UnsupportedOperationException: No longer supported (UserResolver#resolveUser(Session)).

at com.day.cq.security.impl.CQUserManagerFactoryImpl.resolveUser(CQUserManagerFactoryImpl.java:73)

at com.day.cq.security.impl.SecurityAdapterFactory.getAdapter(SecurityAdapterFactory.java:151)

at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:147)

at org.apache.sling.api.adapter.SlingAdaptable.adaptTo(SlingAdaptable.java:104)

at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:815)

and resolved it by migrating to org.apache.jackrabbit.api.security

Avatar

Level 2

I prefer this below, because it is possible to get the available properties from UserProperties and API can tell us if it will be deprecated in future again:

        UserProperties up = request.adaptTo(UserProperties.class);

        up.getProperty(UserProperties.EMAIL);