Dynamically generated .jsp files : PWC6117 error using jetty-maven-plugin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Dynamically generated .jsp files : PWC6117 error using jetty-maven-plugin


I'm not sure this is the correct place to get help for this problem. Sorry if this is not the case.

I develop locally using Spring MVC, Maven and the jetty-maven-plugin plugin.

I know some of you will think this is not a good idea, but I automatically generate some .jsp files. I have, for example, a dyn.js file which I want to be dynamic, to contain JSTL/EL code.

In short here's what I do :

- If the dynamic dyn.js is called and an interpreted cache version doesn't exist yet, I redirect the request to a special controller.

- The controller takes the content of the dyn.js file and create a dyn.js.jsp file with this content, in the same directory where my other .jsp files are. I get that directory, at runtime, using something like :

        getServletContext().getRealPath("/") + File.separator + "WEB-INF" + File.separator + "tags"

- Once the jsp file is generated, my controller returns the view path (or a ModelAndView) so the view can be processed.

- Once the view is finally rendered, I get the resulting content (using a custom Response wrapper in a filter), and I save it to a cache file.

This method works great! I'm pretty happy with it.

The only problem, is that sometimes I get this error when trying to generate the dynamic dyn.js :

    Jul 8, 2012 5:15:12 PM org.apache.jasper.servlet.JspServlet _serviceJspFile
    SEVERE: PWC6117: File "C:\somepath\src\main\webapp\WEB-INF\tags\dyn.js.jsp" not found

When this happens, there is nothing to do. Even if I refresh the page the jsp is never found so my dyn.js doesn't work. I then check and the .jsp file does exist in my file system (C:\somepath\src\main\webapp\WEB-INF\tags\dyn.js.jsp)!

This issue seems to happen randomly. I'm not able to reproduce the problem at will. I'd say it happens 1/5 of the time.

It seems Jetty is not able to "see" the generated .jsp file in some situations.

Any idea what can triggers this issue and how I could fix it?

Thanks in advance!