4 Replies Latest reply on Jan 20, 2014 6:49 AM by Rob Stryker

    running jboss in eclipse by using a custom bat file

    lp perez Newbie

      Hello everybody,

       

      Is it possible to run jboss in eclipse by using a custom bat file. I need to use it because not all the WARs can be at the same moment in the deployments file.

      If so, how can I do it?

       

      Thank you very much in advance!

      Regards,

      lfph

        • 1. Re: running jboss in eclipse by using a custom bat file
          Max Rydahl Andersen Master

          Hi,

           

          I see two questions:

           

          Is it possible to run jboss in eclipse by using a custom bat file ?

           

          No, eclipse can't use a .bat file to launch jboss with since it won't be able to detect nor kill the java process properly.

          What you can do is launch jboss manually with a custom .bat file and then in eclipse toggle the "assume server is started" option and we will just connect to it.

           

          Second question:

          "because not all the WARs can be at the same moment in the deployments file"

           

          That part I do not understand - I also do not understand how that relate to a custom .bat file.

           

          Can you provide some more details ?

           

          -thanks

          1 of 1 people found this helpful
          • 2. Re: running jboss in eclipse by using a custom bat file
            lp perez Newbie

            Ok thanks!

             

            Not all  WARs can be at the same moment in the deployments file because one application needs to ping the other one. Thus, one application needs to be deployed first and then the other one.

             

            Thank you very much!

            • 3. Re: running jboss in eclipse by using a custom bat file
              Max Rydahl Andersen Master

              Okey - that sounds like a design flaw in those two applications IMO. Not really any way for us to know when it would be right to do the second deployment.

               

              You can do that manually though in the UI but I guess that gets tedious.

              • 4. Re: running jboss in eclipse by using a custom bat file
                Rob Stryker Master

                Most of what you would want to customize in a .bat file are simply flags that are launched to the relevent jboss launcher jar, correct? So what you're really asking is can you customize the launch arguments for running a jboss server. And the answer is that, yes, you can.

                 

                If you double-click your server, the server editor will appear. On the top left section of the editor, you'll see the "General Information" section which includes a link to the launch configuration. Once there, you can customize the launch args for the most part to your heart's content.

                 

                The next part of your question seems to imply that you need two separate deployment folders, one that's deployed early, and one that's deployed later. We've had a user with a similar request in the past, and there is a solution. The solution is also in the server editor, but it may need me to explain a bit.

                 

                JBossTools allows you to customize the deployment folder for any project in the workspace. So for example you can have one web project deployed to {serverhome}/standalone/deployments,  and another deployed to {serverhome}/your/custom/folder.   You can do this also in the server editor. You'll see the editor has two tabs on the bottom of it, and the second is marked as "Deployments". On that page, you can customize the deploy location for any module in the workspace.

                 

                so what will this do exactly? Well, once your server is launched, the server will pick up all deployments in your {serverhome}/standalone/deployments folder first. Once we confirm the server is started, we will add deployment scanners pointing to the other folders that you may be putting deployments. So in this way, one app should be loaded before the second deployment scanners are added.

                 

                I can't guarantee this will work 100%. It's possible it still fails if your initial standalone/deployments module is very large and the others are small. But, after adding this workflow, our other user never came back with any complaints.

                 

                If you still have problems, feel free to ping again.