views:

166

answers:

1

Hi, I am using StringUtils in my Java code written in Intellij IDEA. My server is resin 3.1.9. I have no problem compiling the code but when I ran it, i get the following runtime exception:

com.caucho.java.JavaCompileException:/sample.jsp:219: cannot find symbol symbol : method startsWithIgnoreCase(java.lang.String,java.lang.String) location: class org.apache.commons.lang.StringUtils

Am i missing something?

Thanks

+2  A: 

You said you are not having any compile time error. But in actuality this is a compile time error. You got this when your server tried to compile your JSP page. Show the code of your JSP at line no. 219.

Most probably you don't have the commons-lang jar file in your classpath, means you should add it in your applications WEB-INF/lib.

Adeel Ansari
Hi , I checked my WEB-INF/lib and the common-lang-2.4.jar is in it.
Pink Angel
Are you using Resin inside your IDE, or you are deploying it to Resin from outside? There might be the case, that you are looking at the wrong place.
Adeel Ansari
i am using resin inside my IDE
Pink Angel
Check out the values of your "server tab" and "deployment tab inside your IntelliJ/Resin settings. See if something is not right over there.
Adeel Ansari
Hi, Thank you for your very helpful responses. The error is now resolved. What I did was to add common-lang-2.4.jar in the classpath and also, added it in the build.xml to automatically copy this jar file in WEB-INF/lib. Thanks so much guys.
Pink Angel