WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Replace class file from Websphere JVM

Prakash Yadav

Prakash YadavSat October 26, 2013 12:49 PM

Prakash Yadav

Prakash YadavSat October 26, 2013 12:50 PM

Viswanath M

Viswanath MWed October 30, 2013 06:47 AM

Gabriel Aberasturi

Gabriel AberasturiWed October 30, 2013 01:02 PM

Prakash Yadav

Prakash YadavThu October 31, 2013 02:21 AM

  • 1.  Replace class file from Websphere JVM

    Posted Fri October 25, 2013 05:25 AM
    Hi,
          My project requires dynamic replacement of  class file. At runtime we are creating one class file and requires to be replace old class file with new one.
    Sugest me way to do this.


    Thanks in advance. 


  • 2.  Replace class file from Websphere JVM

    Posted Fri October 25, 2013 07:00 AM

    Hi PYadav

      I suggest the class reloading and update detecction settings.  Look this configuration (you have the same in previous versions)

      Class loading and update detection settings
      pic.dhe.ibm.com/infocenter/wasinfo/v8r5/...
     
      Hope this helps.
     
    kind regards


  • 3.  Replace class file from Websphere JVM

    Posted Fri October 25, 2013 01:53 PM
    Hi Gabriel,
                      Thanks for reply.But in that process server stops for a while.I don't want to stop my server.Without stoping server i want to replace my old class file  with new one like reloding of jsp page.But i am not geting any concrete reference material about jsp page reloding without server restart.


  • 4.  Replace class file from Websphere JVM

    Posted Sat October 26, 2013 12:49 PM
    Hi,
        anyone have solution.Please help me.


  • 5.  Replace class file from Websphere JVM

    Posted Sat October 26, 2013 12:50 PM
    Hi,
        anyone have solution.Please help me.


  • 6.  Replace class file from Websphere JVM

    Posted Tue October 29, 2013 07:27 AM
    Hi,
         Can any one guide me for dynamic class reloading(replacing old .class file with new .class file) in Websphere without restarting server.It is blocker for me to do complete my activity.


  • 7.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 06:31 AM
    Hi PYadav,

    I dont think so u can replace old with new class file without restarting the server as we know lot of xml files needs to get updated during the process.

    or else go ahead with the option " RolloutUpdate"  if u r in distributed environment.


    Correct me if i  am wrong.  Thank you




    Cheers.


  • 8.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 06:40 AM
    Hi PYadav

      The only workaround that I know is that Aziz provide in this thread
     
      www.websphereusergroup.org/go/thread/vie...
     
      2) You can clear Websphere temporary (temp/Application Name) folder so that your application jsp and classes are reloaded.  This workaround doesnt need Websphere JVM restart.
     
      or as KASI M suggests a rolloupdate but in this case take in mind that the server is restarted not the application

    regards


  • 9.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 06:47 AM


  • 10.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 07:25 AM
    Hi Gabriel and Kasi,
               Thank you for reply. But i have a doubt, if the class reloading is not possible programatically without restarting the server then how the Jsp page reloading happens without restarting server. Internally jsp also converted into servlet only and then modified class is reloaded by JSpEngine. I am looking for that jsp reloading mechanism but i haven't find concrete reference.



    Correct me if i am wrong.
          


  • 11.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 08:44 AM
    PYadav,

      Care, with "Class loading and update detection settings" only the application is restarted NOT the server. With rolloupdate the server is restarted.
     
      If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after you save the change. On multiple-server products, the application restarts after you save the change and files synchronize on the node where the application is installed.

     If an application's class definition changes, the application server run time stops and starts the application to reload application classes.
     
      Is diferent to restart an application than a server.
     
    regards


  • 12.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 10:50 AM
    Hi Gabriel,
            I am very happy for your quick and explanatory response. Thank You.

            I tried using Class loading and update detection settings.  But it stops the server while reloading of application is in progress. I will explain about my requirement correctly.
                   I am working on a Web project. In our project, we are executing some task after some condition results in true. But  we are taking that condition(Java if block and we are calling that as RULE) from some configuration file that is editable by admin. so admin can edit that and update it back. And we are taking that RULE from file and construct a new class file. And now we have to update class file. And we can not afford to restart server each time whenever admin updates the RULE.Class loading and update detection settings stops the server for a while.

                   In java code we can update class file directly using hot swap mechanism ( docs.oracle.com/javase/1.4.2/docs/guide/... )but that's not working in WebSphere.

    Regards,
    Prakash
     


  • 13.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 01:02 PM
    PYadav,

      Which version of WAS do you have?

      Thanks.

    regards


  • 14.  Replace class file from Websphere JVM

    Posted Wed October 30, 2013 01:25 PM
    PYadav,

      look the next links please
     
        Ways to update application files
        pic.dhe.ibm.com/infocenter/wasinfo/v6r1/...
        
        Managing applications through programming
        http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/tjmx_updating_app.html

        IBM WebSphere Developer Technical Journal: System management for WebSphere Application Server V6 -- Part 5
        Flexible options for updating deployed applications
        http://www.ibm.com/developerworks/websphere/techjournal/0510_apte/0510_apte.html

      Hope this helps.
     
    regards


  • 15.  Replace class file from Websphere JVM

    Posted Thu October 31, 2013 02:21 AM
    Hi Gabriel,
           I am using WebSphere7.0 


  • 16.  Replace class file from Websphere JVM

    Posted Thu October 31, 2013 03:57 PM
    PYadav

      The links are valid to WAS 7 too
     
      Ways to update application files
      pic.dhe.ibm.com/infocenter/wasinfo/v7r0/...
     
      Managing applications through programming
      pic.dhe.ibm.com/infocenter/wasinfo/v7r0/...
     
      and from WAS 7 infocenter...
     
      If the application is updated while it is running, WebSphere Application Server automatically stops the application, updates the application logic and restarts the application. If the application does not start automatically, start it manually using one of the Starting options. For more information on the restarting of updated applications, refer to "Fine-grained recycle behavior" in IBM® WebSphere Developer Technical Journal: System management for WebSphere Application Server Version 6.0 -- Part 5 Flexible options for updating deployed applications.
     
       IBM WebSphere Developer Technical Journal: System management for WebSphere Application Server V6 -- Part 5
        Flexible options for updating deployed applications
        www.ibm.com/developerworks/websphere/tec...
        
    regards


  • 17.  Replace class file from Websphere JVM

    Posted Sun November 10, 2013 04:55 AM
    Hi,

    Can u try using "Polling interval for updated files" option under Enterprise Application>"Application Name" > Class loader ?

    Please make sure you check "Override class reloading settings for Web and EJB modules" Check Box to use the same..


    Class reloading options










    Override class reloading settings for Web and EJB modules 

    Polling interval for updated files
     Seconds



    Polling interval for updated files

    Specifies the number of seconds to scan the application's file system for updated files. The default is the value of the reloading interval attribute in the IBM extension (META-INF/ibm-application-ext.xmi) file of the EAR file.


    This Polling interval for updated files setting is the same as the Reload interval in seconds field on the application installation and update wizards.


    To enable reloading, specify a value greater than zero (for example, 1 to 2147483647). To disable reloading, specify zero (0). The range is from 0 to 2147483647.


    The reloading interval attribute takes effect only if class reloading is enabled.

















    Data type Long
    sep2012

    UnitsSeconds
    Default3



  • 18.  Replace class file from Websphere JVM

    Posted Mon November 11, 2013 04:14 AM
    Hi

    This is the first Time i have come across  the term "polling interval for updates files" in your above post. Can anyone plz let me know what it does mean.   Thank you.



    Cheers.