Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier com.adobe.business.core.models.TextModel cannot be correctly instantiated by the Use API

Avatar

Level 4

I ran into this error a month or so ago and am trying to retrace my steps for the resolution, but can't remember how it was resolved.

 

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier com.adobe.business.core.models.TextModel cannot be correctly instantiated by the Use API

 

I tried clearing cache here (http://localhost:4502/system/console/scriptcache), but that didn't resolve it. Any ideas? 

 

Error during include of component '/apps/business/insights/components/overlays/text'
Error Message:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier com.adobe.business.core.models.TextModel cannot be correctly instantiated by the Use API
Processing Info:
Page = /content/business/en/small-business/internet
Resource Path = /content/business/en/small-business/internet/jcr:content/root/text_640648321
Cell = text
Cell Search Path = base-page/root|responsivegrid/text|parbase
Component Path = /apps/business/insights/components/overlays/text
Sling Request Progress:
0 TIMER_START{Request Processing}
1 COMMENT timer_end format is {<elapsed microseconds>,<timer name>} <optional message>
4 LOG Method=GET, PathInfo=null
5 TIMER_START{handleSecurity}
1305 TIMER_END{1298,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@3ffd3ae7 returns true
1548 TIMER_START{ResourceResolution}
1660 TIMER_END{111,ResourceResolution} URI=/content/business/en/small-business/internet/jcr:content/root/text_640648321.html resolves to Resource=JcrNodeResource, type=business/insights/components/overlays/text, superType=null, path=/content/business/en/small-business/internet/jcr:content/root/text_640648321
1665 LOG Resource Path Info: SlingRequestPathInfo: path='/content/business/en/small-business/internet/jcr:content/root/text_640648321', selectorString='null', extension='html', suffix='null'
1665 TIMER_START{ServletResolution}
1668 TIMER_START{resolveServlet(/content/business/en/small-business/internet/jcr:content/root/text_640648321)}
1677 TIMER_END{7,resolveServlet(/content/business/en/small-business/internet/jcr:content/root/text_640648321)} Using servlet /apps/business/insights/components/overlays/text/text.html
1679 TIMER_END{13,ServletResolution} URI=/content/business/en/small-business/internet/jcr:content/root/text_640648321.html handled by Servlet=/apps/business/insights/components/overlays/text/text.html
1681 LOG Applying Requestfilters
1684 LOG Calling filter: com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl
1690 LOG Calling filter: org.apache.sling.security.impl.ContentDispositionFilter
1693 LOG Calling filter: com.adobe.granite.csrf.impl.CSRFFilter
1699 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter
1702 LOG Calling filter: com.adobe.granite.httpcache.impl.InnerCacheFilter
1706 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
1709 LOG Calling filter: com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker
1712 LOG Calling filter: com.adobe.cq.history.impl.HistoryRequestFilter
2028 LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter
2038 LOG Calling filter: com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet
2042 LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter
2045 LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet
2048 LOG Calling filter: com.adobe.cq.social.commons.cors.CORSAuthenticationFilter
2050 LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
2066 LOG Calling filter: com.adobe.cq.wcm.core.extensions.amp.internal.AmpModeForwardFilter
2466 LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter
2468 LOG Calling filter: com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl
2593 LOG Calling filter: com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter
2595 LOG Calling filter: com.adobe.granite.requests.logging.impl.RequestLoggerImpl
2600 LOG Calling filter: com.adobe.granite.rest.impl.servlet.ApiResourceFilter
2657 LOG Calling filter: com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler
2660 LOG Calling filter: com.day.cq.dam.core.impl.servlet.ActivityRecordHandler
2670 LOG Calling filter: com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet
2672 LOG Calling filter: com.day.cq.wcm.core.impl.warp.TimeWarpFilter
2681 LOG Applying Componentfilters
2682 LOG Calling filter: com.day.cq.personalization.impl.TargetComponentFilter
2684 LOG Calling filter: com.day.cq.wcm.core.impl.page.PageLockFilter
2687 LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter
3697 LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html], order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobile: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=mobiledebug, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobiledebug: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=contentsync, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-contentsync: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), serializer=Config(type=htmlwriter, config={}))}
3738 LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter
3748 TIMER_START{/apps/business/insights/components/overlays/text/text.html#0}
6412 LOG SCRIPT ERROR: Identifier com.adobe.business.core.models.TextModel cannot be correctly instantiated by the Use API
6461 TIMER_END{2710,/apps/business/insights/components/overlays/text/text.html#0}
9114 TIMER_END{9113,Request Processing} Dumping SlingRequestProgressTracker Entries
Full Exception:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier com.adobe.business.core.models.TextModel cannot be correctly instantiated by the Use API
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510)
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.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278)
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:373)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:76)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:114)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:141)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:434)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:134)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:372)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.wcm.core.extensions.amp.internal.AmpModeForwardFilter.doFilter(AmpModeForwardFilter.java:84)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:107)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:123)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:122)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:87)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:152)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:83)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:244)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:123)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86)
at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:72)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigurer.java:63)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:146)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1002)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:326)
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:97)
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1012)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:91)
at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:494)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.sling.scripting.sightly.SightlyException: Identifier com.adobe.business.core.models.TextModel 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.business.insights.components.overlays.text.text_html.render(text_html.java:53)
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)
... 133 more
Caused by: org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.adobe.business.core.models.TextModel
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:745)
at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:414)
at org.apache.sling.models.impl.ModelAdapterFactory.createModel(ModelAdapterFactory.java:280)
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)
... 140 more
Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject private com.day.cq.wcm.api.Page com.adobe.business.core.models.AbstractComponentModel.page
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:729)
... 144 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:606)
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:724)
... 144 more
Day Communique 5 WCM Core Implementation / 5.12.106 ( (c) Adobe Systems Incorporated ) running on ApacheSling/2.6 (jetty/9.4.20.v20190813, Java HotSpot(TM) 64-Bit Server VM 1.8.0_221, Linux 4.19.121-linuxkit amd64)

