7 Replies Latest reply on Sep 11, 2012 11:30 AM by doughboss

    Publishing with JBOSS Tools Indigo Skips web.xml

    doughboss Newbie

      Hello All.

       

      I am migrating from JBOSS 6 to JBOSS 7.  The migration itself was incredibly easy.  However, I am experiencing problems with developer environment integration.  Here is my problem:

       

      When I was on JBOSS 6, I was on publishing through Helios and all was well.  I could not upgrade my JBOSS tools to recognize JBOSS AS 7, so I upgraded my version of eclipse as well.  The JBOSS 7 server was recognized no problem.  Starting and stopping the server is also no problem.  Building (with maven) through eclipse and manually deploying (copy/paste of the .war file) also works fine.  However, with 1 of my projects, publishing through eclipse (right click on server, add/remove) does not work.  The web.xml file is not published to the WEB-INF folder.  This causes a "successful" deploy, but with no web.xml, the application does not work and is essentially a file server.  There are no errors shown.

       

      I will point out that I do not believe the problem has to do with JBOSS 7.  I tried the same publish process above for JBOSS 6 (the server I was migrating from and still works when publishing from helios) with the same result.  I have also tried manually adding the web.xml to the deployed applications WEB-INF folder, and the application does deploy successfully that way.

       

      Does anyone know what could possibly cause the web.xml to not be included in the published (exploded) war folder?

       

      Please let me know if you would like me to include any specific files.

        • 1. Re: Publishing with JBOSS Tools Indigo Skips web.xml
          doughboss Newbie

          I should specify that I have 3 projects total in the workspace.  2 are publishing properly through the JBOSS AS interface in eclipse (not skipping web.xml).  The projects are a RESTeasy webservice (working), a jsp servlet (working), a JSF application (not working).  All use spring and hibernate (in case that is relevant).

          • 2. Re: Publishing with JBOSS Tools Indigo Skips web.xml
            doughboss Newbie

            I got desperate and directly edited the .classpath and .project files.  Copying the contents from my old helios workspace over my updated workspace created a lot of java errors in eclipse.  These were fixed by updating the maven dependencies from the pom.  After that, everything worked.

             

            If anyone knows why this worked, please let me know.  I will have to upgrade my fellow developers on the project and that process is far from elegant.

            1 of 1 people found this helpful
            • 3. Re: Publishing with JBOSS Tools Indigo Skips web.xml
              Stephen Coy Master

              As a general rule it is a bad idea to put IDE created artifacts such as .project and .classpath into your source control system. These files are sometimes not portable across eclipse versions or even between two different computers running the same version of everything.

               

              If you're using the full JBoss Tools/m2eclipse suite it's far easier to let these completely manage eclipse configuration for you.

              • 4. Re: Publishing with JBOSS Tools Indigo Skips web.xml
                doughboss Newbie

                Thank you for your reply Stephen.  You are absolutely correct.  It is certainly bad practice to copy the .classpath and .project files from one version of eclipse into another.  I tried for a long time to let the jboss tools manage the eclipse configurations for me and resorted to copying over the .project and .classpath only as a last resort (again, after 3 days of trying to make it work the "correct" way).  I still do not know why this process worked, but so far there has been no fallout from the process.

                 

                I am still curious as to why this fix worked and can only guess at the reason.  If anyone knows the reason or a better way to make it work, please let me know.

                • 5. Re: Publishing with JBOSS Tools Indigo Skips web.xml
                  Stephen Coy Master

                  One of the things that can happen is that m2eclipse will only touch the .project/.classpath configuration elements for which it has direct knowledge. If there is any cruft in those files then it will remain there.

                   

                  This happens because there are many eclipse plugins that store configuration in these files and m2eclipse cannot know about all of them.

                  1 of 1 people found this helpful
                  • 6. Re: Publishing with JBOSS Tools Indigo Skips web.xml
                    doughboss Newbie

                    I was working from a clean install of Juno Java EE edition (tried indigo also) with the full JBOSS tools installed and no additional plugins.  JBOSS tools comes with maven integration so I did not include m2eclipse.  I later installed maven Integration for WTP with no visible change in behavior of the publish.

                     

                    I tried 2 different ways to import the project as well.  One way from the previous workspace and another way from svn.  The .classpath and .project files are not stored in our svn repository.

                     

                    As far as I can tell, I did everything correctly, but there are many ways to fail of course.

                     

                    Thank you again for your reply.  The explanations of the .project and .classpath file are helpful.

                    • 7. Re: Publishing with JBOSS Tools Indigo Skips web.xml
                      doughboss Newbie

                      I also installed subclipse when I decided to try to import from svn (of course).