Discovered where the magic happens for this in Glassfish. In the domain
directory is a default-web.xml which configures a system class path for the
embedded JSP compiler. It looks like the JAX-RS classes are not in there
anymore. The quickest fix is to remove that init-param it will
automatically scan all JARs in the glassfish modules directory. Yes this is
slower figuring out exactly what the list should look like but it gets the
jobs done.
On Mon, Feb 2, 2015 at 9:28 PM, NBW <emailnbw_at_gmail.com> wrote:
> I'm in the process of porting an EE6 app (single war) that deploys in
> GF3.1.2 and uses the associated JAX-RS/Jersey over to EE7 and Glassfish 4.1.
> The latest challenge is that when I hit a particular JSP
> I get the following error when GF tries to compile it. There are actually
> many lines like the one about accessing the Response class related to
> other JAX-RS classes (e.g. QueryParam, Consumes, Produces etc.)
>
> This JSP worked fine, as is, in GF 3.1.2. This looks like some sort of
> issue with the environment jspc is being run in by GF 4.1 but I haven't
> turned up any info in this area. The JSP itself is not using any of these
> JAX-RS classes though I suspect they may be pulled into the dependency chain
> at some depth by classes they do reference.
>
> Insights appreciated, thanks,
>
> -Noah
>
> PWC6197: An error occurred at line: 146 in the jsp file: /main2.jsp
> PWC6199: Generated servlet error:
> cannot access javax.ws.rs.core.Response
> class file for javax.ws.rs.core.Response not found
>
>
> at
> org.apache.jasper.compiler.DefaultErrorHandler.javacError(
> DefaultErrorHandler.java:129)
> at
> org.apache.jasper.compiler.ErrorDispatcher.javacError(
> ErrorDispatcher.java:299)
> at
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:392)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
> at
> org.apache.jasper.JspCompilationContext.compile(
> JspCompilationContext.java:625)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:375)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.
> java:377)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at
> org.apache.catalina.core.StandardWrapper.service(
> StandardWrapper.java:1682)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:318)
> at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:160)
> at
>