13 Replies Latest reply on Apr 29, 2008 1:42 PM by 666705

    WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files

    666705
      I have a small custom tag library of three tag files. With the server running in development mode and the tag files in a JAR (included in WEB-INF/lib), the server appears to be doing a JSP recompile on every page load. However, it only compiles on the first page load if the tag files are included in WEB-INF/tags (no JAR). Also, running the server in production mode with the JAR'ed tag files avoids the recompile for every page load.
                
                Is that how the server should behave?
                
                For whatever it's worth, I'm also using Eclipse 3.3.2 with WTP and WebLogic Server Tools 1.1.2. The server is running the Sun JVM (1.5_10).
        • 1. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
          666705
          There was a bug in WLS 9.2 MP2. It has already been fixed. You can contact support to get the patch or wait for 9.2 MP3 release.
          • 2. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
            666705
            vbhatia,
                      Thanks for the quick reply. Would you happen to know the CR(s) I need to look for? I'm working through our corporate support people and it would help if I could point them to the right patch(es). Also, would this be included in MP3?
                      
                      Thanks again,
                      
                      Stephen
            • 3. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
              666705
              I've installed patch H6UC relating to CR334765, but it hasn't fixed the problem. The server is still recompiling the JSP pages whenever I have a JSP tag file distributed in a JAR file. Perhaps I'll try the full MP3 update to see if any other patches included there will fix it.
                        
                        Thanks,
                        Stephen
              • 4. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                666705
                It looks like page-check-seconds -1 was needed. Adding the following to my weblogic.xml seems to have fixed the problem.
                          
                          <wls:jsp-descriptor>
                          <wls:page-check-seconds>-1</wls:page-check-seconds>
                          </wls:jsp-descriptor>
                          
                          Nevertheless, it seems like there may still be a bug in the way WLS is handling JSP tag files in a JAR. Regardless of the polling interval, it shouldn't be recompiling the JSP's unless they've changed.
                          
                          Thanks,
                          Stephen
                          
                          --
                          Edited by Stephen Davison at 04/07/2008 11:18 AM
                • 5. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                  666705
                  If you add page-check-secs -1 in your webloigc.xml, jsp's will never be re-compiled in developed mode if you change them.
                            I feel the patch should have resolved your issue that it gets compiled on every request. Can you please post your generated java code from jsp file using keepgenerated option in weblogic.xml?
                  • 6. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                    666705
                    Vikram,
                              I went back and created a simple example to test. Below I'm posting the Java source code generated from the two relevant files: index.jsp, and hello.tag.
                              
                              __index.java:
                              
                              package jsp_servlet;
                              
                              import java.io.*;
                              import java.util.*;
                              import javax.servlet.*;
                              import javax.servlet.http.*;
                              import javax.servlet.jsp.*;
                              import javax.servlet.jsp.tagext.*;
                              
                              public final class __index extends weblogic.servlet.jsp.JspBase implements weblogic.servlet.jsp.StaleIndicator {
                              
                              private static void _releaseTags(javax.servlet.jsp.tagext.JspTag t) {
                              while (t != null) {
                              if(t instanceof javax.servlet.jsp.tagext.Tag) {
                              javax.servlet.jsp.tagext.Tag tmp = (javax.servlet.jsp.tagext.Tag)t;
                              t = ((javax.servlet.jsp.tagext.Tag) t).getParent();
                              try {
                              tmp.release();
                              } catch(Exception ignore) {}
                              }
                              else {
                              t = ((javax.servlet.jsp.tagext.SimpleTag)t).getParent();
                              }
                              }
                              }
                              
                              public boolean _isStale(){
                              boolean stale = staticIsStale((weblogic.servlet.jsp.StaleChecker) getServletConfig().getServletContext());
                              return _stale;
                              }
                              
                              public static boolean _staticIsStale(weblogic.servlet.jsp.StaleChecker sci) {
                              if (sci.isResourceStale("/index.jsp", 1207926672370L ,"9.2.2.0","America/Denver")) return true;
                              if (sci.isResourceStale("/null", 1207926783245L ,"9.2.2.0","America/Denver")) return true;
                              return false;
                              }
                              
                              private static void _writeText(javax.servlet.ServletResponse rsp, javax.servlet.jsp.JspWriter out, String block, byte[] blockBytes)
                              throws java.io.IOException {
                              if (!_WL_ENCODED_BYTES_OK || _hasEncodingChanged(rsp)){
                              out.print(block);
                              } else {
                              ((weblogic.servlet.jsp.ByteWriter)out).write(blockBytes, block);
                              }
                              }
                              
                              private static boolean _hasEncodingChanged(javax.servlet.ServletResponse rsp){
                              String encoding = rsp.getCharacterEncoding();
                              if ( "ISO-8859-1".equals(encoding) || "Cp1252".equals(encoding) || "ISO8859_1".equals(encoding) || "ASCII".equals(encoding) ){
                              return false;
                              }
                              if (_WL_ORIGINAL_ENCODING.equals(encoding)) {
                              return false;
                              }
                              return true;
                              }
                              
                              private static boolean WLENCODED_BYTES_OK = true;
                              private static final String WLORIGINAL_ENCODING = "ISO-8859-1";
                              
                              private static byte[] _getBytes(String block){
                              try {
                              return block.getBytes(_WL_ORIGINAL_ENCODING);
                              } catch (java.io.UnsupportedEncodingException u){
                              WLENCODED_BYTES_OK = false;
                              }
                              return null;
                              }
                              
                              private final static String wlblock0 ="<!--\n * $Id$\n-->\n \n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \n\t\t\"http://www.w3.org/TR/html4/loose.dtd\">\n \n";
                              private final static byte[] wlblock0Bytes = getBytes( wl_block0 );
                              
                              private final static String wlblock1 =" \n \n\t";
                              private final static byte[] wlblock1Bytes = getBytes( wl_block1 );
                              
                              private final static String wlblock2 ="\n";
                              private final static byte[] wlblock2Bytes = getBytes( wl_block2 );
                              
                              private final static String wlblock3 ="\n\n<html>\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n\n\t<title>Tag File Test</title>\n</head>\n<body> \n\t";
                              private final static byte[] wlblock3Bytes = getBytes( wl_block3 );
                              
                              private final static String wlblock4 ="\n</body>\n</html>";
                              private final static byte[] wlblock4Bytes = getBytes( wl_block4 );
                              
                              static private javelin.jsp.JspFunctionMapper jspxfnmap = javelin.jsp.JspFunctionMapper.getInstance();
                              
                              public void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
                              throws javax.servlet.ServletException, java.io.IOException {
                              
                              javax.servlet.ServletConfig config = getServletConfig();
                              javax.servlet.ServletContext application = config.getServletContext();
                              javax.servlet.jsp.tagext.JspTag _activeTag = null;
                              Object page = this;
                              javax.servlet.jsp.JspWriter out;
                              javax.servlet.jsp.PageContext pageContext = javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true , 8192 , true );
                              response.setHeader("Content-Type", "text/html; charset=ISO-8859-1");
                              out = pageContext.getOut();
                              javax.servlet.jsp.JspWriter _originalOut = out;
                              javax.servlet.http.HttpSession session = request.getSession( true );
                              try {;
                              response.setContentType("text/html; charset=ISO-8859-1");
                              {_writeText(response, out, _wl_block0, _wl_block0Bytes);}
                              {_writeText(response, out, _wl_block1, _wl_block1Bytes);}
                              {_writeText(response, out, _wl_block2, _wl_block2Bytes);}
                              {_writeText(response, out, _wl_block3, _wl_block3Bytes);}
                              jsp_servlet._tags.__hello_tag __tag0 = null ;
                              int __result__tag0 = 0 ;
                              
                              if (__tag0== null )__tag0 = new jsp_servlet._tags.__hello_tag ();
                              __tag0.setJspContext(pageContext);
                              __tag0.setParent(null);
                              activeTag=_tag0;
                              __tag0.doTag();
                              {_writeText(response, out, _wl_block4, _wl_block4Bytes);}
                              } catch (Throwable __ee){
                              if(!(__ee instanceof javax.servlet.jsp.SkipPageException)) {
                              while ((out != null) && (out != _originalOut)) out = pageContext.popBody();
                              releaseTags(activeTag);
                              pageContext.handlePageException(__ee);
                              }
                              }
                              }
                              }
                              
                              
                              __hello_tag.java:
                              
                              package jsp_servlet . _tags ;
                              
                              import java.io.*;
                              import java.util.*;
                              import javax.servlet.*;
                              import javax.servlet.http.*;
                              import javax.servlet.jsp.*;
                              import javax.servlet.jsp.tagext.*;
                              
                              
                              public final class __hello_tag extends javax.servlet.jsp.tagext.SimpleTagSupport {
                              
                              private static void _releaseTags(javax.servlet.jsp.tagext.JspTag t) {
                              while (t != null) {
                              if(t instanceof javax.servlet.jsp.tagext.Tag) {
                              javax.servlet.jsp.tagext.Tag tmp = (javax.servlet.jsp.tagext.Tag)t;
                              t = ((javax.servlet.jsp.tagext.Tag) t).getParent();
                              try {
                              tmp.release();
                              } catch(Exception ignore) {}
                              }
                              else {
                              t = ((javax.servlet.jsp.tagext.SimpleTag)t).getParent();
                              }
                              }
                              }
                              
                              public static boolean _staticIsStale(weblogic.servlet.jsp.StaleChecker sci) {
                              if (sci.isResourceStale("/META-INF/tags/hello.tag", 1207926783175L ,"9.2.2.0","America/Denver")) return true;
                              return false;
                              }
                              protected static final String tagxTagInfo = "-84,-19,0,5,116,0,5,104,101,108,108,111,116,0,29,106,115,112,95,115,101,114,118,108,101,116,46,95,116,97,103,115,46,95,95,104,101,108,108,111,95,116,97,103,116,0,5,101,109,112,116,121,112,112,112,112,119,5,0,0,0,0,3,116,0,10,106,115,112,67,111,110,116,101,120,116,119,1,0,116,0,28,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,74,115,112,67,111,110,116,101,120,116,113,0,126,0,4,119,1,1,112,119,2,1,0,112,112,116,0,7,106,115,112,66,111,100,121,119,1,0,116,0,36,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,116,97,103,101,120,116,46,74,115,112,70,114,97,103,109,101,110,116,113,0,126,0,6,119,1,1,112,119,2,1,0,112,112,116,0,6,112,97,114,101,110,116,119,1,0,116,0,31,106,97,118,97,120,46,115,101,114,118,108,101,116,46,106,115,112,46,116,97,103,101,120,116,46,74,115,112,84,97,103,113,0,126,0,8,119,1,1,112,119,2,1,0,112,112,119,4,0,0,0,0,112,112,";
                              
                              
                              protected JspContext jspContext ;
                              
                              public void setJspContext ( JspContext ctx ){
                              super . setJspContext ( ctx );
                              java.util.List nested = null ;
                              java.util.List atBegin = null ;
                              java.util.List atEnd = null ;
                              this.jspContext = new javelin.jsp.JspContextWrapper(ctx, nested, atBegin, atEnd, null);
                              }public JspContext getJspContext() {
                              return this.jspContext;
                              }
                              private java.io.Writer jspxsout;
                              private javax.servlet.jsp.tagext.JspTag _activeTag;
                              
                              private static void _writeText(javax.servlet.ServletResponse rsp, javax.servlet.jsp.JspWriter out, String block, byte[] blockBytes)
                              throws java.io.IOException {
                              if (!_WL_ENCODED_BYTES_OK || _hasEncodingChanged(rsp)){
                              out.print(block);
                              } else {
                              ((weblogic.servlet.jsp.ByteWriter)out).write(blockBytes, block);
                              }
                              }
                              
                              private static boolean _hasEncodingChanged(javax.servlet.ServletResponse rsp){
                              String encoding = rsp.getCharacterEncoding();
                              if ( "ISO-8859-1".equals(encoding) || "Cp1252".equals(encoding) || "ISO8859_1".equals(encoding) || "ASCII".equals(encoding) ){
                              return false;
                              }
                              if (_WL_ORIGINAL_ENCODING.equals(encoding)) {
                              return false;
                              }
                              return true;
                              }
                              
                              private static boolean WLENCODED_BYTES_OK = true;
                              private static final String WLORIGINAL_ENCODING = "ISO-8859-1";
                              
                              private static byte[] _getBytes(String block){
                              try {
                              return block.getBytes(_WL_ORIGINAL_ENCODING);
                              } catch (java.io.UnsupportedEncodingException u){
                              WLENCODED_BYTES_OK = false;
                              }
                              return null;
                              }
                              
                              private final static String wlblock0 ="\n<center><h1>Hello World</h1></center>";
                              private final static byte[] wlblock0Bytes = getBytes( wl_block0 );
                              
                              static private javelin.jsp.JspFunctionMapper jspxfnmap = javelin.jsp.JspFunctionMapper.getInstance();
                              public void doTag() throws JspException, java.io.IOException {
                              javax.servlet.jsp.PageContext pageContext = (javax.servlet.jsp.PageContext) getJspContext();
                              javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) pageContext.getRequest ();
                              javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse) pageContext.getResponse();
                              javax.servlet.http.HttpSession session = pageContext.getSession();
                              javax.servlet.ServletContext application = pageContext.getServletContext();
                              javax.servlet.ServletConfig config = pageContext.getServletConfig();
                              javax.servlet.jsp.JspWriter out = jspContext.getOut();
                              javax.servlet.jsp.tagext.JspTag _activeTag = null;
                              try {
                              {_writeText(response, out, _wl_block0, _wl_block0Bytes);}
                              } catch ( Throwable t ){
                              if( t instanceof javax.servlet.jsp.SkipPageException )
                              {throw (javax.servlet.jsp.SkipPageException)t;}
                              if( t instanceof java.io.IOException )
                              {throw (java.io.IOException)t;}
                              if( t instanceof IllegalStateException )
                              {throw (IllegalStateException)t;}
                              if( t instanceof javax.servlet.jsp.JspException )
                              {throw (javax.servlet.jsp.JspException)t;}
                              throw new javax.servlet.jsp.JspException(t);
                              }
                              finally {
                              ((javelin.jsp.JspContextWrapper)jspContext).syncEndTagFile();
                              }
                              }
                              }
                              
                              --
                              Edited by Stephen Davison at 04/11/2008 9:02 AM
                    • 7. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                      666705
                      I also double-checked to make sure the patch is being loaded. Below is the evidence from the console output:
                                
                                Starting WLS with line:
                                C:\bea\JDK150~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -Xverify:none -da -Dplatform.home=C:\bea\WEBLOG~2 -Dwls.home=C:\bea\WEBLOG~2\server -Dwli.home=C:\bea\WEBLOG~2\integration -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\bea\patch_weblogic922\profiles\default\sysext_manifest_classpath -Dweblogic.Name=AdminServer -Djava.security.policy=C:\bea\WEBLOG~2\server\lib\weblogic.policy weblogic.Server
                                <Apr 11, 2008 10:04:25 AM MDT> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
                                C:\bea\weblogic92\platform\lib\p13n\p13n-schemas.jar;C:\bea\weblogic92\platform\lib\p13n\p13n_common.jar;C:\bea\weblogic92\platform\lib\p13n\p13n_system.jar;C:\bea\weblogic92\platform\lib\wlp\netuix_common.jar;C:\bea\weblogic92\platform\lib\wlp\netuix_schemas.jar;C:\bea\weblogic92\platform\lib\wlp\netuix_system.jar;C:\bea\weblogic92\platform\lib\wlp\wsrp-common.jar>
                                <Apr 11, 2008 10:04:26 AM MDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.5.0_10-b03 from Sun Microsystems Inc.>
                                <Apr 11, 2008 10:04:28 AM MDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for CR334765 Fri Sep 07 16:12:12 PDT 2007
                                WebLogic Server Temporary Patch for CR328282 Thu Nov 08 13:39:13 EST 2007
                                WebLogic Temporary Patch for CR319130 Mon Jul 02 14:36:16 EDT 2007
                                WebLogic Server Temporary Patch for CR345092 Wed Oct 24 10:56:58 IST 2007
                                WebLogic Server 9.2 MP2 Mon Jun 25 01:32:01 EDT 2007 952826 >
                      • 8. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                        666705
                        I dont see the issue which has been fixed by CR334765. Are you modifying your jsp file, and finding associated tag file also getting compiled along with it. Can you also verify if you see the same issue with latest MP 9.2 MP3?
                        • 9. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                          666705
                          I dont see the issue which has been fixed by
                                    > CR334765.
                                    
                                    I thought CR334765 was to fix JSP pages recompiling unnecessarily.
                                    
                                    > Are you modifying your jsp file, and
                                    > finding associated tag file also getting compiled
                                    > along with it.
                                    
                                    No, I am not modifying any JSP files, but they get recompiled on every page load; including the tag files.
                                    
                                    > Can you also verify if you see the
                                    > same issue with latest MP 9.2 MP3?
                                    
                                    I'll try that.
                          • 10. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                            666705
                            Vikram,
                                      Have you by any chance tried to recreate the problem I'm having? I'd be happy to e-mail the WAR for the trivial example I posted earlier.
                                      
                                      Thanks,
                                      Stephen
                            • 11. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                              666705
                              I am currently busy, so I haven't tried. If you have a testcase, can you please contact support and inform them about this issue?
                                        
                                        Thanks
                                        Vikram
                              • 12. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                                666705
                                Vikram,
                                          Just following up to let you know that I am having the same issue with WLS 9.2.3. I also tried Tomcat 6 and found it compiles the JAR'ed tag file only one time -- on first page load.
                                          
                                          Thanks,
                                          Stephen
                                • 13. Re: WLS 9.2.2: JSP recompile for every page load with JAR'ed tag files
                                  666705
                                  Just following up to inform that CR369053 is now open for this issue.