CRXDE Error | Community
Skip to main content
Level 3
October 16, 2015
Solved

CRXDE Error

  • October 16, 2015
  • 11 replies
  • 3515 views

Hi,

I'm working on the below exercise and i'm getting the output as expected.

http://helpx.adobe.com/experience-manager/using/using-sling-apis.html

But in CRXDE it throws errors may i know what is the root cause here because i'm eager to know whether it's code issue or crxde

Error:

Multiple annotations found at this line:
    - custom cannot be resolved 
     to a type
    - sling cannot be resolved

Also PFA Image

Thanks in advance!!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ove_Lindström

There is really no need to be concerned of confused. The problem is NOT related to Adobe AEM, CRX or CRXDE. It is a classic Java resolving problem.

If you use a class, lets say custom.sling.Query, you need to have someone that declares that class in your development environment, either as source code or as a compiled class. All of the classes that are deployed in your CQ instance should be loaded into your IDE and added to the build CLASSPATH. Look at the CLASSPATH as an address to a warehouse where your classes are found at a specific shelf (custom.sling). What the IDE tells you is "yes, I know that you want that class, but I have talked to all my warehouses (that is the jar-files that contains the classes) and non-one stocks it. Could you please point me to the right place."

We use Maven to keep this kinds of dependencies and downloads the jar-files from the Adobe Repository.

11 replies

smacdonald2008
Level 10
October 16, 2015

Do you have the OSGi bundle deployed and in an active state - if you built the bundle using Maven following this article and deployed the bundle, you should see it in an active state in the Felix console:

[img]Maven.png[/img]

Level 6
October 16, 2015

The problem here is an IDE-problem, not an CRXDE-problem per se. One of the problems is due to the file "/libs/foundation/global.jsp", that the sling object is not found on the path and included by the IDE.

The other is due to the fact that your jsp-file does not include the custom.sling.Query in an page import.

 

/Ove

viswacq5Author
Level 3
October 16, 2015

Bundle is Active and getting the out as expected but unnessary it showing the error in jsp.

PFA image 

viswacq5Author
Level 3
October 16, 2015

Hi Ove,

PFA image as you suggested i've made page import(custom.sling.Query ) still facing the same error.

Is there a workaround to come out of the error.Please suggest.

Thanks in advance!

Level 6
October 16, 2015

Does your Eclipse Project import a JAR with the mentioned class in its CLASSPATH?

This is actually not a CRX/AEM-issue, it is a Java/Java EE/IDE-issue.

/Ove

smacdonald2008
Level 10
October 16, 2015

What concerns me here is that the sling object is not found on the path. Do you see this path in your system:

"/libs/foundation/global.jsp" -- this is where the sling object is defined. 

If you cannot use Sling  -- there is something wrong with your CQ paths. Out of the box -- this works fine. 

viswacq5Author
Level 3
October 16, 2015

now the sling object error disappears but the import error still exists but the output is displayed.

i'm confused here :). 

PFA image

viswacq5Author
Level 3
October 16, 2015

Hi Ove,

I'm using the eclipse favour luna to build the bundle and uploading the bundle in felix console.And there is no access/permission for me to mention it in the class path.

Ideally for building the bundle which flavour of eclipse is better to use!

Please suggest Thanks!

Level 6
October 16, 2015

Ideally, use IntelliJ IDEA 12 and Maven to build your applications.

/O

smacdonald2008
Level 10
October 16, 2015

Your CQ page output (the JSP) works correct? 

You get this result:

[img]app.png[/img]