Expand my Community achievements bar.

SOLVED

Error: cannot find symbol

Avatar

Level 1

Hi all, 

I'm a beginner for AEM and I'm currently following the the AEM Back-end Developer video training. In one of the lessons, when I try to "mvn clean install -P full" project to the crx lite, I got an error:

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project company-core: Compilation failure [ERROR] C:\Users\guanlun.mu\Desktop\videoTraining\company\company-core\src\main\java\com\adobe\training\core\CleanupServiceImpl.java:[44,65] error: cannot find symbol

 

The code I used was directly copy-pasted from the student file downloaded from the course, so the code itself should be OK. I'm thinking it may be some maven config error but I'm not sure. Anyone have same error? Lots of thanks! 

1 Accepted Solution

Avatar

Correct answer by
Level 10

[Best Practices to use]

Never use CRXIE to create an OSGI bundle. Use Maven. See this community article to get you up and running. http://scottsdigitalcommunity.blogspot.ca/2014/05/creating-your-first-aem-service-using.html. There are tons of other AEM articles listed on this blog too that point to Adobe AEM articles.

[Answer]

Thanks a lot, the problem is solved, it's actually an AEM version issue. Apparently AEM 6.1 and after doesn't support the getDefaultWorkspace() method as a login method, so that's why when I was trying to do so, it has this error, which doesn't happen on the video guy who has a AEM 6.0. Also, thanks for the article! 

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

[Best Practices to use]

Never use CRXIE to create an OSGI bundle. Use Maven. See this community article to get you up and running. http://scottsdigitalcommunity.blogspot.ca/2014/05/creating-your-first-aem-service-using.html. There are tons of other AEM articles listed on this blog too that point to Adobe AEM articles.

[Answer]

Thanks a lot, the problem is solved, it's actually an AEM version issue. Apparently AEM 6.1 and after doesn't support the getDefaultWorkspace() method as a login method, so that's why when I was trying to do so, it has this error, which doesn't happen on the video guy who has a AEM 6.0. Also, thanks for the article! 

Avatar

Level 10

Hi,

As you are beginner in CQ5, use Maven to create OSGI bundle is the better way. Never use CRXDE. 

As scott stated, there are many community articles which creates OSGI bundle using maven. Look at this link: https://helpx.adobe.com/marketing-cloud/experience-manager.html  which contains most of the articles of it.

Thanks,
Ratna Kumar.

Avatar

Level 1

Thanks a lot, the problem is solved, it's actually an AEM version issue. Apparently AEM 6.1 and after doesn't support the getDefaultWorkspace() method as a login method, so that's why when I was trying to do so, it has this error, which doesn't happen on the video guy who has a AEM 6.0. Also, thanks for the article! 

Avatar

Level 10

I am glad to hear that. Be sure to refer to our AEM Community page for many AEM articles and other AEM content:

https://helpx.adobe.com/marketing-cloud/experience-manager.html