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

SOLVED

Unable to reading OSGi Configuration values

PrasadAB
Level 1
Level 1

Hi All,
As per requirement for the migration of AEM 6.2 to AEM 6.5 cloud service. I have to read the OSGi configuration values. I tried this link https://helpx.adobe.com/experience-manager/using/osgi_config63.html.
I was able to create all the specified java files and the build was successful as well.

 

At the component level, I was trying to fetch the values like below code snippet shows, but could not get the values. Looking for the solution for this to achieve. Below are trails which I tried out.

Try 1:
<sly data-sly-use.nav="com.abc.core.use.HelloWorldModel" data-sly-unwrap>In the Java call sly tag</sly><br>
<h1>${nav.getMessage}</h1>


Try 2:
<sly data-sly-use.nav="com.abc.core.use.HelloWorldModel" data-sly-unwrap>In the Java call sly tag</sly><br>
<h1>${nav.getMessage}</h1>
<sly data-sly-test.tryvalue=${nav.getMessage}>
<h2>Value: ${tryvalue}</h2>
</sly>

1 Accepted Solution
shelly-goel
Correct answer by
Community Advisor
Community Advisor

@PrasadAB 

There could be multiple reasons for it not working. Considering you're trying on AEM cloud service though the document you've referred uses older maven archetype, it could be due to that. I hope you're using latest archetype 23/ 24 in this case.

Also, please check if the model is available under /system/console/status-slingmodels and you're able to see log statements added for HelloWorldModel.

You can also refer to the below tutorial for setting up sling model

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...

View solution in original post

1 Reply
shelly-goel
Correct answer by
Community Advisor
Community Advisor

@PrasadAB 

There could be multiple reasons for it not working. Considering you're trying on AEM cloud service though the document you've referred uses older maven archetype, it could be due to that. I hope you're using latest archetype 23/ 24 in this case.

Also, please check if the model is available under /system/console/status-slingmodels and you're able to see log statements added for HelloWorldModel.

You can also refer to the below tutorial for setting up sling model

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...

View solution in original post