Expand my Community achievements bar.

SOLVED

cannot find symbol class WCMUse location: package com.adobe.cq.sightly

Avatar

Level 7

I am trying to scan AEM multi module project using sonar and got the following error. I have uber jar 6.3 version in pom files.

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------

[ERROR] /var/lib/jenkins/jobs/Experiments/jobs/SONAR-TEST-Modules-Scan/workspace/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/ResponseStatus.java:[3,28] cannot find symbol
  symbol: class WCMUse

  location: package com.adobe.cq.sightly

[ERROR] /var/lib/jenkins/jobs/Experiments/jobs/SONAR-TEST-Modules-Scan/workspace/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/ResponseStatus.java:[5,37] cannot find symbol
  symbol: class WCMUse

[ERROR] /var/lib/jenkins/jobs/Experiments/jobs/SONAR-TEST-Modules-Scan/workspace/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/ResponseStatus.java:[9,5] method does not override or implement a method from a supertype
[ERROR] /var/lib/jenkins/jobs/Experiments/jobs/SONAR-TEST-Modules-Scan/workspace/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/ResponseStatus.java:[11,9] cannot find symbol
  symbol: method getResponse()

  location: class apps.sling.servlet.errorhandler.ResponseStatus

I am not sure if I need to write maven felix plugin in pom.xml of ui.apps and import any artifacts.

The following is the code for which above error thrown:

package apps.sling.servlet.errorhandler;

import com.adobe.cq.sightly.WCMUse;

public class ResponseStatus extends WCMUse {

    public static final int SERVER_RESPONSE_CODE_404 = 404;

    @Override

    public void activate() throws Exception {

        getResponse().setStatus(SERVER_RESPONSE_CODE_404);

    }

}

Any ideas ??

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Uber Jar 6.3 doesn't have WCMUse class, you can change your code to update WCMUse to WCMUsePojo.

Screen Shot 2018-09-29 at 12.10.22 PM.png



Arun Patidar

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

Uber Jar 6.3 doesn't have WCMUse class, you can change your code to update WCMUse to WCMUsePojo.

Screen Shot 2018-09-29 at 12.10.22 PM.png



Arun Patidar

Avatar

Employee

Indeed, this has been removed I think since 6.2