Miles to go …

June 16, 2008

TOTD #33: Building GlassFish v3 Workspace

Filed under: general, totd — arungupta @ 11:45 pm

Reviving after a 2-week hiatus

This TOTD (Tip Of The Day) provides complete instructions on how to checkout/build GlassFish v3 workspace.

  1. Check out the workspace as …

    ~/workspaces/glassfish >svn checkout https://svn.dev.java.net/svn/glassfish-svn/trunk/v3
    Error validating server certificate for ‘https://svn.dev.java.net:443′:
     - The certificate is not issued by a trusted authority. Use the
       fingerprint to validate the certificate manually!
    Certificate information:
     - Hostname: *.dev.java.net
     - Valid: from Thu, 09 Aug 2007 06:44:32 GMT until Sat, 09 Aug 2008 06:44:32 GMT
     - Issuer: Equifax Secure Inc., US
     - Fingerprint: e9:12:f6:a0:36:fe:7d:b0:07:dd:8b:d6:c3:b6:29:ff:ba:02:03:46
    (R)eject, accept (t)emporarily or accept (p)ermanently? t
    Authentication realm: <https://svn.dev.java.net:443> CollabNet Subversion Repository
    Password for ‘arungupta’:  <YOUR PASSWORD HERE>
    A    v3/deployment
    A    v3/deployment/javaee-core
    A    v3/deployment/javaee-core/src
    A    v3/deployment/javaee-core/src/main
    . . .
    A    v3/packager/packages/glassfishv3-ejb/build.properties
    A    v3/packager/packages/glassfishv3-ejb/build.xml
    A    v3/packager/packages/glassfishv3-ejb/glassfishv3-ejb.spec.tmpl
    A    v3/packager/packages/README
     U   v3
    Checked out revision 21054.
  2. The directory structure looks like:

    ~/workspaces/glassfish/v3 >ls -la
    total 24
    drwxr-xr-x  25 arungupta  arungupta    850 Jun 16 15:03 .
    drwxr-xr-x   3 arungupta  arungupta    102 Jun 16 14:58 ..
    drwxr-xr-x  10 arungupta  arungupta    340 Jun 16 15:03 .svn
    drwxr-xr-x  17 arungupta  arungupta    578 Jun 16 15:00 admin
    drwxr-xr-x  10 arungupta  arungupta    340 Jun 16 15:01 admingui
    drwxr-xr-x   6 arungupta  arungupta    204 Jun 16 15:01 build
    drwxr-xr-x  15 arungupta  arungupta    510 Jun 16 15:00 common
    drwxr-xr-x   9 arungupta  arungupta    306 Jun 16 15:03 connectors
    drwxr-xr-x   7 arungupta  arungupta    238 Jun 16 14:59 core
    drwxr-xr-x  10 arungupta  arungupta    340 Jun 16 14:58 deployment
    drwxr-xr-x  10 arungupta  arungupta    340 Jun 16 15:01 distributions
    drwxr-xr-x   9 arungupta  arungupta    306 Jun 16 15:01 ejb
    drwxr-xr-x   8 arungupta  arungupta    272 Jun 16 15:02 extras
    drwxr-xr-x   6 arungupta  arungupta    204 Jun 16 15:00 installer
    drwxr-xr-x  27 arungupta  arungupta    918 Jun 16 15:01 javaee-api
    drwxr-xr-x   5 arungupta  arungupta    170 Jun 16 15:02 osgi-platforms
    drwxr-xr-x  13 arungupta  arungupta    442 Jun 16 15:03 packager
    drwxr-xr-x   6 arungupta  arungupta    204 Jun 16 14:58 persistence
    -rw-r–r–   1 arungupta  arungupta  11866 Jun 16 15:03 pom.xml
    drwxr-xr-x   6 arungupta  arungupta    204 Jun 16 15:02 registration
    drwxr-xr-x   7 arungupta  arungupta    238 Jun 16 15:02 security
    drwxr-xr-x   8 arungupta  arungupta    272 Jun 16 15:01 tests
    drwxr-xr-x   8 arungupta  arungupta    272 Jun 16 14:58 transaction
    drwxr-xr-x  15 arungupta  arungupta    510 Jun 16 15:02 web
    drwxr-xr-x   5 arungupta  arungupta    170 Jun 16 14:58 webservices
  3. Set the Maven options as …
    export MAVEN_OPTS=-Xmx512m

    And build the distribution as …

    ~/workspaces/glassfish/v3 >mvn -U install
    [INFO] Scanning for projects…
    [INFO] Reactor build order:
    [INFO]   GlassFish Build Utilities
    [INFO]   GlassFish v3 Maven2 plugin
    [INFO]   Maven extension for building GlassFish
    [INFO]   GlassFish Parent Project
    . . .
    [INFO] ————————————————————————
    [INFO] BUILD SUCCESSFUL
    [INFO] ————————————————————————
    [INFO] Total time: 5 minutes 56 seconds
    [INFO] Finished at: Mon Jun 16 15:33:46 PDT 2008
    [INFO] Final Memory: 57M/121M
    [INFO] ————————————————————————

    You need to use “mvn -U clean install” for a previously built workspace.

  4. Unzip the created distribution as:
    ~/testbed/glassfish/v3/snapshot >unzip ~/workspaces/glassfish/v3/distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip
    Archive:  /Users/arungupta/workspaces/glassfish/v3/distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip
       creating: glassfish/
       creating: glassfish/docs/
    . . .
      inflating: glassfish/lib/templates/keyfile 
      inflating: glassfish/lib/templates/logging.properties 
      inflating: glassfish/lib/templates/login.conf 
      inflating: glassfish/lib/templates/profile.properties 
      inflating: glassfish/lib/templates/server.policy

    The unzipped distribution directory looks like:

    ~/testbed/glassfish/v3/snapshot/glassfish >ls -la
    total 592
    drwxr-xr-x  14 arungupta  arungupta     476 Apr 23 16:37 .
    drwxr-xr-x   3 arungupta  arungupta     102 Jun 16 15:40 ..
    -rw-r–r–   1 arungupta  arungupta  250464 Jun 16 15:24 3RD-PARTY-LICENSE.txt
    -rw-r–r–   1 arungupta  arungupta    4603 Jun 16 15:24 COPYRIGHT
    -rw-r–r–   1 arungupta  arungupta   36116 Jun 16 15:24 LICENSE.txt
    -rw-r-
    -r–   1 arungupta  arungupta     271 Jun 16 15:24 README
    drwxr-xr-x   8 arungupta  arungupta     272 Jun 16 15:33 bin
    drwxr-xr-x   6 arungupta  arungupta     204 Jun 16 15:33 config
    drwxr-xr-x   7 arungupta  arungupta     238 Jun 16 15:33 docs
    drwxr-xr-x   3 arungupta  arungupta     102 Jun 16 15:33 domains
    drwxr-xr-x   5 arungupta  arungupta     170 Jun 16 15:33 felix
    drwxr-xr-x   9 arungupta  arungupta     306 Jun 16 15:32 javadb
    drwxr-xr-x  11 arungupta  arungupta     374 Apr 23 16:37 lib
    drwxr-xr-x  74 arungupta  arungupta    2516 Jun 16 15:33 modules

    Start GlassFish as …

    ~/testbed/glassfish/v3/snapshot/glassfish >bin/asadmin start-domain -v
    Jun 16, 2008 3:44:54 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
    INFO: JVM invocation command line:
    /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
    -cp
    /Users/arungupta/testbed/glassfish/v3/snapshot/glassfish/modules/glassfish-10.0-SNAPSHOT.jar
    -XX:+UnlockDiagnosticVMOptions
    -XX:NewRatio=2
    . . .
    INFO: Started bundle org.glassfish.common.container-common [85]
    Jun 16, 2008 3:44:56 PM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot
    INFO: Admin Console Adapter: context root: /admin
    Jun 16, 2008 3:44:56 PM com.sun.enterprise.v3.server.AppServerStartup run
    INFO: Glassfish v3 started in 1594 ms
    Jun 16, 2008 3:44:56 PM com.sun.enterprise.glassfish.bootstrap.ASMainFelix launchOSGiFW
    INFO: Framework successfully started

