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
BedrockMission!

Learn More

View all

Sign in to view all badges

Unable to reading OSGi Configuration values

Avatar

Avatar
Level 1
PrasadAB
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
PrasadAB
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
PrasadAB
Level 1

29-12-2020

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>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 10
MVP
shelly-goel
MVP

Likes

173 likes

Total Posts

324 posts

Correct Reply

87 solutions
Top badges earned
Give Back 10
Validate 1
Shape 1
Ignite 1
Give Back 5
View profile

Avatar
Give Back 10
MVP
shelly-goel
MVP

Likes

173 likes

Total Posts

324 posts

Correct Reply

87 solutions
Top badges earned
Give Back 10
Validate 1
Shape 1
Ignite 1
Give Back 5
View profile
shelly-goel
MVP

29-12-2020

@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...

Answers (0)