Hi,
I am a facing issues with JSP compiling. The classes imported in JSP not getting resolved. Getting errors like "Only a type can be imported.and class cannot resolves to a package."
Sometimes it works fine in Author but in publish getting the errors above. Tried the deleting files under "/var/classes/org/apache/jsp" but didnt help.
Any solution to counter this issue with be very helpful. I am using AEM 5.6 version.
Solved! Go to Solution.
Views
Replies
Total Likes
Bundle in felix has export package value ie all package services are exported. The package name has been added in pom file as well. Today again rebuilt the whole project again and uploaded the bundle via felix console. It started working. Thanks to everyone. This happens frequently. Any suggestions/things or steps to keep in mind while creating a service or calling service from JSP to avoid this issue in future as am not able to find out the root cause yet.
Views
Replies
Total Likes
Are you getting service object using sling.getService(...), but importing a class than an interface of a service?.
---jitendra
Views
Replies
Total Likes
I am assuming your code is working fine and bundle is in active state.
If its your local publish, try recompiling jsp again using the approach suggested here..
Views
Replies
Total Likes
edubey wrote...
I am assuming your code is working fine and bundle is in active state.
If its your local publish, try recompiling jsp again using the approach suggested here..
http://adobeaemclub.com/unable-to-recompile-cq5-jsp/
Thanks, this help me
Views
Replies
Total Likes
edubey wrote...
I am assuming your code is working fine and bundle is in active state.
If its your local publish, try recompiling jsp again using the approach suggested here..
http://adobeaemclub.com/unable-to-recompile-cq5-jsp/
Tried the approach, but still the facing the same issue..
Views
Replies
Total Likes
Have you exported you package?
Go to bundle description in felix console and can you see your package in export list?
Views
Replies
Total Likes
As edubey mentioned, check the bundle in felix console and click on the bundle and see the exported packages value.
If it is empty, click on the refresh packages button on top right.
If its still empty, then check the pom.xml of the project and add the package to exported packages tag
or move the specific class that you are calling in your jsp to a package which is exported, There are several ways you can fix it.
Views
Replies
Total Likes
Bundle in felix has export package value ie all package services are exported. The package name has been added in pom file as well. Today again rebuilt the whole project again and uploaded the bundle via felix console. It started working. Thanks to everyone. This happens frequently. Any suggestions/things or steps to keep in mind while creating a service or calling service from JSP to avoid this issue in future as am not able to find out the root cause yet.
Views
Replies
Total Likes
Views
Likes
Replies