Expand my Community achievements bar.

SOLVED

Sling model error

Avatar

Level 4

I'm having trouble getting a sling model to work in 6.3. I'm getting the following error in the logs:

Cannot find a file corresponding to class className in the repository.

I think I have the correct configuration in my POM:

            <plugin>

                <groupId>org.apache.felix</groupId>

                <artifactId>maven-bundle-plugin</artifactId>

                <extensions>true</extensions>

                <executions>

                    <execution>

                        <id>bundle-manifest</id>

                        <phase>process-classes</phase>

                        <goals>

                            <goal>manifest</goal>

                        </goals>

                    </execution>

                </executions>

                <configuration>

                    <instructions>

                        <Import-Package>javax.inject;version=0.0.0,*</Import-Package>

                        <Sling-Model-Packages>

                            packageName

                        </Sling-Model-Packages>

                    </instructions>

                </configuration>

            </plugin>

I can see the sling model registered in /system/console/adapters so I'm assuming it's running ok.

Finally, my current project is built on top of the most recent archetype for 6.3 builds.

Can you think of anything I may have overlooked and possibly a reason why this isn't working?

1 Accepted Solution

Avatar

Correct answer by
Level 4

Thanks for the response.

A bit of a false alarm! I got the reference for my model class wrong in the HTL file.

View solution in original post

4 Replies

Avatar

Level 10

Try this Sling Model article - where we inject Dialog Values into the Java class.

Creating a custom Touch UI Grid Component for Adobe Experience Manager

Avatar

Community Advisor

just cross check if you h ave the correct package name under <Sling-Model-Package>

Problem - Sling Model not getting invoked | LinkedIn

Avatar

Correct answer by
Level 4

Thanks for the response.

A bit of a false alarm! I got the reference for my model class wrong in the HTL file.

Avatar

Level 10

Glad its working - that is why I like the working articles - you can check the way they work against ones that do not and compare.