how to cause tomcat to automatically reload a changed javabean?

Discussion in 'Java' started by Alex Hunsley, Sep 3, 2004.

  1. Alex Hunsley

    Alex Hunsley Guest

    I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
    javabeans I have written.
    Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
    reload a servlet if the class file had changed (recompiled), but it's not
    noticing that I have recompiled the classes that define javabeans. At the
    moment I am stopping and restarting tomcat to force a reload of the javabean
    classes.

    I've tried closing my browser then loading the page again in a new instance of
    the browser (because my jsp pages have the 'session' scope and I wondered if
    this was the problem) but tomcat is still not using the new javabean class file.

    Any hints anyone? Currently plunging through the docs as googling didn't bring
    up much...

    thanks
    alex
     
    Alex Hunsley, Sep 3, 2004
    #1
    1. Advertising

  2. On Fri, 03 Sep 2004 15:42:22 +0100, Alex Hunsley
    <> wrote:

    > I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
    > javabeans I have written.
    > Tomcat seems to recompile changed jsp files just fine, and AFAIK it
    > would reload a servlet if the class file had changed (recompiled), but
    > it's not noticing that I have recompiled the classes that define
    > javabeans. At the moment I am stopping and restarting tomcat to force a
    > reload of the javabean classes.
    >
    > I've tried closing my browser then loading the page again in a new
    > instance of the browser (because my jsp pages have the 'session' scope
    > and I wondered if this was the problem) but tomcat is still not using
    > the new javabean class file.
    >
    > Any hints anyone? Currently plunging through the docs as googling didn't
    > bring up much...
    >
    > thanks
    > alex
    >


    Use the Management application to force a complete reload of
    your application. I'm assuming your javabeans are part of this
    application and are not shared by other applications.

    Bill
     
    William Brogden, Sep 3, 2004
    #2
    1. Advertising

  3. Alex Hunsley

    Alex Hunsley Guest

    William Brogden wrote:

    > On Fri, 03 Sep 2004 15:42:22 +0100, Alex Hunsley
    > <> wrote:
    >
    >> I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use
    >> some javabeans I have written.
    >> Tomcat seems to recompile changed jsp files just fine, and AFAIK it
    >> would reload a servlet if the class file had changed (recompiled),
    >> but it's not noticing that I have recompiled the classes that define
    >> javabeans. At the moment I am stopping and restarting tomcat to force
    >> a reload of the javabean classes.
    >>
    >> I've tried closing my browser then loading the page again in a new
    >> instance of the browser (because my jsp pages have the 'session'
    >> scope and I wondered if this was the problem) but tomcat is still not
    >> using the new javabean class file.
    >>
    >> Any hints anyone? Currently plunging through the docs as googling
    >> didn't bring up much...
    >>
    >> thanks
    >> alex
    >>

    >
    > Use the Management application to force a complete reload of
    > your application. I'm assuming your javabeans are part of this
    > application and are not shared by other applications.
    >
    > Bill


    Yup, it's standalone, so that would work. Maybe I'll just go with that then if
    it's the best way.

    ta
    alex
     
    Alex Hunsley, Sep 3, 2004
    #3
  4. In article <>,
    Alex Hunsley <> wrote:

    > I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
    > javabeans I have written.
    > Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
    > reload a servlet if the class file had changed (recompiled), but it's not
    > noticing that I have recompiled the classes that define javabeans. At the
    > moment I am stopping and restarting tomcat to force a reload of the javabean
    > classes.


    Make an XML Context fragment for your webapp.

    E.g., if you have a GraderServlet, with URL /grader, create
    grader.xml with


    <Context path="/grader" docBase="../webapps/grader" debug="0"
    reloadable="true" />


    and put this file in

    <tomcat-directory>/conf/Catalina/localhost/
     
    Chris Riesbeck, Sep 3, 2004
    #4
  5. Alex Hunsley

    Alex Hunsley Guest

    Chris Riesbeck wrote:
    > In article <>,
    > Alex Hunsley <> wrote:
    >
    >
    >>I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
    >>javabeans I have written.
    >>Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
    >>reload a servlet if the class file had changed (recompiled), but it's not
    >>noticing that I have recompiled the classes that define javabeans. At the
    >>moment I am stopping and restarting tomcat to force a reload of the javabean
    >>classes.

    >
    >
    > Make an XML Context fragment for your webapp.
    >
    > E.g., if you have a GraderServlet, with URL /grader, create
    > grader.xml with
    >
    >
    > <Context path="/grader" docBase="../webapps/grader" debug="0"
    > reloadable="true" />
    >
    >
    > and put this file in
    >
    > <tomcat-directory>/conf/Catalina/localhost/


    Ah, thank you! That worked a treat.

    alex
     
    Alex Hunsley, Sep 6, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Beall
    Replies:
    26
    Views:
    221,611
    AndreiKaa
    Jun 29, 2007
  2. gen_tricomi
    Replies:
    2
    Views:
    765
    gen_tricomi
    May 23, 2006
  3. Paul
    Replies:
    14
    Views:
    869
    Alexey Smirnov
    Jun 19, 2008
  4. Kevin Watt

    auto-reload changed dependancies

    Kevin Watt, Oct 17, 2004, in forum: Ruby
    Replies:
    1
    Views:
    90
    Michael Neumann
    Oct 17, 2004
  5. Stefan Mueller
    Replies:
    4
    Views:
    308
    Stefan Mueller
    Nov 5, 2005
Loading...

Share This Page