27 Replies

Avatar

Community Advisor

Hi @Codelime ,

Error is - Could not inject all required fields into class

Please make the fields as optional like this -

 

@Model(adaptables = {Resource.class,SlingHttpServletRequest.class}, adapters = Header.class,
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)

Thanks,

Prince 

Avatar

Level 4
Thanks for the suggestion. Where do I go to make that change? I have a search for it currently running in Eclipse.

Avatar

Community Advisor

Sorry I missed it, you have issue on OOTB models class right ? Can you confirm if you bundle is in active state ?

Avatar

Level 4
I checked Bundles and see this: Bundle information: 590 bundles in total - all 590 bundles active

Avatar

Community Advisor
@Codelime That means all your bundles are active. Issue is with your model specifically

Avatar

Level 4
Okay. With the issue being the model, there was a suggestion earlier to mark the fields as "optional". Where do I go to make that change?

Avatar

Community Advisor
Are you using any custom model class ? have you created this Model class ? or you are just dragging and dropping the component which is not created by you?

Avatar

Level 4
I'm not using any custom model class. This was working before and seemed to quit working when I checked out this latest branch. To add the Text Editor component, I typically click the component underneath and click the plus (+) sign to add 'Text Editor'.

Avatar

Community Advisor
Can you let me know which component you are trying? also why are you not adding the component using parsys or responsive grid?

Avatar

Level 4
@Prince_Shivhare - I'm trying to add the Text Editor component. I'm relatively new to AEM and am not sure what is meant by parsys or responsive grid. I've been adding components by clicking the component beneath where I want the new component and click the plus (+) sign to add the component.

Avatar

Community Advisor
can you put some screenshots here to understand the problem? may be that can help.

Avatar

Level 4

@Prince_Shivhare- These are the steps to replicate the issue in my environment: (Disregard this reply. I had pasted code here and it didn't display it.)

Avatar

Level 4
@Prince_Shivhare - After adding the Text Editor component to the page, and after adding content and clicking the checkmark, I get what I posted in the original post.

Avatar

Level 4
Also, I found and checked the ImageTextModel.java file and the fields are already set up as OPTIONAL.

Avatar

Community Advisor

If you properly navigate through your error log you can see below lines 

 

Caused by: org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.adobe.business.core.models.TextModel

 

Anytime your Model fails to Instantiate will normally be because it misses to Inject the required fields. 

 

Also it says 

 

Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject private com.day.cq.wcm.api.Page com.adobe.business.core.models.AbstractComponentModel.page
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:729)
... 144 more
Caused by: org.apache.sling.models.factory.ModelClassException: No injector returned a non-null value!

 

The line where you are injecting the page object is probably returning null value.

 

Check these and you should be good to go. 

Avatar

Level 4
Where do I go to check these? Should I be able to navigate to it in Eclipse or is it something I access through the browser?

Avatar

Community Advisor
@Codelime Do you have access to your project's codebase ? If so can you check this com.adobe.business.core.models.TextModel Sling Model ?

Avatar

Level 6
Debug the code inside TextModel class. It must be getting stuck somewhere due to some error, might be some unexpected value which is being injected and the code is failing to handle that.

Avatar

Level 4
@ibishika - I will take a look at debugging the code inside the TextModel class. I just posted in here as well in another reply.