How do I have weblogic reload cached JSPs on restart

后端 未结 2 1488
迷失自我
迷失自我 2021-01-02 06:18

Our method of deploying a new version of an app for weblogic (11g) is to copy over top of the existing ear file and then stop and restart the weblogic server. We do a start/

相关标签:
2条回答
  • 2021-01-02 06:33

    To avoid this you should first update your Module and then restart the server..this should fix your problem.

    Although process mentioned by is always give 100% correctness. But you can try above mentioned steps.

    0 讨论(0)
  • 2021-01-02 06:49

    Changing the JSP refresh timer

    A standard solution is to tell Weblogic to check JSP freshness more frequently by either setting the value in your web.xml or in your weblogic.xml.

    In production mode, Weblogic won't check for new JSP versions (default value: -1) while it does each second in development mode (default value: 1).

    The choice between modifying web.xml or weblogic.xml is up to you, regarding the application servers you target, being WebLogic only or not.

    If you prefer to modify web.xml, then set a value for the context parameter weblogic.jsp.pageCheckSeconds as follows:

    <context-param>
      <param-name>weblogic.jsp.pageCheckSeconds</param-name>
      <param-value>0</param-value>
    </context-param>
    

    If you prefer to modify weblogic.xml, then set a value for parameter page-check-seconds in the jsp-descriptor section. Here is the relevant excerpt from the documentation:

    Sets the interval, in seconds, at which WebLogic Server checks to see if JSP files have changed and need recompiling. Dependencies are also checked and recursively reloaded if changed. The value -1 means never check the pages. This is the default value in a production environment. The value 0 means always check the pages. The value 1 means check the pages every second. This is the default value in a development environment. In a production environment where changes to a JSP are rare, consider changing the value of pageCheckSeconds to 60 or greater, according to your tuning requirements.

    Source: http://docs.oracle.com/cd/E21764_01/web.1111/e13712/weblogic_xml.htm#i1038490

    Forcing redeployment

    Restarting Weblogic server does not force it to redeploy a Web Application (especially in production mode).

    Solution Trigger explicitly the "redeploy" life-cycle operation using command line like this:

    java -cp weblogic.jar weblogic.Deployer -redeploy [-remote -adminurl t3://hostname:hostport] -username login -password password -name webapp.name [-upload -source webapp.war]
    
    • Note that -redeploy is WAYS much safer than -update, esp. with Weblogic <= 10.x

    • Keep first block between [ ], only if the server is not local. Remove the [ ] in that case.

    • Keep second block between [ ], if you want to combine the WAR file uploading in the same step, which is way simpler. Remove the [ ] in that case.

    0 讨论(0)
提交回复
热议问题