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

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

Creating Custom Social Component (Comments) - Error extending comments component

Avatar

Community Advisor

Hello All,

I tried to create a custom social component using this link at Creating an Adobe Experience Manager social component which is tested for AEM 6.0. However I am trying on AEM 6.2 (cq-socialcommunities-pkg-1.10.111.zip

I am able to run build successfully. But in my code I see this error on my CustomComment class "The type com.adobe.cq.social.commons.comments.internal.states.State cannot be resolved. It is indirectly referenced from required .class files". After the successful build, On my page with comment component I see the same error

If anyone tried this and faced same issue please let me know..

It did work for a colleague using AEM 6.2 (1.10.60) (some time back) but now they get same error with AEM 6.2 (1.10.111). Can that be something??

 

Update: Confirming - Doesnot work on AEM 6.2 FP2 (1.10.111), but works on AEM 6.2 FP1(1.10.60). I did go to my eclipse and set my dependencies to the FP1 (1.10.60) and I could see the error gone and expected changes as per customization.

Is there anything I am missing while working with AEM 6.2 FP2?

Appreciate any help..Thanks

0 Replies

Avatar

Level 8

Hi Shubham,

Could you verify that you updated your Maven pom to reference 1.10.111 API instead of 1.10.60 ?

In other words :

<dependency>
    <groupId>com.adobe.cq.social</groupId>
    <artifactId>cq-socialcommunities-api</artifactId>
    <version>1.10.111</version>
    <scope>provided</scope>
</dependency>

- JK

Avatar

Community Advisor

Hi JK,

Yes I had my dependency already updated and was working on FP2 itself i.e. the reference to 1.10.111 API. Also my jar dependencies were pointing to proper jar of 1.10.111.

I switched to 1.10.60  by changing the dependency refering to the 1.10.60 API to check if the custom code works there and it did. Switching back to 1.10.111 API reference gave the error again. 

Also I couldn't find this " com.adobe.cq.social.commons.comments.internal.states.State" to which the error in eclipse points to

Thanks for replying..

Regards

Avatar

Employee

Hi,

In Eclipse, you might have to manually delete the Maven Dependency in your project. If it builds successfully then it should be fine. Also can you double check your project pom to see that you not using a specific version of social-commons.

For the error on Page, can you double check the version of social-commons bundle in /system/console/bundles . (It should be 1.7.99)

A reference POM can be found here - https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-extension/blob/master/bundles/aem...

Thanks

Avatar

Community Advisor

Hi Arun,

My project was building fine with FP2 installed (but with the error), so hoping thats fine

I quickly checked my OSGi console for /system/console/bundles, it points to "1.7.66". Not sure how it ends up being that. 

On checking my pom files core or project I do not have any reference to social-commons.

Is there a dependency I might be missing for the social-commons version being incorrect?

Thanks

Shubham

Avatar

Employee

Social-Commons bundle is installed when installing FP2 (packaged with cq-socialcommunities-pkg-1.10.111.zip)

Can you delete the bundle and install cq-socialcommunities-pkg-1.10.111.zip again. (You might have to restart the system, just to be sure)

Avatar

Community Advisor

I will try that. Thanks

(Not sure how my previous reply got posted twice..will try to remove it)

Avatar

Community Advisor

aponnusa wrote...

Social-Commons bundle is installed when installing FP2 (packaged with cq-socialcommunities-pkg-1.10.111.zip)

Can you delete the bundle and install cq-socialcommunities-pkg-1.10.111.zip again. (You might have to restart the system, just to be sure)

 

So I deleted the social-commons bundle from OSGi and reinstalled the cq-socialcommunities-pkg-1.10.111.zip through package manager. On refreshing my OSGi console I see that most of my bundles are in installed state still. Then restarted the instance and the system (as you mentioned). When I start my instance again it starts with errors because the bundles are still not there according to it. Not sure why this is happening. 

Avatar

Employee

Sorry about this. But if you start some bundle and see error logs, you should see why those bundles are inactive. Can you check and let me know.

Thanks

Avatar

Community Advisor

I checked my error logs. All the errors point to similar reasons as below based on what bundle it is about

13.02.2017 08:45:52.679 *ERROR* [qtp1541042229-1739] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unable to resolve com.adobe.cq.social.cq-social-members-api [875](R 875.1): missing requirement [com.adobe.cq.social.cq-social-members-api [875](R 875.1)] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.cq.social.scf.community)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve com.adobe.cq.social.cq-social-scf-api [928](R 928.0): missing requirement [com.adobe.cq.social.cq-social-scf-api [928](R 928.0)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.commons)(version>=5.7.0)(!(version>=7.0.0)))] Unresolved requirements: [[com.adobe.cq.social.cq-social-members-api [875](R 875.1)] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.cq.social.scf.community)(version>=2.0.0)(!(version>=3.0.0)))])
org.osgi.framework.BundleException: Unable to resolve com.adobe.cq.social.cq-social-members-api [875](R 875.1): missing requirement [com.adobe.cq.social.cq-social-members-api [875](R 875.1)] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.cq.social.scf.community)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve com.adobe.cq.social.cq-social-scf-api [928](R 928.0): missing requirement [com.adobe.cq.social.cq-social-scf-api [928](R 928.0)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.commons)(version>=5.7.0)(!(version>=7.0.0)))] Unresolved requirements: [[com.adobe.cq.social.cq-social-members-api [875](R 875.1)] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.cq.social.scf.community)(version>=2.0.0)(!(version>=3.0.0)))]
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)

 

