• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hotfix Code in tomcat container running groovy application

 
Greenhorn
Posts: 2
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Current I m running my application on Java/J2ee/JSP using tomcat server. I would like to move to groovy grails application as
I heard groovy is dynamic, and we can do code change during runtime on tomcat container similar to JSP/GSPs. I tried alot to find the dynamic groovy code changes using MetaClass programming and ExpandoMetaClass, following are the references.

Reference URLs

  • Hot-fixing Code running inside Web Container with Groovy

  • http://stackoverflow.com/questions/1390243/hotfixing-code-running-inside-web-container-with-groovy

  • Modifying groovy code at run-time in grails application

  • http://stackoverflow.com/questions/2760735/modifying-groovy-code-at-runtime-in-grails-application

  • Embedding a Groovy Console in a Java Server Application

  • http://groovy.codehaus.org/Embedding+a+Groovy+Console+in+a+Java+Server+Application

  • Run-time vs Compile time, Static vs Dynamic

  • http://groovy.codehaus.org/Runtime+vs+Compile+time,+Static+vs+Dynamic

  • Compile Time and Run-time Meta-programming With Groovy

  • http://www.slideshare.net/openblend/open-blend-2010-groovy-metaprogramming-jeff-brown


    Still no luck for me to get the hot-fix on tomcat container. Please help me in understanding how can I fix the code on tomcat without server restart.

    -AMIT
     
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Grails reloads modified classes while running the application in development mode. In production, this is turned off because it is not performant.
     
    Amit Kulkarni
    Greenhorn
    Posts: 2
    Spring Tomcat Server Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Gregg!!!

    Following is my concern, I have built a development war and deployed it on external tomcat server and tried to change the groovy files, but I m not finding it under war exploded. If I change the files in the source directory how it reloads it? But for GSPs exists under webapps.

    Your help will be appreciated. Thanks once again for quick response.

    -AMIT
     
    Gregg Bolinger
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    From the grails docs:

    This target is not intended for deployment as the container in development mode is configured to auto-reload changes at runtime which has an overhead attached to it and will not scale well.



    It's not because it's a development WAR but because the embedded container that Grails uses (Tomcat by default) is configured to auto-reload changes. So it is kind of a combination. But when you deploy to an external container, regardless of the environment you build the WAR for, it won't auto-reload. Also, when you build the WAR, you won't find groovy files. They get compiled to bytecode.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic