9 Replies Latest reply on Feb 1, 2010 5:58 AM by piotr.sobczyk

    Switching seam debug mode

    piotr.sobczyk
      The problem with seam debug mode is that when you change it to false all classes inside "hot" source directory start to be useless (when debug="false" there is no hot deployment and WEB-INF/dev directory of application is ignored). In JBoss Tools project there is no problem because it's enought to set action.dir=/WEB-INF/classes (instead of /WEB-INF/dev/) in build.properties file. JBoss Tools project is not driven by Ant script so the problem can't be solved by changing property. Is there any easy solution in JBoss Tools that allows changing debug to false without manually copying all source files from "hot" source direcotry to "main" source directory?
        • 1. Re: Switching seam debug mode
          maxandersen

          You write "In JBoss Tools project there is no problem" I assume you mean in a seam-gen project there is no problem ?

           

          So what is the problem you are seeing in JBoss Tools ? You have noticed that both /hot and /main ends up in /classes too, making /dev simply a redundant one which you doesn't get used when deployed ?

           

          i.e. it works at runtime, but only issue is that /dev is also there but dead.

           

          If what you want is simply to disable the hot dir then in JBoss Tools 3.1.x you can use the module assembly page to remove the /dev copying or if you are in 3.0.x or sooner you can edit the .settings/*wtp*components*.xml file manually and remove the /dev reference.

          1 of 1 people found this helpful
          • 2. Re: Switching seam debug mode
            piotr.sobczyk

            You write "In JBoss Tools project there is no problem" I assume you mean in a seam-gen project there is no problem ?

             

            Yeah, obviously I meant "seam-gen project". Sorry for mistake.

             

            So what is the problem you are seeing in JBoss Tools ? You have noticed that both /hot and /main ends up in /classes too, making /dev simply a redundant one which you doesn't get used when deployed ?

             

            No, no. I guess I wasn't too clear. The problem is that while Seam is in debug="false" mode hot deployment is disabled and classes inside WEB-INF/dev are not visible inside Seam application (ClassNotFound exceptions occur). However classes from main are still deployed by JBoss Tools to WEB-INF/classes and classes from hot are still deployed to WEB-INF/dev when debug is set to false. To adress this problem I could move all classes from hot to main before deployment so that all classes will end up in WEB-INF/classes (instead WEB-INF/dev). But moving files in project back and forth between hot and main source directories when every time I want to switch debug mode is quite problematic to say the least.

             

            Is there any way to tell JBoss Tools: "Now I'm using debug mode so you should deploy classes from hot source directory to WEB-INF/classes instead of WEB-INF/dev"?

            • 3. Re: Switching seam debug mode
              piotr.sobczyk

              Allright in order to turn off debug mode in JBoss Tools project you have to:

              1. set debug="false" in components.xml

              2. go to build path settings from project and change output folder for /src/hot to {project.name}/build/classes

               

              In effect in WEB-INF on server there will be both classes and dev directory but dev directory will be out of classpath (not visible for Seam) like Max said. I tried to do what Max suggested: I removed the /src/hot -> /WEB-INF/dev mapping from Module Assembly but it didn't change anything.

               

              In order to turn it on you have to do the opposite (debug="true",set /src/hot output folder {project.name}/WebContents/WEB-INF/dev).

               

              I've lost a lot of time experimenting because I was confused by different treating of main and hot source directories - main is build to build directory and then moved to WEB-INF/main while hot is build right to WEB-INF/dev inside project and moved with whole WEB-INF to WEB-INF on server. Is that different treating of src/hot needed for hot deployment?

               

              Would it have sense to add some high level functionality to JBoss Tools that switches between debug modes (eg. radio button: debug/production). I guess I'm not only man who deploys Seam applications through JBoss Tools not by home made Ant script imitating Seam-gen's one. I wouldn't suspect that deploing to production would be such problem.

              • 4. Re: Switching seam debug mode
                akazakov

                Yes, there is a way to do it. See http://screencast.com/t/ZWRkMWZlM2

                • 5. Re: Switching seam debug mode
                  dgolovin

                  That's a workaround for this problem.

                  Seem model should  recognize such configuration and alter project Java Build Path  Properties. "Should" doesn't mean it can WDYT, is that possible to track such changes and reconfigure Dynamic web project Java Build Path Properties on the fly?
                  • 6. Re: Switching seam debug mode

                    This is happening to me as well, only with war projects. The workaround works, thank you so much guys!

                    I hope this will be fixed soon.

                    • 7. Re: Switching seam debug mode
                      akazakov
                      I've created an issue in JIRA. See https://jira.jboss.org/jira/browse/JBIDE-5769
                      • 8. Re: Switching seam debug mode
                        maxandersen

                        I've lost a lot of time experimenting because I was confused by different treating of main and hot source directories - main is build to build directory and then moved to WEB-INF/main while hot is build right to WEB-INF/dev inside project and moved with whole WEB-INF to WEB-INF on server. Is that different treating of src/hot needed for hot deployment?

                        src/main should *never* end up in WEB-INF/main - how do you get that ?

                         

                        Any chance you are putting Maven in the mix here and the mappings between Maven and WTP is not done correctly somehow ?

                         

                        /max

                        • 9. Re: Switching seam debug mode
                          piotr.sobczyk
                          Really sorry for bringing confusion again, Max. I guess I meant WEB-INF/classes instead of WEB-INF/main. I was tired when I was writing this post .