What could be causing this error? Javadoc for File.java says that it will throw this exception if it gets passed a negative value. So, the question is why jasper passes a negative meaning. I searched for the sources of jasper, but I did not find those that match exactly with what I use, the line numbers do not exactly match. The version on which I am setting the last modified time from File.lastModified, which should never return a negative value, according to javadoc.
SEVERE: Servlet.service() for servlet jsp threw exception java.lang.IllegalArgumentException: Negative time at java.io.File.setLastModified(File.java:1258) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:376) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
...
UPDATE: I downloaded sources for Tomcat and read the sources. Relevant code from Compile.java:
375 File javaFile = new File(ctxt.getServletJavaFileName()); 376 Long jspLastModified = ctxt.getLastModified(ctxt.getJspFile()); 377 javaFile.setLastModified(jspLastModified.longValue());
ctxt is a JspCompilationContext that by default returns -1 by default if there are any errors, and File throws an IllegalArgumentException from the negative argument. I still don't know why I get the error message, at least I know where the IllegalArgumentException comes from.
mmorrisson
source share