And you’ll see the default page as shown below:

Hurrah!

This starts GlassFish v3 using Apache Felix as the OSGi platform. Alternatively, you can start GlassFish using the command “java -jar modules/glassfish-10.0-SNAPSHOT.jar”. The complete instructions are available on GlassFish Wiki.

Please leave suggestions on other TOTD (Tip Of The Day) that you’d like to see. A complete archive is available here.

Technorati: totd glassfish v3 felix osgi

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. TOTD #18: How to Build The GlassFish v3 Gem for JRuby ?
  2. TOTD #34: Using Felix Shell with GlassFish
  3. TOTD #100: Getting Started with Scala Lift on GlassFish v3
  4. TOTD #36: Deploy OSGi bundles in GlassFish using maven-bundle-plugin
  5. TOTD #56: Simple RESTful Web service using Jersey and Embeddable GlassFish – Text and JSON output

8 Comments »

  1. [Trackback] TOTD #33 explains how to create a GlassFish v3 distribution that uses Apache Felix (default) as the&nbsp; OSGi R4 Service Platform runtime. This blog explains how to use Felix Shell TUI with that bundle to issue commands to the OSGi…

    Comment by Arun Gupta's Blog — June 20, 2008 @ 5:56 pm

  2. [Trackback] GlassFish v3 is a modular (OSGi compliant), embeddable (runs in-VM) and extensible (supports non-Java apps) Application Server. The extensible part is demonstrated by deployment of Rails and Grails applications. An example of embeddability is an in-VM…

    Comment by Arun Gupta's Blog — June 26, 2008 @ 6:17 am

  3. [Trackback] Eclipse Ganymede is the annual release of Eclipse projects; this year including 23 projects. Screencast #WS6 showed how GlassFish v2 can be easily registered and started within an earlier version of Eclipse (3.3 specifically). Eclipse is now 3.4 (as…

    Comment by Arun Gupta's Blog — June 27, 2008 @ 6:15 am

  4. [Trackback] JRuby 1.1.3 was released last week – download here. The highlights are: 82 issues resolved since JRUby 1.1.2 RubyGem 1.2 (phew, finally Gem installation is much faster again :) Bunch of Compatibility and Performance problems Going forward, JRuby point…

    Comment by Arun Gupta's Blog — July 21, 2008 @ 11:08 am

  5. [Trackback] Here are different flavors of GlassFish v3 builds: Build your self Nightly Promoted Stable (Technology Preview 2 as of this writing) You can subscribe to dev@glassfish for all the fun! Otherwise check out plan and schedule for GlassFish v3 Prelude….

    Comment by Arun Gupta's Blog — August 27, 2008 @ 4:09 pm

  6. Do you need to have an account on the svn server to do this? When I run the initial svn checkout I get:

    Authentication realm: <https://svn.dev.java.net:443&gt; CollabNet Subversion Repository
    Username: svn: PROPFIND request failed on ‘/svn/glassfish-svn/trunk/v3′
    svn: PROPFIND of ‘/svn/glassfish-svn/trunk/v3′: authorization failed (https://svn.dev.java.net)

    Comment by Steve Lindsay — August 28, 2008 @ 4:33 am

  7. [Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It’s main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this…

    Comment by Arun Gupta's Blog — August 28, 2008 @ 5:50 am

  8. [Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It’s main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this…

    Comment by Arun Gupta's Blog — August 28, 2008 @ 5:57 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress