7 Replies Latest reply on Jun 24, 2008 7:02 PM by 666705

    context.xml file always overwritten in v3.3

    666705
      I have recently upgraded to version 3.3 of BEA Workshop from version 3.2.1.

      I have a tomcat application that required password protected pages within tomcat. Therefore I added the database and realm etc to the META-INF/context.xml file to enable this to happen.

      However at version 3.3 context.xml is overwritten with the mimimum data required (ie the context and the Loader) for the context and hence my resource and realm information is deleted, meaning that logon no longer works.
      I have added it once more, but as soon as the server is restarted, it is overwritten.

      Under the previous version this file only seemed to be overwritten or edited when changes were made to the context roo.

      How can I prevent this happening as I can no longer continue developing?

      Many thanks in advance
      Ian

      --
      Edited by ismoore at 01/15/2007 9:36 AM
        • 1. Re: context.xml file always overwritten in v3.3
          666705
          Hi Ian,

          Prior to Workshop 3.1 release there was a better way to handle the custom configuration. The switch to WTP is more tightly coupled to the existing (WTP's) Tomcat server behavior.

          Here is the equivalent of "manual deployment with existing configuration file" support in Tomcat server from WTP:

          Background:
          Every time a Tomcat Server is defined, WTP creates a Workspace folder, e.g.: /Servers/Tomcat v5.5 Server @ localhost-config (use Package Explorer)

          In this folder you can find common Tomcat config files.

          Each time Server starts, it first updates the server.xml in this folder with new WebModules added, then publishes all the config files in this folder to a temp folder

          C:\runtime-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\conf

          Then the server is started with command line pointing to this temp config folder:


          "javaw.exe" -Dcatalina.base=d:\runtime-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1 "-Dcatalina.home=D:\Tomcat 5.5" "-Djava.endorsed.dirs=D:\Tomcat 5.5\common\endorsed" -classpath "D:\Tomcat 5.5\bin\bootstrap.jar;C:\Program Files\Java\jdk1.5.0_06\lib\tools.jar" org.apache.catalina.startup.Bootstrap start


          1. Change "Configuration Path" for manual deployment (using custom config files)

          In Server Editor UI (In Server view, double click on Tomcat server), change the "Configuration Path" (Under General Section)by pointing to another Workspace folder,

          e.g.: MyTomcatConfigurations/Tomcat v5.5 Server Config 2

          which contains customized Tomcat config files.

          NOTE: If you prefer having the Tomcat config files outside of the workspace, create a Linked Folder to that physical directory.

          2. The publishing and start process still works the same as default setting. Meaning files are still copied into the temp folder.

          This should solve the problem like using predefined JDBC resources, port, security settings in a custom server.xml
          • 2. Re: context.xml file always overwritten in v3.3
            666705
            Ram.j

            thank you for the information. Unfortunately the problem I am having is not with server.xml but with the automatic generation of context.xml in the META-INF folder.

            in the last release of workshop, if context.xml was edited, the changes were preserved for each restart of the server. However now it is overwritten each time.

            So when I add in realm information for the logon, this is removed as part of the server restart and hence logon always fails.

            Do you think this will solve the problem?

            Many thanks in advance
            Ian
            • 3. Re: context.xml file always overwritten in v3.3
              666705
              Oops, that was way different from the actual problem - Sorry about that.

              Try the following workaround to retain custom context.xml file:

              - Stop the server
              - Modify the META-INF/context.xml file with appropriate configuration - Save File
              - right click on META-INF/context.xml > Properties - Check "Read only"
              - Restart the server
              • 4. Re: context.xml file always overwritten in v3.3
                666705
                err, that should have been obvious really shouldn't it but I never thought of it!

                Many thanks for all of your help

                Regards
                Ian
                • 5. Re: context.xml file always overwritten in v3.3
                  666705
                  Hi everybody !

                  Sorry, but this doesn't work for me...
                  I've changed de read-only setting on my context.xml then restarted the server and Worshop still overwrite my file...

                  Please help...

                  Sorry for my poor english but I'm french.
                  • 6. Re: context.xml file always overwritten in v3.3
                    666705
                    salut
                    Est-ce que vous etes sur que vous avez arrete le server avant que vous avez faire le changements?
                    Il faut:
                    arretez les serveur.
                    refaitez les changements sur le fichier web.xml
                    changer les droits sur le fichier (lecteur seulement?)
                    redemarrez le serveur.

                    avant de redemarrer, vous pourriez verifier que le droits sur le fichier sont correcte est que cette ficher contenu le bon configuration avec le SG.

                    En generale on va voir une erreur quand on demarre le serveur qui dit que c'est as possible de "overwrite" le fichier.

                    Pardon mon francais - je parle un petit peu mieux que j'ecrit!

                    Malheuresement je ne utilise plus BEA donc je ne peut pas le verifier que ca marche toujours.
                    • 7. Re: context.xml file always overwritten in v3.3
                      666705
                      it seems late to respond to this thread, but I like to put some comment about my similar expereince that I had.
                      I use BEA WorkSpace Studio version 1.1 with tomcat.
                      My project use to work fine and datasource used to being copied properly to .metadata\.plugins\org.eclipse.wst.server.core\tmp0

                      but one of my colleague had some issue so he checked in devLoader_context.xml to cvs which made my local version stop working. In this case Servers\Tomcat v5.5 @ localhost-config\Server.xml become different from the one in tmp directory.
                      Servers\Tomcat v5.5 @ localhost-config\Server.xml has my database resource but the one in tmp file always get overwritten with empty context.
                      Finally I deleted devLoader_context.xml and it started to work fine.
                      I didn't spend more time to find out technical reason since I already spent a lot of time on this, but I think devLoader_context.xml
                      context.xml have the same behavior with devLoader_context.xml higher priority to get overwritten.
                      marking file as read only does not work as well.

                      So I prefered to declare my resource just inside the server.xml

                      Shahram