1 2 Previous Next 20 Replies Latest reply on Mar 11, 2010 8:10 PM by Denis Golovin

    JBoss AS WTP server adapter removes deployment module

    jan29 Newbie

      I've recently come across a bug in the JBoss AS WTP server adapter with a multi-module EAR project.  Sometimes when editing and saving a file, this file is seen as a deployment module instead of the actual deployment module the file resides in. After some digging, I discovered that the problem was caused by the file org.jboss.ide.eclipse.as.core.prefs in the workspace metadata. This file was created around the same time as when the problem started and it contained the name of the file which was seen as the deployment module. Removing this file and redeploying the application solved the problem. I was using Eclipse 3.5 with JBoss 5.1.0 and JBossAS Tools version 2.1.0.v200912250601M-H198-CR1.

       

      The contents of the file org.jboss.ide.eclipse.as.core.prefs were as follows.

      #Fri Feb 12 11:10:13 CET 2010
      eclipse.preferences.version=1
      org.jboss.ide.eclipse.as.core.singledeployable.deployableList=/main_ejb/src/com/example/Example.java
      
        • 1. Re: JBoss AS WTP server adapter removes deployment module
          Max Rydahl Andersen Master

          That file should only show up if you have right clicked it and chosen "Make Deployable".

          This is there to allow you to deploy non-WTP resources, such as -ds.xml or other resources you like to deploy to AS.

           

          You can make them "undeployable" by right clicking on the file and choose "Make undeployable".

           

          So this is actually all expected behavior.

          • 2. Re: JBoss AS WTP server adapter removes deployment module
            henk de boer Master

            max.andersen@jboss.com wrote:

             

            That file should only show up if you have right clicked it and chosen "Make Deployable".

            [...]

            So this is actually all expected behavior.

             

            I had the same thing happening and I most definitely did not click on any "Make Deployable" command (which is btw a very handy function but that aside).

             

            What happened is that I saved a resource from within Eclipse and later when I started up JBoss AS, it failed with errors. Upon inspecting I noticed the adapter had added the very resource that I just saved as a deployable artifact. On top of that, most other content residing in the same module as where I saved the resource has disappeared.

             

            I also encountered a very similar thing. Instead of the resource I save being added as a deployable artifact, it happens to suddenly be the only thing that is deployed.

             

            For instance, I have an ear with an ejb module and a web module. The web module contains a content directory with a ton of jsp files and directories. Suppose I have the files customer/edit_customer.jsp and customer/new_customer.jsp open in my editor. After I save those and start the server, the startup fails. If I then inspect my filesystem at the deployment location, I see that all the content of the web module is gone and only customer/edit_customer.jsp and customer/new_customer.jsp remain. The EJB module (where I didn't perform a save) as well as the files in EAR umbrella other than the web module are still intact.

             

            This happened to me quite a number of times. I can't really put my finger on it to really determine what causes it. I'm using both a Mac and a Ubuntu machine and it happened on both. I also use JRebel, but since my trial license expired recently I haven't been using this, and yet this strange phenomenon happened again. I also tried with deployment inside the .metadata folder and directly into the JBoss AS deploy folder, but it both cases the problem occurred. It mostly seems to happen when the server is not running, but I also had it happening when the server in fact was running: it started up correctly, I could log-in to my app. Then I made a small change in one of our JSP files and a moment later messages started appearing in my log that stuff couldn't be found anymore. Again, the web module's content was nuked except for the file I just saved.

            • 3. Re: JBoss AS WTP server adapter removes deployment module
              Max Rydahl Andersen Master

              henk53 wrote:

               

              max.andersen@jboss.com wrote:

               

              That file should only show up if you have right clicked it and chosen "Make Deployable".

              [...]

              So this is actually all expected behavior.

               

              I had the same thing happening and I most definitely did not click on any "Make Deployable" command (which is btw a very handy function but that aside).


              If you can show me how you got lines added to that file you found in .metadata without using Make Deployable (or use the Seam Wizard which does it automatically for the -ds.xml) I'll buy you a beer!

               

              What happened is that I saved a resource from within Eclipse and later when I started up JBoss AS, it failed with errors. Upon inspecting I noticed the adapter had added the very resource that I just saved as a deployable artifact. On top of that, most other content residing in the same module as where I saved the resource has disappeared.

              <snip>

              This a very different issue and much more serious.

              If you can in anyway give us a way to reproduce this then that will be great - I've used the deployment for years and never seen this myself (but I have seen other reports about it, but we just never been able to reproduce it in any form ;(

               

              I would really like to have a reproducable example!

              • 4. Re: JBoss AS WTP server adapter removes deployment module
                henk de boer Master

                max.andersen@jboss.com wrote:

                 

                henk53 wrote:

                 

                I had the same thing happening and I most definitely did not click on any "Make Deployable" command (which is btw a very handy function but that aside).

                 

                If you can show me how you got lines added to that file you found in .metadata without using Make Deployable (or use the Seam Wizard which does it automatically for the -ds.xml) I'll buy you a beer!

                 

                Well, it was the TS (Jan) who found the entry in that file. I personally never noticed that file, but did notice that the file I just saved was made a top level deployable artifact once. I'm willing to accept that I might have made a wrong click somewhere, but if I do find how to reproduce this I'll keep you to your promise

                 

                This a very different issue and much more serious.

                If you can in anyway give us a way to reproduce this then that will be great - I've used the deployment for years and never seen this myself (but I have seen other reports about it, but we just never been able to reproduce it in any form ;(

                 

                I would really like to have a reproducable example!

                 

                To be able to learn for my self and to assist my team members in how to possibly prevent this from occurring I've been trying to reproduce this my self, but so far have been unsuccessful. The only thing I can really contribute is telling that it happened multiple times in just a few weeks and on very different machines. The OS X one is a fairly modest C1D 2Ghz/1.5GB, while the Ubuntu machine is a 2.66Ghz Quad core Nehalem (8 virtual cores) with an Intel X25-M SSD. At first I thought maybe the many virtual cores of the Ubuntu machine were to blame, or some race condition with the SSD, but then it also happened on my old OS X machine.

                 

                If I do find anything I'll post it here right away.

                • 5. Re: JBoss AS WTP server adapter removes deployment module
                  jan29 Newbie
                  I just checked to see where the "Make deployable" option was, but I'm quite certain I didn't accidentally use this option when the problem occurred. I just tried reproduce the problem by selecting "Make deployable", but the deployment module the file is in is not replaced by the file that was made deployable, so this was definitely not the cause of the problem.
                  • 6. Re: JBoss AS WTP server adapter removes deployment module
                    Max Rydahl Andersen Master
                    Thanks for following up! I'll be able to drink the last beer I got stored
                    • 7. Re: JBoss AS WTP server adapter removes deployment module
                      jan29 Newbie
                      Far be it from me to begrudge anyone a beer, but I think you may have slightly misunderstood me. I was able to rule out the "Make deployable" option as the cause of the problem as in my case the deployment module was replaced by the last file I saved within the module. The "Make deployable" option does make a file deployable, but it doesn't cause the module the file resides in to be removed.
                      • 8. Re: JBoss AS WTP server adapter removes deployment module
                        Max Rydahl Andersen Master

                        hmm...those lines i'm not sure I follow.

                         


                        "Make deployable" shouldn't do anything beyond make it possible to deploy that single file to the root of the deploy folder.

                         

                        But I think that is what you are saying and then I still don't owe a beer, do I  ?

                        • 9. Re: JBoss AS WTP server adapter removes deployment module
                          jan29 Newbie
                          Another one of my colleagues has encountered this problem today. A single .java file replaced an entire deployment module in the EAR module. We tried right clicking on this file and selecting "Make undeployable", but this undeployed everything but the offending file. Removing the file "org.jboss.ide.eclipse.as.core.prefs" solved the problem. He is now the fourth developer in my department that has run into this exact problem.
                          • 10. Re: JBoss AS WTP server adapter removes deployment module
                            Max Rydahl Andersen Master

                            Jan - please open a jira with this and give a best shot at explaining what is happening and link to this thread. With pathnames etc. since they matter when we are doing deployment/undeployement.

                             

                            If you have an as.core.prefs then at some point the file listed in there were once made deployable.....

                             

                            Lets get it in jira and see if we can track it down.

                            • 11. Re: JBoss AS WTP server adapter removes deployment module
                              Denis Golovin Master

                              I can get the same only when at first I use JBoss AS adapter by default with deployment into .metadata/plugins/org.jboss.ide.eclipse.as.core folder. Then I switch to direct deployment of exploded archives to JBoss AS deploy folder and then make a change in any JEE module. In this case only changed files appear in new deploy folder in JBoss AS.

                               

                              I'm using last most recent version from 3.1.x which is GA candidate now.

                              I have no files created .settings folder like you mentioned and I'm to reproduce it on EAR projects with two EJB and one Web module.

                              • 12. Re: JBoss AS WTP server adapter removes deployment module
                                henk de boer Master

                                To chime in again, I personally haven't seen it happening again that the server in Eclipse's server view showed the resource I recently saved as a top-level deployable artifact.

                                 

                                However...

                                 

                                It keeps happening that in the server view everything looks okay. Both the EJB and Web module are present as normal and they both are labeled with [Synchronized]. When I start up the server though, the Web module *only* contains a few resource I last saved! Everything else is gone. This happens almost daily or at least every few days.

                                 

                                Since I just had it happening again, the last actions I did are still fresh in my mind.

                                 

                                I had started JBoss AS and while it was running made several changes to JSP (JSF) files and Java files (inside method bodies, I don't have JRebel running for the moment). This session lasted for a few hours after which I stopped the server to make some more changes. I made a change in a JSP file again, in a faces-config.xml file and in a java file 3 files total, with the java file containing a static inner class.

                                 

                                Then I started the server again to see my changes, but it failed to start up. After inspection of the deployment it appeared that the entire web module only consisted of those 3 files I edited while the server was stopped and the 1 extra file that represents the static inner class. The Java files were of course the derived .class files in WEB-INF/classes and not the actual .java source files. Everything else was gone again, yet the UI still says "synchronized".

                                 

                                For this is currently extra troublesome, since for a few days JBoss AS tools also often refuses to deploy anything to WEB-INF/lib. I'm very happy when it for some magical reason finally deploys libs to that folder after taking hours of repeated re-deployments, but it all starts over when JBoss AS tools decides to delete everything again.

                                • 13. Re: JBoss AS WTP server adapter removes deployment module
                                  Denis Golovin Master
                                  As said above you have EAR, EJB and WAR projects. Are they just regular WTP projects? Do you have any additional features enabled for those projects?
                                  • 14. Re: JBoss AS WTP server adapter removes deployment module
                                    Max Rydahl Andersen Master

                                    hmm - can any of you open a jira outlining the steps to reproduce this ?

                                     

                                    I would really like to understand the issues before we pull the trigger and release GA (it's already built and basically ready to go)

                                    1 2 Previous Next