[GLASSFISH-11208] JSP compiler Erro whit OSGI imported class Created: 29/Nov/09  Updated: 01/Jul/16

Status: Open
Project: glassfish
Component/s: OSGi-JavaEE
Affects Version/s: V3
Fix Version/s: not determined

Type: Bug Priority: Major
Reporter: sebglon Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: All

Issuezilla Id: 11,208
Status Whiteboard:


Tags: 3_1-exclude


have 2 bundle:
Bundla A --> a WAB bundle with a JSP pages
Bundle B --> that export class with static fields

The JSP pages (in Bundle A) use the exported class (in Bundle B)
When I want to see my page, i have compilation
error "org.apache.jasper.JasperException: PWC6033: Error in Javac compilation
for JSP"

Current GlassFish JSP compiler can't
see classes imported from another WAB. This is because it expects all
the dependencies to be specified in a classpath which it can pass onto
the javac. I have always felt, JSP compiler should use a classloader
backed JavaFileManager.

Forum Thread

Comment by sebglon [ 30/Nov/09 ]
      • Issue 11208 has been confirmed by votes. ***
Comment by kumara [ 30/Nov/09 ]

This is an extensive change and too risky for the v3 release targeted for next week. It will be addressed in
the next release.

Comment by Sanjeeb Sahoo [ 12/Oct/10 ]

Unfortunately, because of time constraints, we have to exclude this from 3.1 rel.

Comment by ruans [ 27/Jan/12 ]

Is there any fix for this in 3.* I've tried 3.1.2 build 26-01-2012 and the problem persists. I am forced to run my sites in karaf with pax and jetty at the moment. Much rather be using glassfish.

org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP

PWC6199: Generated servlet error:
string:///index_jsp.java:9: package com.net1.core.commons.web does not exist

PWC6199: Generated servlet error:
string:///index_jsp.java:10: package com.net1.core.commons.web.tag does not exist

PWC6199: Generated servlet error:
string:///index_jsp.java:11: package com.net1.core.commons.web.util does not exist

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:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

Comment by Sanjeeb Sahoo [ 30/Sep/13 ]

This issue is difficult to fix until JSP compiler allows us to use class loaders to be used for searching classes. So deferring it for now. Recommended work around is to use offline JSP compiler to precompile JSPs and package them in the WAB.

Comment by ejroberts [ 18/Oct/13 ]

One workaround is to push the use of the OSGi provided classes out of the JSP pages and into a local class available from within the WAB.

I have found that this manages to defer the class loading until such a point where it is then the compiled Servlet class that loads the OSGi provided classes.

Comment by PashaTurok [ 27/Dec/14 ]

The same I have in GlassFish 4.1. Five years have passed since this bug was fired. Can you say if you are going to fix it?

Comment by PashaTurok [ 05/Jan/15 ]

Please, anyone, answer my question. It's impossible to use jsp with this bug as it makes duplicate code and all soft architecture becomes a nightmare.

Comment by PashaTurok [ 01/Jul/16 ]

Here I described the suggested solution - use precompiling jsp files with GF 4.1 http://stackoverflow.com/questions/38139152/glassfish-4-and-offline-jsp-compiler I hope it will be useful for anyone.

Generated at Mon Feb 27 13:05:34 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.