Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Sling models in 6.3

Avatar

Level 4

Hi all. I'm posting to ask about Sling models and if they differ in 6.3

I have a a few components in 6.1 that make use of Sling models to expose some data in the repo. These work fine in 6.1

We are currently in the process of upgrading to 6.3 and I have noticed that this code no longer works. It doesn't even look as though the models are being invoked (I have logging messages in them that aren't appearing in the logs). I have updated the org.apache.sling.models.api dependency in the POM file and my bundle is in an active state.

Is there something I'm missing that I need to do as part of the upgrade?

Edit: If I go to /system/console/adapters, I can see the sling models registered on my 6.1 server but not in 6.3

1 Accepted Solution

Avatar

Correct answer by
Level 10

By the way - in the article - if you install the package - you will see it registered as shown here:

AModelClass.png

Build 6.3 Models the way we describe in the Article: Using Maven 11 Archetype.

NOTE - i updated the article to mention this UI as per your comment here.

View solution in original post

7 Replies

Avatar

Level 10

Sling Models work in AEM 6.3.

See this article where we create a custom Grid component using Sling Models.

Creating a custom Touch UI Grid Component for Adobe Experience Manager

You may need to rebuild your code using AEM UBER 6.3 JAR file as shown in this article. If you simply trying to get a 6.1 bundle working in 6.3 - it will not work.

Avatar

Level 4

Thanks, I'll have a look at this. Just to note, I do have the uberjar included as a dependency - the bundle is active and other components are working as I would expect. It just seems as though the sling model isn't getting registered correctly.

Avatar

Correct answer by
Level 10

By the way - in the article - if you install the package - you will see it registered as shown here:

AModelClass.png

Build 6.3 Models the way we describe in the Article: Using Maven 11 Archetype.

NOTE - i updated the article to mention this UI as per your comment here.

Avatar

Employee

Are you sure that <Sling-Model-Packages> is set right?

Avatar

Level 4

Yes, certain. The same code works on 6.1.

Avatar

Level 10

Dd you build it like we show you in the article?

Avatar

Level 4

I built the demo bundle and that worked so I'll have a dig around and see what's different between that and my project.

FYI, one change I had to make from the article was to use a different package name when checking out the archetype:

  • package - com.community.grid