8 Replies Latest reply on Mar 14, 2016 8:08 AM by s.santilli

    Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned

    s.santilli Newbie

      Just as the title describes, when I deployed my .war file to Wildfly and attempt to access the service, I always get a status code 302 returned ..however deploying within eclipse, I get no issues or problems ... what am I missing?

       

      Thanks

        • 1. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
          s.santilli Newbie

          Can anyone assist? A simple drop of a war file, then trying to invoke my deployed web service, ends up always returning a redirect status code 302.

           

          Please and thank-you greatly

          • 3. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
            s.santilli Newbie

            Thanks for replying Yoshimasa ... unfortunately I do not think I can share the project for work rfelated reasons ( I hope you understand ) ... I can say that the project exposes some web services. The project works absolutely fine on wildfly 10, but only if I deploy it within eclipse (run--> run on server). The project (war) also  works fine when deployed on Glassfish 3.x, 4.x and even IBM Liberty.

             

            The only situation where the project does not work is if I deploy the .war (copy the .war and drop it into standalone/deployments directory) on Jboss Wildfly 10.  If I deploy the .war this way, or alternatively, add the deployment from the console, then attempt to access any of my web services via a test client, JBoss returns a status 302 (a redirect really???) .. I have no clue why it would do this, nor why it is occurring.

             

            Again I'm hoping someone out here can help.

            Thanks kindly

            • 4. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
              Yoshimasa Tanabe Newbie

              Yeah, I understand your situation, not everyone can share source codes.

               

              Hmm, I think your deployment ways were correct...

               

              Can you check the difference between the war Eclipse deployed and the one you deployed manually(dropping into deployments directory or via CLI/Web Console)? There is no difference?

              • 5. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
                s.santilli Newbie

                Thanks Yoshimasa,

                 

                I did reviewed both deployments, that is, the project deployed via eclipse (run-->run on server) and also the same project deployed via dropping the .war file into the Widlfly deployment directory (standalone/deployments. There only notable difference is:

                 

                Difference between deploying war within eclipse versus dropping .war inside wildfly standalone/deployments directory:

                1. The project when deployed via eclipse, is deployed as an expanded war file within the standalone/deployment directory (ie. looks simply like a normal directory that is added to standalone/deployments directory). However, when I deploy the same project as a .war file copied into the standalone/deployments, the war file remains compressed within the standalone/deployments directory, but is instead expanded in a auto-generated vfs/tmp sub-directory instead. I do not know why this occurs?

                 

                Does anyone know what my problem might be? Am I overlooking something?

                 

                Thank-you kindly.

                • 6. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
                  Yoshimasa Tanabe Newbie

                  Hmm, I have more questions.

                   

                  ------------------------------------------------

                  1. How to create the war file

                  ------------------------------------------------

                  How did you create the war file(compressed) you copied? mvn package?

                   

                  FWIW, I tested wildfly-quickstart/helloworld-ws and it works with the following ways:

                   

                  • Eclipse(JBoss Developer Studio 9.1.0 Beta2) Run -> Run on Server(I use JBoss EAP 7 runtime)
                    • Eclipse placed the project expanded on $WILDFLY_HOME/standalone/deployments as you said. The content and file layout are the same with compressed(mvn package) one without some contents under META-INF(pom.xml* I think it's no related).
                  • manually deploying
                    • mvn package and dropping $WILDFLY_HOME/standalone/deployments
                    • mvn wildfly:deploy which means mvn package and deploy command via WIldFly CLI).

                   

                  I don't know Eclipse very well, but I think these ways should be equivalent for Maven project.

                   

                  The sample is here.

                   

                  quickstart/helloworld-ws at 10.x · wildfly/quickstart · GitHub

                   

                  Tips: The above example needs to be changed targetNamespace on server side.

                   

                  ------------------------------------------------

                  2. Location header value

                  ------------------------------------------------

                  The 302 response should have Location header. What is the value? Is it the value you expected?

                  • 7. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
                    ehugonnet Apprentice

                    Could you share your WildFly configuration ?

                    Maybe you have auto-deploy-zipped set to false in your scanner configuration.

                    • 8. Re: Deploy my war to JBoss Wildfly 10 and I always get a status code 302 returned
                      s.santilli Newbie

                      Thank-you once again for your feedback.

                       

                      How did you create the war file(compressed) you copied? mvn package?

                       

                      I create all my war files via maven eclipse ... I have a saved Run Configuration that essentially invokes a mvn clean package to create the resultant .war file. Once the war is created, I simply copy it and drop it into my Wildfly's standalone/deployments folder.  Unfortunately doing it this way always results in a status code 302 (moved) returned whenever I later attempt to access the services deployed.

                       

                      The 302 response should have Location header. What is the value? Is it the value you expected?

                       

                      Hmm, I'll have to review that location header, I have not reviewed it but I am literally going to try to spend the whole day to fix this entire problem ... I'll start with attempted to review the response headers.

                       

                      Could you share your WildFly configuration ?

                      Maybe you have auto-deploy-zipped set to false in your scanner configuration.

                       

                      Sure, please see my configuration below for my scanner sub-system:

                      Scanner.PNG

                      Again, any assistance is greatly appreciated.

                      Thank-you kindly