ASF Bugzilla – Attachment 36169 Details for
Bug 62757
JspCompilationContext is unable to compile class for JSP due to a null tagHandlerClass in Generator.TagHandlerInfo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for the reported bug
tomcat_d_62757.patch (text/plain), 6.57 KB, created by
Jordi Llach
on 2018-09-27 18:14:45 UTC
(
hide
)
Description:
patch for the reported bug
Filename:
MIME Type:
Creator:
Jordi Llach
Created:
2018-09-27 18:14:45 UTC
Size:
6.57 KB
patch
obsolete
>Index: java/org/apache/jasper/compiler/TagFileProcessor.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- java/org/apache/jasper/compiler/TagFileProcessor.java (revision 59d43cee880bc5d490a524fc15600ddc2d3e2c78) >+++ java/org/apache/jasper/compiler/TagFileProcessor.java (revision ) >@@ -542,12 +542,11 @@ > wrapper = new JspServletWrapper(ctxt.getServletContext(), ctxt > .getOptions(), tagFilePath, tagInfo, ctxt > .getRuntimeContext(), tagJar); >- rctxt.addWrapper(wrapperUri, wrapper); >- > // Use same classloader and classpath for compiling tag files > wrapper.getJspEngineContext().setClassLoader( > ctxt.getClassLoader()); > wrapper.getJspEngineContext().setClassPath(ctxt.getClassPath()); >+ rctxt.addWrapper(wrapperUri, wrapper); > } else { > // Make sure that JspCompilationContext gets the latest TagInfo > // for the tag file. TagInfo instance was created the last >Index: java/org/apache/jasper/servlet/JspServletWrapper.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- java/org/apache/jasper/servlet/JspServletWrapper.java (revision 59d43cee880bc5d490a524fc15600ddc2d3e2c78) >+++ java/org/apache/jasper/servlet/JspServletWrapper.java (revision ) >@@ -88,7 +88,7 @@ > private long available = 0L; > private final ServletConfig config; > private final Options options; >- private boolean firstTime = true; >+ private volatile boolean firstTime = true; > /** Whether the servlet needs reloading on next access */ > private volatile boolean reload = true; > private final boolean isTagFile; >@@ -156,8 +156,16 @@ > return reload; > } > >+ public boolean getFirstTime() { >+ return firstTime; >+ } >+ > private boolean getReloadInternal() { >- return firstTime || reload && !ctxt.getRuntimeContext().isCompileCheckInProgress(); >+ return firstTime || (reload && !ctxt.getRuntimeContext().isCompileCheckInProgress()); >+ } >+ >+ private boolean mustCompile() { >+ return options.getDevelopment() || firstTime; > } > > public Servlet getServlet() throws ServletException { >@@ -170,11 +178,11 @@ > * possible (see BZ 62603) for a race condition to cause failures > * if a Servlet or tag is reloaded while a compile check is running > */ >- if (getReloadInternal()) { >+ if (getReloadInternal() || theServlet == null) { > synchronized (this) { > // Synchronizing on jsw enables simultaneous loading > // of different pages, but not the same page. >- if (getReloadInternal()) { >+ if (getReloadInternal() || theServlet == null) { > // This is to maintain the original protocol. > destroy(); > >@@ -256,10 +264,12 @@ > if (ctxt.isRemoved()) { > throw new FileNotFoundException(jspUri); > } >- if (options.getDevelopment() || firstTime ) { >+ if (mustCompile()) { > synchronized (this) { >- firstTime = false; >- ctxt.compile(); >+ if (mustCompile()) { >+ firstTime = false; >+ ctxt.compile(); >+ } > } > } else { > if (compileException != null) { >@@ -267,9 +277,13 @@ > } > } > >- if (getReloadInternal()) { >- tagHandlerClass = ctxt.load(); >- reload = false; >+ if (reload) { >+ synchronized (this) { >+ if (reload) { >+ tagHandlerClass = ctxt.load(); >+ reload = false; >+ } >+ } > } > } catch (FileNotFoundException ex) { > throw new JasperException(ex); >@@ -305,8 +319,12 @@ > Object target; > if (isTagFile) { > if (reload) { >- tagHandlerClass = ctxt.load(); >- reload = false; >+ synchronized (this) { >+ if (reload) { >+ tagHandlerClass = ctxt.load(); >+ reload = false; >+ } >+ } > } > target = tagHandlerClass.getConstructor().newInstance(); > } else { >@@ -374,12 +392,13 @@ > /* > * (1) Compile > */ >- if (options.getDevelopment() || firstTime ) { >+ if (mustCompile()) { > synchronized (this) { >- firstTime = false; >- >- // The following sets reload to true, if necessary >- ctxt.compile(); >+ if (mustCompile()) { >+ firstTime = false; >+ // The following sets reload to true, if necessary >+ ctxt.compile(); >+ } > } > } else { > if (compileException != null) { >Index: java/org/apache/jasper/compiler/JspRuntimeContext.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- java/org/apache/jasper/compiler/JspRuntimeContext.java (revision 59d43cee880bc5d490a524fc15600ddc2d3e2c78) >+++ java/org/apache/jasper/compiler/JspRuntimeContext.java (revision ) >@@ -374,11 +374,13 @@ > // it detects it has to do a reload > synchronized(jsw) { > try { >- ctxt.compile(); >- if (jsw.getReload()) { >- wrappersToReload.add(jsw); >+ if (!jsw.getFirstTime()) { >+ ctxt.compile(); >+ if (jsw.getReload()) { >+ wrappersToReload.add(jsw); >+ } > } >- } catch (FileNotFoundException ex) { >+ } catch (FileNotFoundException ex) { > ctxt.incrementRemoved(); > } catch (Throwable t) { > ExceptionUtils.handleThrowable(t);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 62757
: 36169 |
36186