1 2 Previous Next 21 Replies Latest reply on Jan 21, 2009 3:51 AM by jaikiran pai

    EJBTHREE-1607 Update EJB3.0 Tutorials

    jaikiran pai Master

      I have been updating the EJB3 tutorials and have committed the "stateless" tutorial at https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/stateless/

      The plan is to allow the users to run these tutorials either through Ant or through Maven. For this "stateless" tutorial, the instructions to run the tutorial are at https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/stateless/stateless.html. The steps are going be the same for rest of the tutorials (ex: "stateful").

      Ant build:

      The Ant build for each tutorial consists of targets, which create a jar file and copy(deploy) it to the JBossAS deploy folder. There is an additional target "run" which the user can then use to run the standalone EJB client. So its a 2 step process for the user:

      $ ant
      $ ant run
      


      Maven build:

      The Maven support for the tutorials is new. During the "package" phase the generated artifact (jboss-ejb3-tutorial-stateless.jar) is copied to the deploy folder of JBoss. Then during the "install" phase, the standalone client is run.

      So the user will do:

      $ mvn clean install



      The pom for this has been checked in for reference r82111

      Note that, both in the Ant and the Maven approach, we expect the user to manually start the server.

      Carlo mentioned to me that, we should be able to start the server from within the top-level pom https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/pom.xml so that these tutorials can be included into Hudson builds.

      Andrew, I heard that we already have some similar stuff for starting the server through Maven. Could you please point me to that?








        • 1. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
          Andrew Rubinger Master

           

          "jaikiran" wrote:
          Andrew, I heard that we already have some similar stuff for starting the server through Maven. Could you please point me to that?


          http://anonsvn.jboss.org/repos/maven/plugins/jbossas/trunk/

          It's the "example" project which has a POM to show a working configuration.

          I meant to release this awhile ago, if I remember correctly there was some issue in starting AS from a JBOSS_HOME with spaces in the path under Win32.

          S,
          ALR

          • 2. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
            Andrew Rubinger Master

            BTW, to get this written somewhere:

            I've been hoping for awhile to have some self-validating documentation much like this, which accomplishes:

            * CI runs to ensure the examples stay up-to-date
            * Make the examples "live", ie runnable so a user can play around and execute tests via a webapp so see them in action

            So this is a step in the right direction.

            S,
            ALR

            • 3. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
              jaikiran pai Master

               

              "ALRubinger" wrote:


              http://anonsvn.jboss.org/repos/maven/plugins/jbossas/trunk/

              It's the "example" project which has a POM to show a working configuration.



              Thanks Andrew.

              I mvn installed it on my local repo. The pom.xml in the "example" project however has a typo:

              <profiles>
               <profile>
               <!-- Declare the "Integration Test" Profile -->
               <id>it</id>
               <build>
               <plugins>
               ....
               <!--
              
               Define the JBossAS Maven Control Plugin
              
               -->
               <plugin>
              
               <groupId>org.jboss.maven.plugins</groupId>
               <artifactId>maven-jboss-as-control-plugin</artifactId>
               <version>0.1.0-SNAPSHOT</version>
              


              The groupId should have been org.jboss.maven.plugins.jbossas. This is not caught (build succeeds) in the mvn install because of the "profile". However, running

              mvn install -P it


              shows this error:

              [INFO] Failed to resolve artifact.
              
              GroupId: org.jboss.maven.plugins
              ArtifactId: maven-jboss-as-control-plugin
              Version: 0.1.0-SNAPSHOT
              


              I have made the fix to the groupId in the example locally. Let me know if i can check it in.

              • 4. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                jaikiran pai Master

                With this change, i was able to move forward to the point where the JBoss-5 GA server was being started from the maven-jboss-as-control-plugin. This maven-jboss-as-control-plugin uses 1.0.0.GA version of the jboss-server-manager:

                <version.org.jboss.jbossas_jboss-server-manager>1.0.0.GA</version.org.jboss.jbossas_jboss-server-manager>
                 <!-- JBoss AS Server Manager -->
                 <dependency>
                 <groupId>org.jboss.jbossas</groupId>
                 <artifactId>jboss-server-manager</artifactId>
                 <version>${version.org.jboss.jbossas_jboss-server-manager}</version>
                 </dependency>


                Unfortunately, the jboss-server-manager fails to start the JBoss-5 GA server. It fails with:

                Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
                 java.io.InvalidClassException: org.jboss.security.auth.callback.SecurityAssociationHandler; class invalid for deserialization
                 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
                 at sun.rmi.transport.Transport$1.run(Transport.java:153)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
                 at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
                 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
                 at java.lang.Thread.run(Thread.java:595)
                Caused by: java.io.InvalidClassException: org.jboss.security.auth.callback.SecurityAssociationHandler; class invalid for deserialization
                 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:571)
                 at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
                 at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
                 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                 at org.jboss.invocation.MarshalledInvocation.readExternal(MarshalledInvocation.java:665)
                 at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                 at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
                 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
                 ... 6 more
                


                Based on this thread, http://www.jboss.com/index.html?module=bb&op=viewtopic&t=146034&postdays=0&postorder=asc&start=20#4193133, the fix is in 2.0.2.SP3 of the org.jboss.security module. The jboss-server-manager in 1.0.0GA version as well as in trunk uses

                <version.org.jboss.security>2.0.2.CR9</version.org.jboss.security>


                I have locally updated the pom for jboss-server-manager and created a 1.0.1-SNAPSHOT to use in the maven-jboss-as-control-plugin. With these changes, i now have the server statup/stop/deploy working through the Maven plugin.


                To summarize - The 1.0.0 GA version and trunk of jboss-as-server with JBoss-5.0 GA fails.

                • 5. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                  jaikiran pai Master

                  In the meantime, i have commited the initial version of the user guide for using the tutorials. Right now the guide only has the documentation for "stateless" tutorial. The guide is built using jdocbook Maven plugin and is available at

                  https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/guide/
                  Anonymous: http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/guide/

                  The user guide can be built using either

                  cd docs/tutorial/guide
                  mvn clean compile


                  or
                  cd docs/tutorial/guide
                  mvn clean install


                  The html version of the guide can then be found under docs/tutorial/guide/target/docbook/html/index.html


                  • 6. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                    jaikiran pai Master

                     

                    "jaikiran" wrote:



                    To summarize - The 1.0.0 GA version and trunk of jboss-as-server with JBoss-5.0 GA fails.


                    Created https://jira.jboss.org/jira/browse/JBASM-26 for tracking.

                    • 7. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                      Andrew Rubinger Master

                      Jaikiran:

                      I've released:

                      JBossAS Maven Plugins 0.1.0 ("example" is 0.1.1)
                      jboss-server-manager:1.0.1.GA

                      These should give you some hard dependencies to rely upon. Please give them a spin in the morning and let me know if they'll be sufficient, I'll be offline for a few days.

                      S,
                      ALR

                      • 8. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                        jaikiran pai Master

                        Thanks Andrew. A new run is in progress, will let you know how it goes.

                        • 9. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                          jaikiran pai Master

                           

                          "ALRubinger" wrote:
                          Please give them a spin in the morning and let me know if they'll be sufficient, I'll be offline for a few days.



                          Works without any issues :)

                          • 10. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                            jaikiran pai Master

                            r82451 now contains the updated dependencies for the Maven plugin. It also containing additional tutorials like "stateful" and "jndibinding" in addition to the earlier "stateless" tutorial. I had plans to add a few more tutorials during this commit, but i see a probable issue in Maven where the plugin execution order isn't as per their documentation. I'll investigate more into this on Monday.

                            I have done a local Hudson run against this revision with JBossAS-5.0 GA. It went of successfully.

                            By the way, there's now a wiki with the details to run the tutorials https://www.jboss.org/community/docs/DOC-13215

                            • 11. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                              jaikiran pai Master

                               

                              "jaikiran" wrote:
                              I had plans to add a few more tutorials during this commit, but i see a probable issue in Maven where the plugin execution order isn't as per their documentation. I'll investigate more into this on Monday.



                              Turns out this is an issue in Maven 2.0.9 and 2.0.10 http://jira.codehaus.org/browse/MNG-3719


                              • 12. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                                jaikiran pai Master

                                r82532 now has 15 working tutorials (both in Ant and Maven) out of around 30 odd original tutorials. I will be continuing with the rest of them.

                                • 13. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                                  Andrew Rubinger Master

                                  Finally took a look today; cool. :)

                                  I've got a couple ideas we could discuss for the next phase:

                                  * Deploying the docs via DAV or some other mechanism to a www-accessible site
                                  * Adding a Hudson run to verify everything is OK
                                  * Making an assembly of all docs together with an index for separate download

                                  S,
                                  ALR

                                  • 14. Re: EJBTHREE-1607 Update EJB3.0 Tutorials
                                    Andrew Rubinger Master

                                     

                                    "jaikiran" wrote:
                                    The groupId should have been org.jboss.maven.plugins.jbossas. This is not caught (build succeeds) in the mvn install because of the "profile". However, running

                                    mvn install -P it


                                    shows this error:

                                    [INFO] Failed to resolve artifact.
                                    
                                    GroupId: org.jboss.maven.plugins
                                    ArtifactId: maven-jboss-as-control-plugin
                                    Version: 0.1.0-SNAPSHOT
                                    


                                    I have made the fix to the groupId in the example locally. Let me know if i can check it in.


                                    Is this now fixed in the release you're using? I made some cleanup changes last week.

                                    S,
                                    ALR

                                    1 2 Previous Next