title: CQ5 Calling Custom Utility Methods in JSP
body: <p>I am currently using CQ5 and 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.</p>
  
  <p>In my common bundle I have a utility class under <em>src/main/java</em>. My package is something like <em>com.test.utility</em> and my file is <em>jcrUtility.java</em>. Inside the java file I have something like:</p>
  
  <pre><code>public static ArrayList&lt;String&gt; propertyToArrayList(Node n) { ... }
  </code></pre>
  
  <p>In my component's jsp file I have something like this:</p>
  
  <pre><code>&lt;% page import="com.test.utility.jcrUtility"%&gt;
  &lt;% 
     Node n = currentNode;
     ArrayList&lt;String&gt; propList = jcrUtility.propertyToArrayList(n);
  %&gt;
  </code></pre>
  
  <p>In both my java class and my jsp file I have the correct other libraries imported such as <em>java.util.ArrayList</em>, <em>javax.jcr.Node</em>, etc. I have also compiled my OSGI bundle and updated it in the Bundles web console.</p>
  
  <p>The current exception I am receiving is as follows:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>