Expand my Community achievements bar.

SOLVED

Error while calling method from the jsp.

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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.