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

Unable to access Sling model API when generating a new AEM project based on Archtype 10

garyT
Level 2
Level 2

There have been some cases when generating an AEM Maven project using the AEM's archtype version 10 where the project will be deployed, however, the Java code (HelloWorldModel.java) cannot be found by the calling "helloworld.html". If this happens, your content will be deployed to the server but the hello world message on the webpage wlil be blank (will not contain the message from the HelloWorldModel.java.

This appears to be a problem related to versioning. To solve the issue, do the following:

1. Open http://localhost:4502/system/console/bundles and search for Sling Models. Note the version of the current bundle (i.e. 1.1.0)

2. In your Maven project, at the top level of the project, open the Pom.xml file and search for org.apache.sling.models.api

3. Note the version number of the API and  modify it to match the version number you found on the system

4. Save the file.

5. In Eclipse, right-click top level project in Project Explorer.and select Maven > Update Project

6. In the Server window in the Eclipse project/environment, select the "Clean and Publish" option to publish your chnages

0 Replies