Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs

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)

0 Replies

Avatar

Community Advisor

Hi @Codelime ,

 

It means your Sling Model is not up. This time its because of Injection is null but anytime you can follow below options to debug

 

1. http://<HOST:PORT>/system/console/status-slingmodels and search for your Sling model, it should be there if everything is fine.

 

2. Just put @Component annotation in Sling model and deploy/install the code again and open http://localhost:4502/system/console/components and check if your sling Model is in active state.

 

3. Go to http://localhost:4502/system/console/ and check the bundle in which the Sling Model is there should be in active state.

 

Avatar

Community Advisor
@Codelime do you have access to your codebase to check what are the line of code which is throwing error ?

Avatar

Community Advisor
@Codelime Please check with your team from where you can get the latest code. Each company has different way to version control the code.

Avatar

Level 4

@Ritesh_Mittal - Can you elaborate on this?


2. Just put @Component annotation in Sling model and deploy/install the code again and open http://localhost:4502/system/console/components and check if your sling Model is in active state.

 

I checked and the Sling Model is in the active state. 

Avatar

Level 4

Here's the TextModel.java file:

package com.adobe.business.core.models;

import javax.annotation.PostConstruct;

import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Exporter;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

import com.adobe.business.core.utils.Markdown;
import com.adobe.cq.export.json.ExporterConstants;

@Model(adaptables={SlingHttpServletRequest.class, Resource.class},
       adapters={TextModel.class},
       resourceType={"business/insights/components/overlays/text"})

public class TextModel extends AbstractComponentModel {
    
    @ValueMapValue(injectionStrategy=InjectionStrategy.OPTIONAL, name="backgroundColor")
    private String backgroundColor;
    
    @ValueMapValue(injectionStrategy=InjectionStrategy.OPTIONAL, name="textColor")
    private String textColor;
    
    @ValueMapValue(injectionStrategy=InjectionStrategy.OPTIONAL, name="text")
    private String text;
    
    @ValueMapValue(injectionStrategy=InjectionStrategy.OPTIONAL, name="fullWidth")
    private boolean fullWidth;
    
    public String getBackgroundColor() {
        return backgroundColor;
    }

    public String getTextColor() {
        return textColor;
    }
    
    public boolean getFullWidth() { return fullWidth; }

    public String getText() {
        String out = text;
        if(out.contains(".jpg"))
        {
            out.replaceAll(".jpg", ".jpeg/_jcr_content/renditions/cq5dam.web.816.480.jpeg");
        }
        else if(out.contains(".jpeg"))
        {
            out.replaceAll(".jpeg", ".jpeg/_jcr_content/renditions/cq5dam.web.816.480.jpeg");
        }
        else if(out.contains(".png"))
        {
            out.replaceAll(".png", ".jpeg/_jcr_content/renditions/cq5dam.web.816.480.jpeg");
        }
        return Markdown.parse(text);
    }

    @PostConstruct
    private void initModel()
    {
        Markdown.setResourceResolver(this.getResource().getResourceResolver());
    }
}