9 Replies Latest reply on Mar 6, 2008 9:24 PM by alrubinger

    EJB3 Plugin Installer; Multiplatform

    alrubinger

      The EJB3 Plugin Installer is used to patch an existing AS5 Installation with EJB3 Binaries from Projects.

      I'm a bit concerned about cross-platform execution, so will post instructions for running the installer here. If anyone's got a couple minutes to run through the following and report problems, I'd appreciate it. (We're testing the execution of Ant here, not the validity of the buildfile or final product).

      Build like:

      > svn co https://svn.jboss.org/repos/jbossas/projects/ejb3/trunk/ .
      > mvn clean install


      It takes 1 argument, the location of an existing JBoss AS installation.

      Execute like:

      > java -jar \
      target/jboss-ejb3-parent-0.11.0-SNAPSHOT-installer.jar \
      /home/alrubinger/jboss-5.0.0.Beta3/


      Requirements:

      * ANT_HOME defined and pointed properly to Ant
      * First argument is location of regular install of AS (I just unzip Beta3 here)

      Again, if Ant executes without exception, it's all good in the hood. The buildfile itself is under construction.

      S,
      ALR

        • 1. Re: EJB3 Plugin Installer; Multiplatform
          alrubinger

          I'll note that this works for me on Linux (F8) and WinXP.

          S,
          ALR

          • 2. Re: EJB3 Plugin Installer; Multiplatform
            alrubinger

            Bump. Scott, I'm assuming you're running the Plugin on your Mac? If so, I'll consider the code "good enough", having covered Win32, Linux, Mac each in some rudimentary form.

            S,
            ALR

            • 3. Re: EJB3 Plugin Installer; Multiplatform
              starksm64

              No, I'm not using the plugin as I'm just building the ejb3.deployer from the thirdparty contents other than the org.jboss.ejb3.deployers.* code and related descriptors. jbossas trunk is also now only using the ejb3 project artifacts.

              I can test the plugin on osx if needed.

              • 4. Re: EJB3 Plugin Installer; Multiplatform
                alrubinger

                Yup. Just need a "java -jar plugin/target/filename.jar $JBOSS_HOME" on it and a thumbs-up or down.

                S,
                ALR

                • 5. Re: EJB3 Plugin Installer; Multiplatform
                  anil.saldhana

                  I do not think you will have any platform issues with your plugin installer, Andrew. But as Adrian says, nothing is guaranteed until tested. :)

                  • 6. Re: EJB3 Plugin Installer; Multiplatform
                    alrubinger

                    Because the Installer invokes Ant, for Win32 I did have to add:

                    // Windows Hack
                     if (System.getProperty(Installer.SYSTEM_PROPERTY_OS).trim().toLowerCase().contains("windows"))
                     {
                     antCommand = antCommand + Installer.COMMAND_EXTENSION_WINDOWS;
                     }


                    ...to account for the ".bat" extension.

                    S,
                    ALR

                    • 7. Re: EJB3 Plugin Installer; Multiplatform
                      alrubinger

                      Scott observed the following on Win32/Cygwin:

                      Using ANT_HOME: /usr/java/apache-ant-1.6.5
                      Starting Ant> /usr/java/apache-ant-1.6.5\bin\ant.bat -f C:\DOCUME~1\starksm\LOCA
                      LS~1\Temp\jbossas-ejb3-plugin-installer\build-install-ejb3-plugin.xml
                      Exception in thread "main" java.lang.RuntimeException: Ensure Apache Ant is prop
                      erly installed and Environment Variable ANT_HOME is set
                       at org.jboss.ejb3.installer.Installer.runAnt(Installer.java:380)
                       at org.jboss.ejb3.installer.Installer.install(Installer.java:206)
                       at org.jboss.ejb3.installer.Installer.main(Installer.java:157)
                      Caused by: java.io.IOException: CreateProcess: \usr\java\apache-ant-1.6.5\bin\an
                      t.bat -f C:\DOCUME~1\starksm\LOCALS~1\Temp\jbossas-ejb3-plugin-installer\build-i
                      nstall-ejb3-plugin.xml error=5


                      ...so I added Revision 70526, http://fisheye.jboss.org/changelog/JBossAS/?cs=70526, which will no longer sniff for OS Strings in the System properties, but for presence of filename itself.

                      S,
                      ALR

                      • 8. Re: EJB3 Plugin Installer; Multiplatform
                        starksm64

                        Now I'm seeing:

                        Starting Ant> /usr/java/apache-ant-1.6.5\bin\ant -f C:\DOCUME~1\starksm\LOCALS~1
                        \Temp\jbossas-ejb3-plugin-installer\build-install-ejb3-plugin.xml
                        Exception in thread "main" java.lang.RuntimeException: Ensure Apache Ant is properly installed and Environment Variable ANT_HOME is set
                         at org.jboss.ejb3.installer.Installer.runAnt(Installer.java:376)
                         at org.jboss.ejb3.installer.Installer.install(Installer.java:201)
                         at org.jboss.ejb3.installer.Installer.main(Installer.java:152)
                        Caused by: java.io.IOException: CreateProcess: \usr\java\apache-ant-1.6.5\bin\ant -f C:\DOCUME~1\starksm\LOCALS~1\Temp\jbossas-ejb3-plugin-installer\build-install-ejb3-plugin.xml error=193
                         at java.lang.ProcessImpl.create(Native Method)
                         at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
                         at java.lang.ProcessImpl.start(ProcessImpl.java:30)
                         at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
                         at org.jboss.ejb3.installer.Installer.runAnt(Installer.java:354)
                         ... 2 more
                        Shutdown Hook called...
                        Starting Cleanup...
                        Cleanup Complete.
                        


                        the problem is that winxp does not know how to run the ant sh script. It only under a cygwin shell. I added an ANT_CMD to allow the path to be specified. That also first failed because the ant.bat file did not have its executable bit set. Once I fixed that, the plugin is running.

                        You would have to cactch this IOException and then try a bat extension.


                        • 9. Re: EJB3 Plugin Installer; Multiplatform
                          alrubinger

                          I see.

                          I've actually never used cygwin, but I dual-boot F8/WinXP so I'll install it and fix this.

                          S,
                          ALR