1 2 Previous Next 16 Replies Latest reply on Dec 14, 2009 7:17 AM by ryden13

    Starting with JBoss Transactions

      Hello

      I want to develop a simple example using WS-Coordination and WS-BusinessActivity. I have seen that JbossTransactions supports those standards but I don´t know what I need install and how to start. Somebody can help me? Thanks!!

        • 1. Re: Starting with JBoss Transactions
          ben.cotton2

          I would start by studying the JBoss Web Services Transactions Guide

          http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/jbossts/Web_Services_Programmers_Guide.pdf

          and gaining a full perspective on XTS.

          Then, I would build/deploy/exercise the XTS demo application that comes with JBoss TS. Then study the XTS demo's source code to see exactly how the WS-BA example is implemented.

          Details for those steps are here: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154081

          • 2. Re: Starting with JBoss Transactions
            adinn

            Ben is right to recommend this course of action. However, you would be much better off using a later version of JBossAS and JBossTS/XTS.

            I recommend that you download JBossAS 5.1.0.GA and the corresponding transaction code in JBossTS 4.6.0.GA from the JBoss svn repository. The programmer's guide in this version includes full documentation of both the WSAT and WSBA APIs. The implementation of XTS in this version includes full support for WSAT and WSBA crash recovery.

            After download you need to build the AS, then TS and finally XTS as follows

            -- build AS

            cd <AStree>/build
            bash build.sh (or run build.bat for windows)
            


            -- set JBOSS_HOME
            export JBOSS_HOME=<ASdir>/build/output/jboss-5.1.0.GA//
            


            -- build JBossTS
            cd <TStree>
            ant jbossjta
            


            -- build and deploy XTS
            cd <TStree>/XTS
            ant install
            cp xts-install/sar/jbossxts.sar $JBOSS_HOME/server/default/deploy
            


            -- build the demo

            cd <TSTree>/XTS/demo
            bash build.sh jboss
            
            cd <TSTree>/XTS/xts-install/demo
            -- edit file jboss.properties and replace HOSTNAME etc as directed
            bash build.sh jboss clean build
            


            -- deploy the demo
            cp <TSTree>/XTS/xts-install/xts-demo.ear $JBOSS_HOME/server/default/deploy
            


            Now start jboss and run the demo from URL
            http://localhost:8080/xts-demo/

            • 3. Re: Starting with JBoss Transactions

              Thanks adinn and Ben!!

              I will start reading this documents and then I will download and install the code example.

              If I have any problems, I will ask in this forum! Thanks again!

              • 4. Re: Starting with JBoss Transactions

                 

                "adinn" wrote:

                -- build AS
                cd <AStree>/build
                bash build.sh (or run build.bat for windows)
                



                I have a problem building AS. When I execute build.bat some errors appears:

                Error building POM (may not be this project´s POM)
                Project ID: org.jboss.jbossas:jboss-as-component-matrix:5.1.0.GA
                Reason: Cannot find parent: org.jboss:jboss-parent for project: org.jboss.jbossas: jboss-as-component-matrix:pom:5.1.0.GA

                Could you help me? Thanks!

                • 5. Re: Starting with JBoss Transactions
                  adinn

                   


                  I have a problem building AS. When I execute build.bat some errors appears:

                  Error building POM (may not be this project´s POM)
                  Project ID: org.jboss.jbossas:jboss-as-component-matrix:5.1.0.GA
                  Reason: Cannot find parent: org.jboss:jboss-parent for project: org.jboss.jbossas: jboss-as-component-matrix:pom:5.1.0.GA


                  Hmm, well I am afraid I am no maven guru . . . I actually have 5.1.0.CR1 installed on my machine. Looking at the pom hierarchy starting from the build directory I see that the parent entries in the pom.xml files points from ASTree/build/pom.xml to ASTree/pom.xml to ASTree/component-matrix/pom.xml. The respective maven projects are jboss-as-build, jboss-as-parent and jboss-as-component-matrix. The last of these three projects does indeed declare its parent to be jboss-parent (not jboss-as-parent). Clearly the error is referring to this last entry but I don't know why it works on my machine but fails on yours.

                  Which maven version are you using? I built my AS using maven 2.0.10. Perhaps that is the problem. If not then perhaps you could try the CR1 release as I have. Failing that the AS users forum is the best place to aks.


                  • 6. Re: Starting with JBoss Transactions

                    Hello

                    When I build JBOSSTS_4_6_0 I have a problem executing build.xml on line 93, but I buil JBOSSTS_4_6_1 this problem disappear.
                    But it does have a /xts directory , so I can´t do the next step:

                    /xts ant install

                    what can I do? Thanks

                    • 7. Re: Starting with JBoss Transactions
                      ben.cotton2

                      JBossTS definitely does have an XTS directory. So if you correctly/fully checked out JBossTS from SVN (svn co http://anonsvn.jboss.org/repos/labs/labs/jbosstm/tags/JBOSSTS_4_6_1_GA/), and you correctly built the TS, proceed with the next step in Andrew's instructions:

                      cd XTS
                      ant install
                      


                      If your workspace really does not have an XTS directory, something happened that shouldn't have -- you should start over with another SVN checkout.

                      • 8. Re: Starting with JBoss Transactions

                        Yes, it was a problem from the source. I have installed all again and its works !! Now I will read the API and studing the example. Is there any example more to try? Thanks!!

                        • 9. Re: Starting with JBoss Transactions
                          ben.cotton2

                          Once you get the XTS demo running on your local JBoss build, start to exercise *all* the different ways you can use XTS to do

                          1) Atomic Transactions (been around decades. 2 outcomes: commit/rollback)
                          2) Business Activty (been around less than a decade and introduces "compensate" as a 3rd possible transaction outcome)

                          Atomic Transactions are very familiar and the XTS demo treats them exactly as you would expect. Drive the demo in "Atomic" mode and see how the XTS plumbing "calls back" the Taxi, Restaurant, and Theater participants to co-ordinate that they can all "commit" to a night on the town. Then ... try to "pull the plug" on one of the participants (e.g. maybe the Theater is sold-out) and XTS will roll-back the entire "night on the town" ... i.e. both your taxi transportation plans and dinner reservations will not be booked.

                          Business Activity is a (relatively) new transaction standard. It was born out of Oasis BTP and evolved (down a long road) into the WS-BA standard. Drive the XTS demo in "Business Activity" mode, and you will be introduced to the "compensate" outcome potential ... which can give you a potentially much more flexible way of managin transactions than the "all or nothing" strictness of Atomic Transactions. Business Activity is a "relaxation" of the Atomic Transaction protocol, and XTS is the very best place to learn this hands on.

                          You might be interested to attach via a remote debugger (i.e. Eclipse) to your JBoss XTS demo code and single-step through the exact APIs used by XTS to drive the demos. These kind of single-step sessions I find to be most informative re: learning XTS internals.

                          If you are seriously interested to be a student of the history of how XTS supported standards evolved (i.e. why does XTS implement WS-AT and WS-BA?), you might want to study the literature of the causes and effects that motivated use transitions from OMG/OTS/CorbaIDL-API to JCP/JTS/JTA-API and onto WS-T/XTS/JSR-156-API.

                          The history is relevant (IMHO). Also, if reading all these TX standards' white papers gets you a little too bogged down in verbage, take a break and visit a video presentation from this guy: http://www.infoq.com/interviews/mark-little-qcon08. (He had another video presentation on www.theserverside.com -- but I can't find that one anymore).

                          Of course, continue to subscribe to this specific forum (and also JBoss Transactions User forum). These forums I find to be the best single possible places to learn about the state-of-the-art in transaction technology, and its implementation of same - JBossTS.

                          • 10. Re: Starting with JBoss Transactions

                            Thanks very much Ben!

                            I am a phD studient and my research is about business transactions. I am working in testing long-lived transactions. So I know enough about transactions :) , but I need example to verify the test cases that I have defined. Do you know if is there any more example to download? If not, I will develop the classic Travel Agency example. What I have to do to start a empty project in Eclipse and uses XTS? Thanks again :)

                            • 11. Re: Starting with JBoss Transactions
                              adinn

                               


                              What I have to do to start a empty project in Eclipse and uses XTS? Thanks again :)


                              If you have managed to build your XTS tree then you will find the deployable service archive jbossxts.sar in xts-install/sar. Install this in the server deploy directory for your app server and you can then also deploy either a client or server application which uses XTS to the same server deploy directory.

                              If you take a look inside the sar file (e.g. jar tvf jbossxts.sar) you will see that is built using a variety of jar and war files. The only one you need to develop an XTS application is the api jar which you will find in xts-install/lib/jbossxts-api.jar. This jar exposes all the publicly visible types your application (and eclipse) needs to know about (see the user guide for a full explanation of how to use the API types). Add this as an external API jar in your eclipse project so that eclipse can resolve references to the XTS API classes. Also ensure that it is in the classpath when you compile your application. That should be all you need.

                              • 12. Re: Starting with JBoss Transactions
                                ben.cotton2

                                 

                                "ryden13" wrote:
                                Do you know if is there any more example to download?



                                You might be interested in also looking at the examples in the JBoss Business Activity Framework project.

                                http://www.jboss.org/jbosstm/baframework/

                                The BA Framework project introduces a library of Annotations that support WS-BA, greatly simplifying how you specify your transactional Web Services' business activity details to XTS.

                                • 13. Re: Starting with JBoss Transactions

                                   


                                  If you take a look inside the sar file (e.g. jar tvf jbossxts.sar) you will see that is built using a variety of jar and war files. The only one you need to develop an XTS application is the api jar which you will find in xts-install/lib/jbossxts-api.jar. This jar exposes all the publicly visible types your application (and eclipse) needs to know about (see the user guide for a full explanation of how to use the API types). Add this as an external API jar in your eclipse project so that eclipse can resolve references to the XTS API classes. Also ensure that it is in the classpath when you compile your application. That should be all you need.


                                  I can use jbossxts-api in my Eclipse projects without error, but when I go to build the web service with
                                  wsgen -cp . -d . -verbose -r ../../WebContent/WEB-INF/wsdl -wsdl ejemplo.EjemploServicio

                                  I have a problem because it cannot found any com/arjuna/wst classes

                                  Can somebody help me? Thanks !

                                  • 14. Re: Starting with JBoss Transactions
                                    jhalliday

                                    > Can somebody help me?

                                    If you can't figure out how to add jars to the wsgen classpath on your own, you are probably beyond help, or at least in need of a remedial introduction to java software development, since it uses the same fundamental -cp/-classpath mechanism as java and javac. You have done java programming before, right?

                                    1 2 Previous Next