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!!
Solved! Go to Solution.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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]
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Bundle is Active and getting the out as expected but unnessary it showing the error in jsp.
PFA image
Views
Replies
Total Likes
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!
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
now the sling object error disappears but the import error still exists but the output is displayed.
i'm confused here :).
PFA image
Views
Replies
Total Likes
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!
Views
Replies
Total Likes
Ideally, use IntelliJ IDEA 12 and Maven to build your applications.
/O
Views
Replies
Total Likes
Your CQ page output (the JSP) works correct?
You get this result:
[img]app.png[/img]
Views
Replies
Total Likes
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.
Views
Replies
Total Likes