Expand my Community achievements bar.

Identifier com.adobe.cq.wcm.core.components.models.Page cannot be correctly instantiated by the Use API (500)

Avatar

Level 1

Hi There,

 

I am facing an issue where where I see below error when I load the page

Caused by: org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.adobe.cq.wcm.core.components.internal.models.v2.PageImpl
	at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:754)
	at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:428)
	at org.apache.sling.models.impl.ModelAdapterFactory.createModel(ModelAdapterFactory.java:282)
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider.loadObject(JavaUseProvider.java:183)
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider.provide(JavaUseProvider.java:130)
	at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:71)
	... 173 more
	Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject private com.day.cq.wcm.api.components.ComponentContext com.adobe.cq.wcm.core.components.internal.models.v2.PageImpl.componentContext
		at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:738)
		... 178 more
	Caused by: org.apache.sling.models.factory.ModelClassException: No injector returned a non-null value!
		at org.apache.sling.models.impl.ModelAdapterFactory.injectElement(ModelAdapterFactory.java:615)
		at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:733)
		... 178 more
	Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject protected com.day.cq.wcm.api.Page com.adobe.cq.wcm.core.components.internal.models.v1.PageImpl.currentPage

I have core component version version installed 2.20.6  on AEM 6.5.21 . Bundles are all seems active

 

vdhiman23_0-1730921496945.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

5 Replies

Avatar

Level 8

Hi @vdhiman23 

 

Are you by any chance trying to extend PageImpl.java ?

Avatar

Level 5

Hi @vdhiman23 

 

Did you implement any delegation pattern in AEM / override the page component ?

 

From the error log you posted, it looks like pageImpl is trying to inject mandatory properties.

 

Hope this helps !

 

Thanks

Avatar

Community Advisor

Is this happening after some upgrade ? And is it happening on all the pages or any specific ones ? 
You can try to uninstall the core component package once and try to reinstall to remove any corrupt files.

Avatar

Administrator

@vdhiman23 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni