Skip to main content
Level 2
Oct 16, 2015 2:29 AM UTC
Solved

Error while calling method from the jsp.

Hello,

I have a storeLocator class created which installed fine as a part of the bundle.

I imported the package to my jsp and instantiated the class.

While trying to call the the method of this class from the jsp,it gives following error

Caused by: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 21 in the generated java file
Only a type can be imported. com.svu.privatebrands.components.servlets.StoreLocatorServlet resolves to a package

 I am currently on AEM 6.1.

Cannot see anything in the code that might be causing an issue to find the required method.

Please help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Feb 16, 2016 3:17 PM UTC

Although replying after 5 months, hope it helps someone in future:

Make sure you are exporting this package or added this in export package list.

2 replies

edubey
edubeyAccepted solution
Level 10
Feb 16, 2016 3:17 PM UTC

Although replying after 5 months, hope it helps someone in future:

Make sure you are exporting this package or added this in export package list.

Translate
Feike_Visser1
Adobe Employee
Adobe Employee
Feb 16, 2016 4:29 PM UTC

And that the bundle is active.

Translate