Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Identifier com.adobe.cq.inbox.ui.DateFormatter cannot be correctly instantiated by the Use API

Avatar

Level 1

Hi everyone,
I'm new AEM user and i can not solve this.

In TouchUI when I click on the Inbox (the bell icon /right upper corner) and on that context menu on "View All()" then I just see a server error message.

Identifier com.adobe.cq.inbox.ui.DateFormatter cannot be correctly instantiated by the Use API

Cannot serve request to /aem/inbox in /apps/cq/inbox/gui/components/inbox/inboxitem/list/list.html

 

Exception:

org.apache.sling.scripting.sightly.SightlyException: Identifier com.adobe.cq.inbox.ui.DateFormatter cannot be correctly instantiated by the Use API
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:77)
	at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77)
	at org.apache.sling.scripting.sightly.apps.cq.inbox.gui.components.inbox.inboxitem.list.list_html.render(list_html.java:546)
	at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50)
	at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)
	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:82)
	at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:119)
...

...
Caused by: org.apache.sling.models.factory.PostConstructException: Post-construct method has thrown an exception for model class com.adobe.cq.inbox.ui.impl.DateFormatterImpl
	at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:774)
	at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:448)
	at org.apache.sling.models.impl.ModelAdapterFactory.createModel(ModelAdapterFactory.java:314)
	at org.apache.sling.scripting.sightly.models.impl.SlingModelsUseProvider.provide(SlingModelsUseProvider.java:126)
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72)
	... 234 more
Caused by: java.lang.NullPointerException
	at com.adobe.cq.inbox.ui.impl.DateFormatterImpl.init(DateFormatterImpl.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.sling.models.impl.ModelAdapterFactory.invokePostConstruct(ModelAdapterFactory.java:972)
	at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:772)
	... 238 more

 

3 Replies

Avatar

Community Advisor

@kiriku007  Can you please specify which verion of AEM and Service Pack and also java version you are using?

 

Avatar

Level 1

AEM version is 6.5, java 8
I can not find any information about Service Pack.
In: http://localhost:4502/system/console/status-productinfo.txt
I found this:

*** Product Information:
License
Product : Adobe CQ5 (5.5.0)

Installed Products
Adobe Experience Manager (6.5.0)

 

Avatar

Community Advisor

Hi @kiriku007 ,

I believe you have recently upgraded AEM project. Please test this code on a fresh AEM install and see if it throws the same error. This will tell us if the issue is with the code or upgraded AEM version.

Check some properties have null in the CRX/DE for any node.

Additionally, try using @Optional annotation while trying to inject fields using Sling Models. The reason -

When you are using Sling Models for injecting fields and you try to drag and drop the component for the first time, the model will check for the all the injected values. Since you are dropping the component for the first time and there are no values stored for it in the JCR and as result the error will be thrown. But when we use the @Optional annotation the injection strategy will be considered as optional for the field and hence it won't check for the values.

Reference: https://sling.apache.org/documentation/bundles/models.html

Hope that helps!

Regards,

Santosh