I am currently trying to call a custom java utility function that I wrote in the bundle section of my cq5 code. I am calling this from a components jsp.
In my common bundle I have a utility class under src/main/java. My package is something like com.test.utility and my file is jcrUtility.java. Inside the java file I have something like:
public static ArrayList<String> propertyToArrayList(Node n) { ... }
In my component's jsp file I have something like this:
<% page import="com.test.utility.jcrUtility"%> <% ArrayList<String> propList = jcrUtility.propertyToArrayList(currentNode); %>
In both my java class and my jsp file I have the correct other libraries imported such as java.util.ArrayList, javax.jcr.Node, etc. I have also compiled my OSGI bundle and updated it in the Bundles web console.
The current exception I am receiving is as follows:
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP: The method propertyToArrayList(Node n) is undefined for the type jcrUtility
Also, I have checked and my bundle is "Active" and my package is in the "Export Package". mported.
I am not sure what the problem is considering the java in my utility class and the java in my jsp looks sound. Any help would be appreciated.