I have also tried uninstalling FP2 and reinstalling back, but there is no effect. I notice in package manager that all the AEM communities based packages are pointing to version based on FP1, If I unstall a bundle, then it switches to the latest version as per FP2. So if I had just uninstalled the cq-social-commons-pkg-1.7.66.zip, I would see the cq-social-commons-pkg-1.7.99.zip

 

If nothing works will set up author again. If I do that, what is best way to install the communites feature pack? Install FP1 and then FP2 OR just install FP2 directly after installing AEM 6.2 jar?

Avatar

Community Advisor

Hi Arun

I started with a new instance..

Installed new AEM-6.2 Author with social communities package version - 1.9.236. I see cq-social-commons-pkg version - 1.6.91.  At /libs/social/commons/install I see "cq-social-commons-1.6.91.jar"

Installed FP1 Now communities package version - 1.10.60 and cq-social-commons-pkg version - 1.7.44. At /libs/social/commons/install I see "cq-social-commons-1.7.44.jar"

Installed FP2 Now communities package version - 1.10.111 and cq-social-commons-pkg version - 1.7.66. Interesting part is that in package manager I see "cq-social-commons-pkg-1.7.99.zip" but under path /libs/social/commons/install I see "cq-social-commons-1.7.66.jar" 

In above images, you can see the jar and packages are pointing to different versions.

Also if I download the cq-social-commons-pkg-1.7.99.zip, I can see that inside that, the jar at path /libs/social/commons/install is pointing to version 1.7.66

Is there a jar with verison 1.7.99 for cq-social-commons that exists? Shouldn't the FP2 install place 1.7.99 jar?

 

Please let me know if you see the same

Avatar

Employee

Hi

Sincere apologies. The bundle version you see is correct.So it is 1.7.66 - Package and bundle versions can be different. I should have double checked it on my end.

Do you still face the same issue with the new uber and your component. If so, is it possible to share your component and pom file (and we can take a look)

Avatar

Community Advisor

aponnusa wrote...

Hi

Sincere apologies. The bundle version you see is correct.So it is 1.7.66 - Package and bundle versions can be different. I should have double checked it on my end.

Do you still face the same issue with the new uber and your component. If so, is it possible to share your component and pom file (and we can take a look)

 

Hi Arun,

No problem, I too assumed package and bundle version would always be same. 

I think I am facing same issue with my component which extends the AbstractComment<CommentCollectionConfiguration>. I am not sure how to check for whether I have new Uber but I think I have it as per dependency mentioned in start of this post comments. I pm'ed you relevant files

Thanks for your response

Avatar

Level 5

Arun,

We're using the Unobfuscated 6.2 Uber-jar.

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.2.0</version> <classifier>apis</classifier> <scope>provided</scope> </dependency>

Avatar

Employee

Can you try placing this code dependency (Communities should be above the Uber jar)

<dependency> <groupId>com.adobe.cq.social</groupId> <artifactId>cq-socialcommunities-api</artifactId> <version>1.10.111</version> <scope>provided</scope> </dependency>

above

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.2.0</version> <classifier>apis</classifier> <scope>provided</scope> </dependency>

Avatar

Community Advisor

Hi..

I have had the above dependencies arranged in same manner. i.e communities above uber-jar dependency

Thanks