Hi,
I am getting below error when i try to access the custom page created
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.PageContext not found by <custom package> [502]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550)
Same error is repeated for all java classes. I mean i created a component and calling java class from component jsp. I am passing currentNode, pageContext etc... from jsp to java class. There are no issues with compilation. But when i access the page with above component getting no class def found for all classes.
Caused by: java.lang.ClassNotFoundException: javax.jcr.Node not found by <custom package> [505]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550)
Appreciated for any help
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Where does your Java class live? Inside an OSGI bundle? Or is it just sitting next to the JSP file? In the first case (which I personally recommend) you need to make sure, that the OSGI bundle contains all relevant OSGI imports. Which is done by default correct if you use the maven-bundle plugin (as setup by the various archetypes for AEM/CQ5, which are floating around ...)
kind regards,
Jörg
Views
Replies
Total Likes
What version of AEM are you using?
Let me see if i got this straight. You're reading page props using a JSP. ie -
String pageTitle = currentPage.getTitle();
Then you pass these values to a Java OSGi service and then you try to access the page from Java -- and you get these exceptions?
Are you using JCR API or using SLing API? What other Java libs are you using?
Please provide a bit more details - including the CQ version.
Views
Replies
Total Likes
Hi Scott,
I am using AEM 6.0 which is deployed in tomcat server. From component jsp, i am calling a java class method by passing pageContext object. In java class method i am using pageconext object to retrieve request, response, currentNode etc...I am getting above exception whenever pagecontext used to get something
Even when i passed currentNode from jsp to java, even i am getting same error with javax.jcr.node not found
Views
Replies
Total Likes
It's best to pass primitive data types between components and backend Java OSGi Java bundles. A JS object is not a Java object.
Pass a string value that represents the path and then create the object in Java using the APIs.
Views
Replies
Total Likes
Hi,
Where does your Java class live? Inside an OSGI bundle? Or is it just sitting next to the JSP file? In the first case (which I personally recommend) you need to make sure, that the OSGI bundle contains all relevant OSGI imports. Which is done by default correct if you use the maven-bundle plugin (as setup by the various archetypes for AEM/CQ5, which are floating around ...)
kind regards,
Jörg
Views
Replies
Total Likes
See this article that uses Sling API and uses location passed in from front end:
https://helpx.adobe.com/experience-manager/using/using-sling-apis.html
The page object is not passed - it's a primitive data type that is passed. Then using the string values - we create the com.day.cq.wcm.api.Page instance.
Views
Replies
Total Likes