Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

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


Level 3

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