Hi,
We are moving from AMS to AEMaaCS but midway we realized that AMS license is going to expire coming November. We are planning to lift and shift few components from AMS to AEMaaCS temporarily while part of team is working on new component creation on AEMaacs.
AMS code repo is on Maven archetype version 17 or 19 and AEMaaCS on recent version.
I have created a package of templates, components, page components, clientlibs, bundle from AMS environment and installed it on AEMaaCS instance along with content but while loading I see below error
03.09.2025 19:43:41.176 *ERROR* [[0:0:0:0:0:0:0:1] [1756908818438] GET /content/my-company/en-us/home/articles.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDeveloperModeFilter Error during include of SlingRequestPathInfo: path='/content/my-company/en-us/home/articles/jcr:content', selectorString='null', extension='html', suffix='null'
org.apache.sling.scripting.sightly.SightlyException: Identifier com.core.aem.core.components.model.Container cannot be correctly instantiated by the Use API
at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:73) [org.apache.sling.scripting.sightly:1.4.28.140]
I am unable to see my sling models from AMS code here http://localhost:4502/system/console/status-slingmodels. Here is the configuration of AMS core/pom.xml for build plugin org.apache.sling
<Sling-Model-Packages>
com.core.aem
</Sling-Model-Packages>
Any suggestions on the solution to resolve this error?
Bottomline is, I would like to use AMS components, bundle on AEMaaCS for a short period of time and remove this technical debt very soon.
トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。
Hi @SantoshSai ,
Yes the bundle is active
表示
返信
いいね!の合計
Not limited the current approach, If there is any other approach which solves the problem of moving AMS components from AMS to AEMaaCS, please suggest.
表示
返信
いいね!の合計
Hi @SrikanthPo3 ,
There are several reasons why Use API might not be getting instantiated. Here are a few things you can check:
Try using "optional" as the injection strategy.
Some configurations might prevent the service from being injectable. Please verify if any service is being injected.
PS: Search for ".java" in the error log to pinpoint the exact sling model and line number causing the issue.
Thanks!
We are using optional injection strategy, here is the signature
@Model(adaptables = { Resource.class, SlingHttpServletRequest.class },
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
adapters = Container.class,
resourceType = ContainerImpl.RESOURCE_TYPE)
public class ContainerImpl implements Container {
表示
返信
いいね!の合計
Hi @SrikanthPo3,
Sometimes, other Sling models injected as dependencies can cause issues. Please try removing any other Sling models to see if the application starts correctly. If it does, this indicates that the problem lies with another model. If you still don’t find any hints, I recommend commenting out all fields with annotations, then building and installing the model to see if it works. Once you have a functioning model, you can gradually reintroduce each annotated field to identify the root cause of the issue.
表示
返信
いいね!の合計