7 Replies Latest reply on Nov 5, 2013 5:03 AM by Bartosz Majsak

    jboss7 embedded

    Israel E. Bethencourt Newbie

      Hello,

       

      I'm using the jboss7 managed container adapter. Now, I want to be able to use the eclipse debugger, but since the container is executing in other jvm I should switch to the remote container and use remote debugger (you know: -Xrunjdwp:transport=dt_socket,address=4242,server=y,suspend=n)

       

      I want to simplify as much as possible my development environment (I mean: git pull and start coding) so I prefer using a embedded jboss7 and debug my tests on a single jvm. I've seen it is available with the adaptor http://arquillian.org/modules/jbossas7-embedded-container-adapter/ but it is not documented and seems nobody are using it. I tried but I can not get it work.

       

      Somebody knows how can I configure that adaptor?

       

      Greetings.

        • 1. Re: jboss7 embedded
          Bartosz Majsak Master

          Just out of curiosity - why would you prefer embedded (single jvm) approach instead of managed one? Are there any serious benefits besides slightly lower memory footprint (this is the only one I can think of at the moment)?

          • 2. Re: jboss7 embedded
            Israel E. Bethencourt Newbie

            Hi,

             

            I've said it in my post. I can not use the eclipse debugger with the managed adaptor, since it is running in other jvm

             

            Greetings.

            • 3. Re: jboss7 embedded
              Bartosz Majsak Master

              But  you can use "remote debugging" for managed container as well. In eclipse you just attach remote debugger to localhost:4242 (as in your example)

              One important thing is to use suspend=y instead, so the container will wait until you attach your debugger from your IDE and then starts up.

              • 4. Re: jboss7 embedded
                Israel E. Bethencourt Newbie

                Hi, I was tried, but it works a little bit odd. At least I was not able to make it work as someone could expect, without a guide explaining how to configure launch the debugger.

                 

                What I mean is that if you want to debug a test inside of eclipse. First, you need to execute the test, using suspend=y the jboss will wait until you execute the "Remote Java application" configured to connect to the jboss and finally you get your debugger working. I'm not pretty sure if I'm missing something to debug in one only single step. But in this scenario it is much better using the remote adaptor, at least you can start the jboss at the beginning of your coding session. With the managed you need to do the two steps every time you run your test.

                 

                The remote/managed adaptors could do the work if you really want to use jboss, but what I want is to sell to my developers a really solid solution to test, debug and code. I don't want to present a solution with lot of tricks for things can be done easily in others frameworks. The embedded adaptor could be the solution and seems its development is active, but there is no documentation at all.

                 

                Greetings.

                • 5. Re: jboss7 embedded
                  Bartosz Majsak Master

                  Obviously both approaches have pros and cons, but speaking from my own experience, the current way how embedded containers are handled is way far from what I would consider a productive setup. In brief you have one big bag of everything what you have in your classpath which might lead to serious headaches once in a while. There is no proper classloader isolation yet, so for instance you might end up having to downgrade one library in order to make your embedded container happy (real life example: google guava - weld in GF embedded is using version ~10.1 if I remember correctly, and latest stable is 15... so no fancy new stuff for you if you prefer embedded container).

                   

                  That said, I'm in favor of proper isolation, so I always choose managed containers. You can specify debug flags in arquillian.xml (as part of javaVmArguments). Also, you actually need one step - attach your debbuger, the same way you do with Remote Adaptor. That's pretty much it. Obviously for the build you will most likely need to turn it off, but there are several easy ways to do it (if you don't want to edit it manually for each and every debug session). One is to use arquillian.launch property.

                  The remote/managed adaptors could do the work if you really want to use jboss, but what I want is to sell to my developers a really solid solution to test, debug and code. I don't want to present a solution with lot of tricks for things can be done easily in others frameworks. The embedded adaptor could be the solution and seems its development is active, but there is no documentation at all.

                  Well... as I mentioned above, embedded is not really that solid and it might hurt your developers from time to time I also do not understand why managed is not solid solution in your eyes. We are already outside of the easy and nice world of unit testing, so a bit of configuration is always required.

                   

                  Anyway, if you really want to use embedded as7 container I believe aslak.aslak.conduct.no or alrubinger can help here.

                   

                  Cheers,

                  Bartosz

                  • 6. Re: jboss7 embedded
                    Israel E. Bethencourt Newbie

                    Hello,

                     

                    First of all I would like to give you many thanks for all the time you spend responding me.

                     

                    That response and arguments are so far from what I've seen in all other posts. Your considerations about classloader isolation has given really good reasons to choose one over other.

                     

                    Anyway I will try to contact with the persons you said, simply for curiosity.

                     

                    Again, thank you so much.

                     

                    Greetings.

                    • 7. Re: jboss7 embedded
                      Bartosz Majsak Master

                      I think you can have a look at this stuff https://github.com/wildfly/wildfly/tree/master/arquillian/container-embedded/src/test

                      My feeling is that it will simply end up changing dependencies in POM and maybe a bit of arquillian.xml adjustments.  Tests written in Arquillian are really portable.