Restart tomcat at every servlet modify?

Hi,
I'm using tomcat 5.5 and working on some servlets, but when I execute a servlet (http://localhost/my_servlet)
and then I modify and recompile it, I have to shutdown and restart tomcat to see the new version on work.
Is this normal? Can I avoid this?
Thanx

Well, I have solved the problem editing contex.wml file modifying the line:
<Context>into the line:
<Context reloadable="true">Now it works even if refresh time is not so low...
Thanx to all.
P.S.
Adding the line
<DefaultContext reloadable="true"/>into server.xml file I don't have obtained any result.

Similar Messages

  • How can i avoid restarting tomcat server when servlet is modified?

    please advice me that how can i avoid restarting the tomcat server, whenever a servlet file is modified in my application. is their any way ?

    No probs. Here's how I do things...
    1. Install tomcat as normal (e.g. I install to C:\Apps\jakarta-tomcat-5.5.4)
    2. Create a webapps directory in your eclipse project with the following directory structure
    MyEclipseProject
       - src
       - conf
       - webapps
          - MyApplication
             - META-INF
             - WEB-INF
                - classes
                - lib
                - pages3. Set the project's output folder (e.g. bin folder) to webapps/MyApplication/WEB-INF/classes
    4. Put all your jar files in the lib directory
    5. Put JSPs / HTML in the pages directory (you may also want to create additional directories for TLDs, config files etc)
    6. Ensure your web.xml is in the WEB-INF directory
    7. Although it isn't essential I create a context.xml file and store it in META-INF, e.g.
    <Context reloadable="true">
        <!-- Default set of monitored resources -->
         <WatchedResource>WEB-INF/web.xml</WatchedResource>
         <WatchedResource>WEB-INF/conf/struts/struts-config.xml</WatchedResource>
         <WatchedResource>WEB-INF/conf/struts/tiles-defs.xml</WatchedResource>
         <WatchedResource>WEB-INF/conf/struts/validation.xml</WatchedResource>     
    </Context>I use this to set monitored resources that will trigger an automatic appliation reload and to configure JAAS (not shown). See the Tomcat documentation for additional information.
    8. In the 'conf' directory I create a server.xml file used to configure Tomcat (you can copy the one from your <TOMCAT_HOME>/conf/server.xml).
    After copying the file change appBase attribute in the host element to be the full path to the webapps directory. You can also change the HTTP and HTTPS ports if you wish
    9. Download and install the Tomcat Launcher plugin from Sysdeo.
    10. In Eclipse's Preferences menu you will see a new entry for Tomcat. Click this then
    a. Set your Tomcat Version
    b. Set your Tomcat Home
    c. Set "Context declaration mode" to server.xml
    d. Set the configuration file to the full path to your server.xml file created in step 8
    On the "Advanced " sub page select all relevant projects to add to the Tomcat classpath
    On the "JVM Settings" page add all the jars in your WEB-INF lib directory to the class path
    On the "Source Path" page select all relevant projects
    Now if you start Tomcat using the Tomcat icon, you will be able to remote debug your application. If you change web.xml (or any other file in your context.xml watched resources) it will automatically reload. Any changes to JSPs will automatically be picked up (providing your tell your browser not to use the page in cache - e.g. CTRL+F5 in IE)
    There are some limitations that I'm still working on however. Primarily that I haven't included the Tomcat Manager application in my webapps directory, so Sysdeo cannot perform a reload. This means that if I change a source file, and eclipse auotmatically rebuilds, Tomcat doesn't pick up the change unless I either change a watched resource file (e.g. web.xml) or stop and restart Tomcat.
    There's no reason why this can't be fixed, I just haven't got round to it yet.
    I'm sure there are lots of other (probably better) ways of achieving the same thing. This was the first method I tried and it worked, so I stuck with it. I'm not a Tomcat config guru and I'm sure other forum users could provide some improvements should they wish.
    Post if you get into trouble, however I won't be able to respond until next week.
    Cheers,
    Steve

  • Restart Tomcat with every JSP change??

    I hope I'm missing something obvious here...
    Using JWSDP-1.2 (EA4).
    Every time I make a change to the component tree by adding an <h:whatever> tag in my page, JSF breaks when I refresh.
    For example, if I have the code below:
          <h:input_text id="password" valueRef="testBean.password">
               <f:validate_required/>
          </h:input_text>             
          <h:command_button id="submit" label="Submit"
            commandName="submit" />And I insert this line before the <h:command_button>:
    <h:output_errors  for="password"/>  The command button does not render.
    I find that the only way to get the page to render correctly is to go to the Tomcat manager, reload the webapp, and then use another JSP to invalidate my session. Then the page functions correctly. Pretty cumbersome for someone who develops JSPs with the "modify and refresh" method.
    Is this standard behavior that all of you are encountering? Will it continue to be so?

    From what I learned with tryout and error, you need to force JSF to recreate the components tree for it to register modifications.
    The easiest way I found was to load another page with JSF, so I made a link to another page from within the page I was testing.
    Hope this help.
    Patrick

  • Changing Servlets w/o Restarting Tomcat

    Hello,
    I've heard that you can edit your Servlets/Jsps on the fly without having to restart Tomcat to view the changes. How do you set this up?
    -Brendon

    Or even better, you can reload the whole web application by issuing the URL
    http://localhost:8080/manager/reload?path=/<context name>
    where <context name> is the name of your web application. You will be asked for the username/password of Tomcat's administrator in order to do this.

  • Reload web-inf/web.xml file without restarting tomcat

    Please help me if any one have a solution .
    I am doing development in jsp, servlet. I am using tomcat5 as a webserver.
    i want to reload web-inf/web.xml file without restarting tomcat.

    From the tomcat admin page you can stop/start and refresh individual applications. See the tomcat documentation. Which, when you have a question about tomcat, you should always do first.

  • Help!!!   I cant restart Tomcat Server  -StandardServer.await: create[8005]

    help!!! I cant restart Tomcat Server
    The following error is thrown on startup console:
    &#22196;&#37325;&#30340;: StandardServer.await: create[8005]:
    java.net.BindException: Cannot assign requested address: JVM_Bind
         at java.net.PlainSocketImpl.socketBind(Native Method)
         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
         at java.net.ServerSocket.bind(ServerSocket.java:319)
         at java.net.ServerSocket.<init>(ServerSocket.java:185)
         at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
         at org.apache.catalina.startup.Catalina.await(Catalina.java:662)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:614)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)1)I checked that no any process occupy port 8080 and 8005
    2)I modified the server.xml and change other port to use. the error is still shown
    Does anyone know what the problem is?
    thanks a lot!
    Edited by: perfectlifepan on Aug 17, 2010 3:50 AM

    In the past I have accidentally had my Tomcat service started and tried to start it up another instance in a development environment causing this error (recreated it just now):
    java.net.BindException: Address already in use: JVM_Bind:8080Yours is
    java.net.BindException: Cannot assign requested address: JVM_Bindwhich leads me to believe from a few quick web searches that it might be an underlying network(ip) problem and not a port problem.
    (wifi/lan switching? permission problem?)
    Either way it seems like something a classic reboot would solve. :-)
    Good luck!

  • Servlets/JDBC - Connect to database ONCE and not in every servlet - How?

    Hello, I'm using servlets and JDBC.
    In every servlet , i connect to the database and then i close the connection, but this is not ptactical.
    I would like to connect to the database once (at the beginning) when container starts and then close the connection.
    How am i supposed to do that?
    Thanks, in advance!

    Bad idea. Don't do that. The connection will timeout sooner or later (depends on DB used, it's usually around 30 mins) and your application will crash.
    You should always acquire and close the connection (and statement and resultset!) in the shortest possible scope. To improve connecting performance just use connection pooling.
    Create a DAO class which does all the task and just instantiate and assign it as Servlet class variable during Servlet's init() method. For more insights and code samples start here: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].
    To go back to your fundamental question, doing some stuff during startup and shutdown of webapp, you could use the ServletContextListener for this. But again, do NOT do this to get hold of an external resource such as a connection! It's receipt for trouble.

  • My Nokia x3-02 restarts automatically almost every...

    My Nokia x3-02 restarts automatically almost every day what should i do now?
    please do help me

    It probably is a software or hardware failure, however if this has happened from day one there is a chance that your simcard can cause this if it is faulty/old.
    If you have a spare simcard of newer date or possibly less worn, you should try that a day or untill it restarts again if bringing it to the shop or a care point straight away is hard. However the care point might not discover the fault if you keep your simcard.
    As suggested above, try updateing it and see how it goes, if it is the same, try another spare simcard if possible, if not do as already suggested.
    Remember to back up your phones content before updating. Not to make you scared but if it is a hardware fault which could be likely, an update can go wrong - you never know if it turns off during it.
    Backup and perform it. It's worth a shot as anyway you will probably have to visit a care point or replace it.
    Good luck

  • My new I pad retina display restarts automatically in every 3 minutes

    I purchased it ( new ipad with retina display wifi + cellular ) one month back. It restarts automatically in every 3 minutes. I tried few tips already like reset n all but all failed. Pls help me

    I also have the NEW IPAD 32 GB Wifi ..
    It also keeps resetting.
    I had bought the same in Jun 2012, When it was new it used to Reset but very rarely.
    In the past few weeks its resetting itself 4-5 times a day within 3-4 hours of usage per day.
    I also went to the Apple Service centre, they kept the Ipad for 2.5 days.. upgraded the firmware or something and gave it back to me saying the prob is resolved,
    Apple Service Engineers are said that its because of the apps, nothing to do with the hardware.
    After using it for 2 days ..It's worse than ever now.. also its heating too much.
    Today morning i just connected the charger and it again re booted.
    Not sure what to do

  • Server Admin start/stop doesnt restart tomcat

    Is it just me or does the ServerAdmin app not restart tomcat? I just spent a good hour banding the desk about why the tomcat-users.xml file didnt agree with the manager app, only to find tomcat wasnt being restarted. In the end I killed it from the terminal and let the launchd bring it back up on its own...

    What you see in Object Explorer, is a connection to the server using your local machine credentials, not any "sa" credentials. When you click on the server in registered
    servers (or click "Connect" from Object Explorer), you get a dialog box where you can enter "sa" credentials (or whatever) to log into the server, manage the databases, run queries, etc.
    But the object explorer window doesn't care about those sa credentials, it is using your local machine credentials.
    So, you (user "pippo") open up SSMS and hit "Connect" in Object Explorer and fill in information (sysadmin) to connect to SERVER A - if "pippo" is a local administrator on SERVER A, you will get the green arrow and be able to manage
    by right-clicking in Object Explorer. If "pippo" is not a local admin on SERVER A, you won't be able to. It makes no difference at all that you logged into SSMS (connected to SERVER A through SSMS) as sysadmin.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

  • Compiling classes and restarting Tomcat

    When making changes to any of my java classes I have to restart Tomcat in order for them to be made. Is this the only way to do it?

    add this line to your server.xml in
    <tomcat_install_dir>\conf directory
    <DefaultContext reloadable="true"/>
    if you have context path tag in this file for your
    application, then add
    the line to this tag as shown below
    <Context reloadable="true"....</Context>
    This will automatically load classes
    This should really only be done in a development environment (but by all means DO use it in a development environment). In a production environment, with lots of simultaneous users, it has a pretty big impact on performance.
    - K

  • Why do I have to restart the iPad every time I try to access the internet?

    Why do I have to restart the iPad every time I try to access the internet?

    (A) Try reset iPad
    Hold the Sleep/Wake and Home button down together until you see the Apple Logo.
    Note: Data will not be affected.
    (B) Close all apps in the multi-task window
    1.Double-click the Home button.
    2. Swipe the app's preview up to close it.
    3. Preview will fly off the screen.

  • I can't open firefox. The home page doesn't come up, I just keep getting the Crash Reporter asking to restart/quit but every time I do this the same message comes back.

    I can't open Firefox. The home page doesn't come up, I just keep getting the Crash Reporter asking me to restart/quit but every time I do this the same message comes back. I've not been able to use Firefox for days now.

    Since a few days we have a lot of crashes with [http://www.trusteer.com/product/trusteer-rapport Trusteer Rapport]. If you have this program, try to disable it and see if that stops the crashing.<br>
    You can stop Rapport using Start Menu > Programs > Trusteer Rapport > Stop Rapport<br>
    You can ask their helpdesk when an updated version of their product will be made available or, if you don't need this software, uninstall it.<br>
    http://www.trusteer.com/support/en/report-problem<br>
    If you do not have Rapport, then we need to have a crash report ID. When you send Mozilla a crash report it just puts it in a giant database. We have no way of looking it up without the Report ID. I have no idea what is wrong without looking up the crash report. Please get the Report ID of your latest crash report.<br>
    See https://support.mozilla.com/en-US/kb/Firefox%20crashes<br>
    or http://kb.mozillazine.org/Firefox_crashes<br>

  • I've imported some midi tracks, used the mixer to set pan, volume etc, but when I stop playback and restart it sets every midi track back to '0'. I've been using LE for years, this is a new one, any ideas?

    I've imported some midi tracks, used the mixer to set pan, volume etc, but when I stop playback and restart it sets every midi track back to '0'. I've been using LE for years, this is a new one, any ideas?

    Hi,
    that's because Logic reads the volume information out of the imported MIDI tracks and sets the volume fader according to this information. The MIDI information overrides volume settings you have done, so you have to identify the MIDI events that contain volume (or expression or pan or whatever) information and delete them. You can use the event list editor for this.
    Fox

  • Have to restart Lion server every time I want to access it remotely

    L.S.,
    My Mac Mini Server (10.7.3) is colocated at a data center.
    At this point I have to restart Lion server every time I want to access it remotely for screen sharing over the internet.
    I can make the connection, so all the right ports are open, as the port scan also shows, but it just times out when I wish to connect again within the same server without rebooting.
    I bought Apple Remote Desktop but that doesn't help either. I can still connect through AFP, web and VPN.
    I do hope that someone can give me some more insight in this problem.
    Rebooting isn't a problem by the way...
    UPDATE:
    If I keep the session active overnight, there is no problem whatsoever, but when I log off as a "good practice", which I've learned using Windows, screen sharing will not work any longer. Forgetting about logging off seems to be a viable workaround at this point .
    regards,
    Mark

    Double post... https://discussions.apple.com/message/17729558#17729558

Maybe you are looking for

  • Photos will not Sync to iPad, iPhone or Apple TV.

    I am not able to Sync photos, on my iPhone or iPad, when cabled to my iMac. I have checked  "Sync Photos from iPhoto" and the photo albums (within iTunes) show zero photos. Also, not able to view photos on Apple TV.  I have gone to iTunes File>Home S

  • CR XI & XI R2 - PutLocation() Extremely Slow on Oracle Database

    Hello, I have an issue very similar to others posted in this forum, but was asked to start a new thread. I'm using Crystal XI and XI R2,updated with SP6. I develop using C++ on VS2008 using the crystal COM object. I have common database tables, in wh

  • DBMS_AQELM subprograms: When and how to use?

    Let's say that I've registered for asynchronous notifications via email on a queue. I'm using 9.2.0.5. Who issues the dbms_aqelm subprograms set_mailhost, set_sendfrom, etc.? The AQ Administrator, or the AQ User? When does she issue the commands: onc

  • How to Override Cost Center in IT 1 based on certain conditions

    Hi, I have a pretty good understanding on how Cost Center gets defaulted based on Org Structure.  The standard SAP solution for Cost Center will not work for my client and I need to determine the cost center based on certain conditions. I understand

  • Need to add caption to each photo

    When creating slideshow, I want to add a caption to each photo. I can do that in Photo Story 3 for Windows from Microsoft. Can't find a way in in Lightroom 3 or 4.