6 Replies Latest reply on Feb 18, 2003 7:21 AM by rmbenevides

    server restart for any changes in servlets

    srshende

      Hello,
      Whenever I am making any changes in Servlet those changes are not getting reflected unitll and unless I restart the jboss server. Why is it so.. Doesn't it take the hot deployment.
      Moreover I am not getting from where does jboss sever keeps the servlet compiled class. Once the server is started, I deleted the class, server run with the old version of the class.

      Thanks & Regards
      Sanjay

        • 1. Re: server restart for any changes in servlets
          joelvogt

          are you deploying the servlets in a war/ear file?

          • 2. Re: server restart for any changes in servlets
            srshende

            No,
            I am not deploying the servlet in .war/.ear files. I created one .war deirectory and in that I kept my servlet source file and also class file.
            following is my directory structure.

            D:\jboss-3.0.0_tomcat-4.0.3server\default\deploy\client.war

            in client.war dir I have my .class file. I execute it using following command.

            http://localhost:8080/client/servlet/SimpleServlet

            But whenever I make any changes in the same file. Those changes do not get reflected untill and unless I restart the server.

            Regds,
            Sanjay

            • 3. Re: server restart for any changes in servlets
              pascalpt

              Touch the web.xml.

              • 4. Re: server restart for any changes in servlets
                rmbenevides

                I'm using Jboss30 + tomcat41...

                Look the file "tomcat41-service.xml" and add the reloadable attribute in the DefaultContext, like this:

                <DefaultContext ... reloadable = "true" />


                []'s

                • 5. Re: server restart for any changes in servlets
                  rmbenevides

                  Hello again,

                  the solution didn't work...

                  I got a NullpointerException during the redeploy of the application:

                  -----------
                  09:27:07,535 INFO [STDOUT] WebappClassLoader: Resource '/WEB-INF/classes/sisbacen/monspb/MonitorDeMensagensNaoProcessadas.class' was modified; Date is now: Tue Feb 18 09:27:05 BRT 2003 Was: Tue Feb 18 09:26:20 BRT 2003
                  09:27:07,555 INFO [Engine] StandardContext[/monspbd]: Reloading this Context has started
                  09:27:07,595 ERROR [STDERR] java.lang.NullPointerException
                  09:27:07,595 ERROR [STDERR] at org.apache.catalina.core.StandardContext.relo
                  ad(StandardContext.java:2469)
                  09:27:07,605 ERROR [STDERR] at org.apache.catalina.loader.WebappLoader$Webap
                  pContextNotifier.run(WebappLoader.java:1382)
                  09:27:07,615 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
                  -----------

                  There is some trouble in the class StandardContext, I think. When I wrote the solution, I didn't check the result. I'm sorry!

                  My solution now is using jmx even the application change:

                  1) Open the link: http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss.system%3Aservice%3DMainDeployer

                  2) Put the url of your application in "void redeploy(java.net.URL)", like "file:/c:/Work/deploy/application.war/"

                  3) Invoke redeploy().

                  Bye!

                  • 6. Re: server restart for any changes in servlets
                    rmbenevides

                    Hello again,

                    the solution didn't work...

                    I got a NullpointerException during the redeploy of the application:

                    -----------
                    09:27:07,535 INFO [STDOUT] WebappClassLoader: Resource '/WEB-INF/classes/sisbacen/monspb/MonitorDeMensagensNaoProcessadas.class' was modified; Date is now: Tue Feb 18 09:27:05 BRT 2003 Was: Tue Feb 18 09:26:20 BRT 2003
                    09:27:07,555 INFO [Engine] StandardContext[/monspbd]: Reloading this Context has started
                    09:27:07,595 ERROR [STDERR] java.lang.NullPointerException
                    09:27:07,595 ERROR [STDERR] at org.apache.catalina.core.StandardContext.relo
                    ad(StandardContext.java:2469)
                    09:27:07,605 ERROR [STDERR] at org.apache.catalina.loader.WebappLoader$Webap
                    pContextNotifier.run(WebappLoader.java:1382)
                    09:27:07,615 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
                    -----------

                    There is some trouble in the class StandardContext, I think. When I wrote the solution, I didn't check the result. I'm sorry!

                    My solution now is using jmx even the application change:

                    1) Open the link: http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss.system%3Aservice%3DMainDeployer

                    2) Put the url of your application in "void redeploy(java.net.URL)", like "file:/c:/Work/deploy/application.war/"

                    3) Invoke redeploy().

                    Bye!