When I use WCMUsePojo in AEM 6.3 bundles, bundle is not resolved, as its import package says "com.adobe.cq.sightly,version=[2.5,3) -- Cannot be resolved".
Attached the error snapshot file
Solved! Go to Solution.
Views
Replies
Total Likes
See our article on this exact subject -- Creating an Adobe Experience Manager 6.3 HTL component that uses the WCMUsePojo API
Views
Replies
Total Likes
Hi Prakash,
Add the package name in pom.xml of that particular bundle and do mvn clean install. Hope it should work for you.
Example: In your case, add like this in your pom.xml
<Import-Package>
com.adobe.cq.sightly;version="2.5.3"
</Import-Package>
Hi Nandhini:
I am using sling model, and have the same issue, which is "com.adobe.cq.sightly,version=[2.5,3) -- Cannot be resolved", I tried to add the above import-package before or after the <Sling_model-Packages>, the build doesn't work. Just wonder if you can help and let me know where to add this import-package or should we have different syntax for sling model?
Thanks.
Here is part of pom.xml
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>Nextgen-Touch-Content</Bundle-SymbolicName>
<Sling-Model-Packages>bundle-ngm-content</Sling-Model-Packages>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<configuration>
<instructions>
<Sling-Model-Packages>
bundle-ngm-content
</Sling-Model-Packages>
</instructions>
</configuration>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
Views
Replies
Total Likes
See our article on this exact subject -- Creating an Adobe Experience Manager 6.3 HTL component that uses the WCMUsePojo API
Views
Replies
Total Likes
I get it to work without double quotes around the version
<import-Package>
com.adobe.cq.sightly,version=[2.5,3)
</import-Package>
But get another error.
org.apache.sling.models.annotations,version=[1.5,2) -- Cannot be resolved
Views
Replies
Total Likes
Hi,
what version of the uber.jar are you using? And what version of AEM are you deploying to?
kind regards,
Jörg
Views
Replies
Total Likes
Uber-jar 6.3.0 and AEM 6.3.
Views
Replies
Total Likes
AEM 6.3 comes with the sling models API 1.3.2, which exports org.apache.sling.models.annotations in version 1.4.0. I just checked the uber.jar for 6.3 as well and it also exports this package in version 1.4.0
When you compile against org.apache.sling.models.annotations,version=[1.5,2)
then you are likely compiling against sling models 1.3.4, which exports this java package in version 1.5.0.
So can you please share your project in a minimal way, so we can try to build it ourselves? For me it seems that you build against different artifacts and not only the AEM 6.3 uber.jar
kind regards,
Jörg
Views
Replies
Total Likes
Thank you so much.
I removed the sling model 1.3.4 in the dependency. Now it works.
Don't need <import-package> line as well.
Hi @Nandhini Marimuthu
I would like confirm that it works for me with your mention.
Updated pom.xml
<Import-Package>javax.inject;version=0.0.0,com.adobe.cq.sightly;version=2.5.3,*</Import-Package>
P/S: I created new project by using maven archetype which is recommended in Creating an Adobe Experience Manager 6.3 Project using Adobe Maven Archetype 11. It's working well. But it won't work once I added more dependencies in the core module.
Thank you!
Regards
Hung Vu
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies