Miles to go …

November 18, 2010

TOTD #150: Collection of GlassFish, NetBeans, JPA, JSF, JAX-WS, EJB, Jersey, MySQL, Rails, Eclipse, and OSGi tips

This is the 150th tip published on this blog so decided to make it a collection of all the previous ones. Here is a tag cloud (created from wordle.net/create) from title of all the tips:

As expected GlassFish is the most prominent topic. And then there are several entries on NetBeans, JRuby/Rails, several Java EE 6 technologies like JPA, JAX-WS, JAX-RS, EJB, and JSF, and more entries on Eclipse, OSGi and some other tecnhologies too. Here is a complete collection of all the tips published so far:

  • #149: How to clean IntelliJ cache, preferences, etc on Mac OS X ?
  • #148: JPA2 Metamodel Classes in NetBeans 7.0 – Writing type-safe Criteria API
  • #147: Java Server Faces 2.0 Composite Components using NetBeans – DRY your code
  • #146: Understanding the EJB 3.1 Timer service in Java EE 6 – Programmatic, Deployment Descriptor, @Schedule
  • #145: CDI Events – a light-weight producer/consumer in Java EE 6
  • #144: CDI @Produces for container-managed @Resource
  • #143: Retrieve Twitter user timeline using using Jersey and OAuth
  • #142: GlassFish 3.1 – SSH Provisioning and Start/Stop instance/cluster on local/remote machines
  • #141: Running GlassFish 3.1 on Ubuntu 10.04 AMI on Amazon EC2
  • #140: Moving GlassFish Installation – Referenced file does not exist "osgi-main.jar"
  • #139: Asynchronous Request Processing using Servlets 3.0 and Java EE 6
  • #138: GlassFish 3.1 Milestone 1 – Clustering and Application Versioning Demos
  • #137: Asynchronous EJB, a light-weight JMS solution – Feature-rich Java EE 6
  • #136: Default Error Page using Servlets 3.0 – Improved productivity using Java EE 6
  • #135: JSF2 Composite Components using NetBeans IDE – lightweight Java EE 6
  • #134: Interceptors 1.1 in Java EE 6 – What and How ?
  • #133: JPA2 (JPQL & Criteria), JavaDB, and embedded GlassFish – perfect recipe for testing
  • #132: Servlets 3.0 in Embedded GlassFish Reloaded – lightweight Java EE 6
  • #131: Dynamic OSGi services in GlassFish – Using ServiceTracker
  • #130: Invoking a OSGi service from a JAX-WS Endpoint – OSGi and Enterprise Java
  • #129: Managed Beans 1.0 in Java EE 6 – What and How ?
  • #128: EJBContainer.createEJBContainer: Embedded EJB using GlassFish v3
  • #127: Embedding GlassFish in an existing OSGi runtime – Eclipse Equinox
  • #126: Creating an OSGi bundles using Eclipse and deploying in GlassFish
  • #125: Creating an OSGi bundles using NetBeans and deploying in GlassFish
  • #124: OSGi Declarative Services in GlassFish – Accessed from a Java EE client
  • #124: Using CDI + JPA with JAX-RS and JAX-WS
  • #123: f:ajax, Bean Validation for JSF, CDI for JSF and JPA 2.0 Criteria API – all in one Java EE 6 sample application
  • #122: Creating a JPA Persistence Unit using NetBeans 6.8
  • #121: JDBC resource for MySQL and Oracle sample database in GlassFish v3
  • #120: Deployment Descriptor-free Java EE 6 application using JSF 2.0 + EJB 3.1 + Servlets 3.0
  • #119: Telnet to GlassFish v3 with NetBeans 6.8 – "Could not open connection to the host"
  • #118: Managing OSGi bundles in GlassFish v3 – asadmin, filesystem, telnet console, web browser, REST, osgish
  • #117: Invoke a JAX-WS Web service from a Rails app deployed in GlassFish
  • #116: GlassFish v3 Administration using JavaFX front-end – JNLP available
  • #115: GlassFish in Eclipse – Integrated Bundle, Install Stand-alone or Update Existing plugin
  • #114: How to enable Java Console in Mac OS X, Windows, … ?
  • #113: JavaFX front-end for GlassFish v3 Administration – Using REST interface
  • #112: Exposing Oracle database tables as RESTful entities using JAX-RS, GlassFish, and NetBeans
  • #111: Rails Scaffold for a pre-existing table using Oracle and GlassFish
  • #110: JRuby on Rails application using Oracle on GlassFish
  • #109: How to convert a JSF managed bean to JSR 299 bean (Web Beans) ?
  • #108: Java EE 6 web application (JSF 2.0 + JPA 2.0 + EJB 3.1) using Oracle, NetBeans, and GlassFish
  • #107: Connect to Oracle database using NetBeans
  • #106: How to install Oracle Database 10g on Mac OS X (Intel) ?
  • TOTD #105: GlassFish v3 Monitoring – How to monitor a Rails app using asadmin, JavaScript, jConsole, REST ?
  • #104: Popular Ruby-on-Rails applications on GlassFish v3 – Redmine, Typo, Substruct
  • #103: GlassFish v3 with different OSGi runtimes – Felix, Equinox, and Knoplerfish
  • #102: Java EE 6 (Servlet 3.0 and EJB 3.1) wizards in Eclipse
  • #101: Applying Servlet 3.0/Java EE 6 “web-fragment.xml” to Lift – Deploy on GlassFish v3
  • #100: Getting Started with Scala Lift on GlassFish v3
  • #99: Creating a Java EE 6 application using MySQL, JPA 2.0 and Servlet 3.0 with GlassFish Tools Bundle for Eclipse
  • #98: Create a Metro JAX-WS Web service using GlassFish Tools Bundle for Eclipse
  • #97: GlassFish Plugin with Eclipse 3.5
  • #96: GlassFish v3 REST Interface to Monitoring and Management – JSON, XML, and HTML representations
  • #95: EJB 3.1 + Java Server Faces 2.0 + JPA 2.0 web application – Getting Started with Java EE 6 using NetBeans 6.8 M1 & GlassFish v3
  • #94: A simple Java Server Faces 2.0 + JPA 2.0 application – Getting Started with Java EE 6 using NetBeans 6.8 M1 & GlassFish v3
  • #93: Getting Started with Java EE 6 using NetBeans 6.8 M1 & GlassFish v3 – A simple Servlet 3.0 + JPA 2.0 app
  • #92: Session Failover for Rails applications running on GlassFish
  • #91: Applying Java EE 6 "web-fragment.xml" to Apache Wicket – Deploy on GlassFish v3
  • #90: Migrating from Wicket 1.3.x to 1.4 – "Couldn’t load DiskPageStore index from file" error
  • #89: How to add pagination to an Apache Wicket application
  • #88: How add pagination to Rails – will_paginate
  • #87: How to fix the error undefined method `new’ for "Rack::Lock":String caused by Warbler/JRuby-Rack ?
  • #86: Getting Started with Apache Wicket on GlassFish
  • #85: Getting Started with Django Applications on GlassFish v3
  • #84: Using Apache + mod_proxy_balancer to load balance Ruby-on-Rails running on GlassFish
  • #83: Eclipse Tools Bundle for GlassFish 1.0 – Now Available!
  • #82: Getting Started with Servlet 3.0 and EJB 3.1 in Java EE 6 using NetBeans 6.7
  • #81: How to use nginx to load balance a cluster of GlassFish Gem ?
  • #80: Sinatra CRUD application using Haml templates with JRuby and GlassFish Gem
  • #79: Getting Started with Sinatra applications on JRuby and GlassFish Gem
  • #78: GlassFish, EclipseLink, and MySQL efficient pagination using LIMIT
  • #77: Running Seam examples with GlassFish
  • #76: JRuby 1.2, Rails 2.3, GlassFish Gem 0.9.3, ActiveRecord JDBC Adapter 0.9.1 – can they work together ?
  • #75: Getting Started with Grails using GlassFish v3 Embedded
  • #74: JRuby and GlassFish Integration Test #5: JRuby 1.2.0 RC2 + Rails 2.x.x + GlassFish + Redmine
  • #73: JRuby and GlassFish Integration Test #4: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v2 + Warbler
  • #72: JRuby and GlassFish Integration Test #3: JRuby 1.2.0 RC2 + Rails 2.2.x + GlassFish v3
  • #71: JRuby and GlassFish Integration Test #2: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish v3 Prelude
  • #70: JRuby and GlassFish Integration Test# 1: JRuby 1.2.0 RC1 + Rails 2.2.x + GlassFish Gem
  • #69: GlassFish High Availability/Clustering using Sun Web Server + Load Balancer Plugin on Windows Vista
  • #68: Installing Zones in Open Solaris 2008/11 on Virtual Box
  • #67: How to front-end a GlassFish Cluster with Apache + mod_jk on Mac OSX Leopard ?
  • #66: GlassFish Eclipse Plugin 1.0.16 – Install v3 Prelude from the IDE
  • #65: Windows 7 Beta 1 Build 7000 on Virtual Box: NetBeans + Rails + GlassFish + MySQL
  • #64: OpenSolaris 2008/11 using Virtual Box
  • #63: jmx4r gem – How to manage/monitor your Rails/Merb applications on JRuby/GlassFish ?
  • #62: How to remotely manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX API ?
  • #61: How to locally manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX ?
  • #60: Configure MySQL 6.0.x-alpha to NetBeans 6.5
  • #59: How to add Twitter feeds to blogs.sun.com ? + Other Twitter Tools
  • #58: Jersey and GlassFish – how to process POST requests ?
  • #57: Jersey Client API – simple and easy to use
  • #56: Simple RESTful Web service using Jersey and Embeddable GlassFish – Text and JSON output
  • #55: How to build GlassFish v3 Gem ?
  • #54: Java Server Faces with Eclipse IDE
  • #53: Scaffold in Merb using JRuby/GlassFish
  • #52: Getting Started with Merb using GlassFish Gem
  • #51: Embedding Google Maps in Java Server Faces using GMaps4JSF
  • #50: Mojarra 2.0 EDR2 is now available – Try them with GlassFish v3 and NetBeans 6.5
  • #49: Converting a JSF 1.2 application to JSF 2.0 – @ManagedBean
  • #48: Converting a JSF 1.2 application to JSF 2.0 – Facelets and Ajax
  • #47: Getting Started with Mojarra 2.0 nightly on GlassFish v2
  • #46: Facelets with Java Server Faces 1.2
  • #45: Ajaxifying Java Server Faces using JSF Extensions
  • #44: JDBC Connection Pooling for Rails on GlassFish v3
  • #43: GlassFish v3 Build Flavors
  • #42: Hello JavaServer Faces World with NetBeans and GlassFish
  • #41: How I created transparent logo of GlassFish using Gimp ?
  • #40: jQuery Autcomplete widget with MySQL, GlassFish, NetBeans
  • #39: Prototype/Script.aculo.us Autcomplete widget with MySQL, GlassFish, NetBeans
  • #38: Creating a MySQL Persistence Unit using NetBeans IDE
  • #37: SQLite3 with Ruby-on-Rails on GlassFish Gem
  • #36: Writing First Test for a Rails Application
  • #35: Rails Database Connection on Solaris
  • #34: Using Felix Shell with GlassFish
  • #33: Building GlassFish v3 Workspace
  • #32: Rails Deployment on GlassFish v3 from NetBeans IDE
  • #31: CRUD Application using Grails – Hosted on GlassFish and MySQL
  • #30: CRUD Application using Grails – Hosted on Jetty and HSQLDB
  • #29: Enabling "Available Plugins" tab in NetBeans IDE
  • #28: Getting Started with Rails 2.0 Scaffold
  • #27: Configurable Multiple Ruby Platforms in NetBeans 6.1 M1
  • #26: Overriding Database Defaults in Rails 2.0.2
  • #25: Rails application with PostgreSQL database using NetBeans
  • #24: Getting Started with Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1RC1
  • #23: JavaFX Client invoking a Metro endpoint
  • #22: Java SE client for a Metro endpoint
  • #21: Metro 1.1 with GlassFish v2 UR1 and NetBeans 6
  • #20: How to create a new jMaki widget ?
  • #19: How to Add Metro Quality-of-Service to Contract-First Endpoint ?
  • #18: How to Build The GlassFish v3 Gem for JRuby ?
  • #17: Backing Up your Blog Posts on Roller
  • #16: Optimizing Metro Stubs by locally packaging the WSDL
  • #15: Delete/Update Row from Database using jMaki Data Table
  • #14: How to generate JRuby-on-Rails Controller on Windows (#9893)
  • #13: Setup Mongrel for JRuby-on-Rails applications on Windows
  • #12: Invoking a Java EE 5 Web service endpoint from JRuby
  • #11: Setup Mongrel cluster for JRuby-on-Rails applications on Unix
  • #10: Consuming JSON and XML representations generated by a Jersey endpoint in a jMaki Table widget
  • #9: Using JDBC connection pool/JNDI name from GlassFish in Rails Application
  • #8: Generating JSON using JAXB annotations in Jersey
  • #7: Switch between JRuby and CRuby interpreter in NetBeans 6
  • #6: Difference between Ruby Gem and Rails Plugin
  • #5: Loading data from beans in jMaki widgets
  • #4: How to convert a Session EJB to a Web service ?
  • #3: Using JavaDB with JRuby on Rails
  • #2: Change the endpoint address on a pre-generated Web services Stub
  • #1: SOAP Messaging Logging in Metro

Just for fun, here is another tag cloud:

You can access all the tips here. And keep those suggestions coming!

Technorati: totd glassfish netbeans jpa jsf jaxws jersey mysql rails osgi eclipse

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

March 22, 2010

Day 2 – Ruby Conf India 2010 Trip Report

Filed under: glassfish, netbeans, rails — arungupta @ 3:40 am

Ruby Conf India 2010 Day 2 (follow up from Day 1) started with Nick Sieger’s presentation on "Rails 3 Through Choices".

He started by talking about the state of Ruby in 2010

  • New Ruby Gems site (gemcutter), ported 11k gems
  • Multiple alternative Ruby VMs, Ruby 1.8 is 7 years old

    • JRuby 1.5 in April 2010
    • Rubinius in Q2 2010
    • Ruby 2.0
  • RubyToolBox, RailsPlugins.org, Github, Rails Guides are some of the popular and useful websites

Liked the "Auto" mode of camera analogy with Rails 3, basically start changing the settings as you get more advanced.

Here are some of the highlights of Rails 3:

  • –skip-activerecord, –skip-testunit, –skip-prototype are new options in Rails 3
  • script/server | generate | console == script/rails s g c == rails server generate console (within the app directory)
  • Routing is much cleaner
  • XSS safety is default in Rails 3
  • Railties: extension API for Rails – encapsulates configuration information and enables decoupling.

    • Four main components: Initialization, Rake tasks, Generators, Logging Events.
    • All components in Rails are themselves Railties.
  • Rack is now bundled in Rails 3
  • ActiveModel: creates a contract between controller and model (7 methods), can be connected to any backend data store, provides a bunch of default functionality
  • Migration from 2.0 -> 3.0: bit.ly/online-railsconf-slides has a presentation on migration from earlier versions.

Railties certainly reminds me of the recent modularity in JDK 7 and GlassFish v3. Watch Nick’s demo of Rails 3 in this 2-part video. It showed how Rails 3 Active Model can be used to store data in Neo4j (a graph database) instead of a traditional relational database.

My "GlassFish can support multiple Ruby frameworks … really ?" talked about the pluggable architecture of GlassFish v3 and how it supports multiple Ruby frameworks. It described the 3 deployment models of Rails applications in GlassFish (Gem, WAR, Directory-based), showed live samples of Rails and Sinatra applications, talked about the advantages of NetBeans, and a lot about JRuby. All my talks on Rails/GlassFish end up promoting JRuby a lot as that is indeed the entry point for deploying your Rails applications on GlassFish. Anyway, enjoy the complete slides at:

GlassFish can support multiple Ruby frameworks … really ?

And I received the following messages few minutes after the presentation was posted on slideshare:

Here are some of the tweets during/after the talk:

  • @gautamrege Really cool article by @arungupta Day 1 – Ruby Conf India 2010 « Miles to go … http://ow.ly/1oZ9M #rubyconfindia
  • @ytvinay sitting with @nicksieger and listening 2 @arungupta ’s gr8 talk on glassfish n jruby. is this really happening? #rubyconfindia #honoured
  • @yob_au Enjoying Arun Gupta’s jruby and glassfish talk at #rubyconfindia – very clear overview and demos for an MRI traditionalist like me
  • @arjunghosh Second day @ #rubyconfindia Some interesting talks until now,like Nic one on Rails 3, @arungupta ’s Glassfish,Sahar’s Templating
  • @vijay_dev feeling completely at home in the GlassFish talk! Helps to be a Java and Rails guy :-) #rubyconfindia

Totally love the instant feedback :-) You can follow the complete set of comments at #rubyconfindia.

Post lunch I had a brief hacking session with Obie and ran a local version of bizconf.org using JRuby/Rails 2.3.5/GlassFish Gem/PostgreSQL. Other than installing the required gems, every thing was pretty straight forward. It re-confirms the fact that JRuby is just Ruby and can run any Rails application on GlassFish in a seamless manner.

I would’ve loved to attend Roy’s closing keynote but had to step out because of a prior personal commitment.

Overall, Ruby Conf India turned out to be an excellent experience. I certainly enjoyed spending time with Nick, Ola, Obie and a bunch of folks from ThoughtWorks, specifically Roy, Sagar, Tina, Rohit, Christabel, and Judy. The entire team put a wondertastic show and I certainly hope this is a more regular event.

There is a relentless demand for entrepreneurial spirit and trying out the bleeding edge technologies. I hope other similar conferences will start showing up in the near future. I also hope that the local community pick up efforts to take leadership roles and start organizing free Ruby or Rails workshop to expand the Ruby ecosystem. And of course, I certainly wish they all use JRuby, after all it’s Ruby. And once you are using JRuby, that’s it – GlassFish serves your Rails, Sinatra, Ramaze, and any other Rack-based framework applications.

Here are a few pictures from Day 2:

And the complete album so far:

The speaker gift is certainly a nice gesture and my son will surely it enjoy more than me. Thanks a lot to Thought Works for organizing the conference!

On a little bit of fun front, totally loved the following advertisement of "Bingo! Spicy Masala Remix" on the local TV channels:

2 conferences, 2 cities, 2 hotels, 5 planned + 1 unplanned sessions covered, 1 city + 4 planned sessions remaining!

Next stop is Tech Days, Hyderabad!

Technorati: conf rubyconfindia ruby jruby rubyonrails glassfish bangalore bengaluru india

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

March 21, 2010

Mahaswami Software enjoys the “perfect marriage” of JRuby + Rails + GlassFish

Filed under: glassfish, rails — arungupta @ 2:22 pm

Mahaswami Software (based in Bengaluru, India) uses its homegrown Rapid Application Development framework to deliver quality applications in quick time. The framework leverages JRuby, Rails, and the J2EE platform along with Test Driven Development and Continuous integration tools. Mahaswami offers product development services and specific consulting on JRuby/Rails based application development. The Mahaswami team actively contributes back to the Ruby and Rails community.

And they picked GlassFish for a web-based supply chain management product for a large enterprise application service provider in India. They picked GlassFish instead of JBoss because they loved the web-based admin console and high performance.

Watch more details in the following video:

Here is what the customer has to say about their experience:

We were pleasantly surprised by this team’s fantastic ability to deliver complex solutions with great agility, and have gained an edge to our product development efforts.

Do you have any JRuby/Rails/GlassFish consulting requirements in Bengaluru ? Mahaswami Software is your one stop shop for providing all the services.

See other similar success stories here.

Technorati: mahaswami bangalore bengaluru india jruby rubyonrails glassfish stories

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

March 20, 2010

Day 1 – Ruby Conf India 2010

Filed under: glassfish, rails — arungupta @ 5:28 pm
Roy Singham, founder and chairman of ThoughtWorks Inc, kick started Ruby Conf India by stating that this conference is more important than just Ruby in India. He also mentioned that this conference is sponsored by developers in India instead of any big corporations.  He talked about a global shift is happening because of the passion outside silicon valley in open source, Ruby, Python and other similar technologies. In his opinion, India & Brazil are going to reshape the world of software. He’d like Ruby conference to present the best of humanity, innovative and welcome to all. I think inclusive as opposed to exclusive is certainly a key message for the Ruby audience.

Ola’s talk on "The Future of Programming Languages" was interesting as always. He talked about different types of languages such as general purpose (Java & Ruby), special purpose (Erlang & JavaScript), Domain specific (SQL), Functional, Logic, Object-oriented (Prototype or class-based), Multi paradigm (some aspects of each such as C# or Scala).

An interesting part of his talk explored the key Ruby features inherited from which other languages. Lets see how many can you guess ?

  1. Multiple assignments like a, b, c = 1, 2, 3
  2. Regular expressions
  3. Symbols
  4. $/ (input record separator), $= case insensitive
  5. Object Orientation
  6. Message Passing & Introspection
  7. Mixins
  8. Closures

Try to note down your answers and then match with the corrects ones at the end of this blog :-)

Obie’s talk on Blood, Sweat, and Rails was well tailored to the Indian audience. The reference to "All izz well" and couple of pictures from the movie 3 Idiots got a good laugh but then he got reprimanded during his talk to stop using the "F" bomb. From my prior experience, I counted approx 14 times of him dropping the bomb ;-)

Matz skyped in and talked about current state of Ruby and the future. Matz is to Ruby as James Gosling is to Java so the attendees were extremely excited to see him live on the skype session.

It took him 6 months to write the first "Hello World" in Ruby and the first run crashed. But that started the long journey bringing Ruby to its current state. The name "Ruby" was chosen on Feb 24, 1993 and is officially considered the birthday of Ruby. During a later Q&A session he mentioned the name "Ruby" was chosen because the language came after "Perl" which was named after a gem and "Diamond" etc were too long a name. Later on he found out that Pearl is a birth stone for the month of June and Ruby is the birth stone for the month of July so it turned out logical that way as well :-)

Matz also mentioned that Ruby 1.9.2 will be released end of August and then start working on Ruby 2.0. Ruby’s future will be faster, more powerful, distributed programming, faster IPC, multi-core aware, broader (for embedded devices to HPC environments), smaller implementation, and more modular.

The social gathering in the evening was fun and gave me the opportunity to interact with lots of folks from the local community. I answered the question "What has Oracle got to do with Rails" at least 4 times during the social. Here are several articles on that topic:

  • Ruby on Rails on Oracle: A simple tutorial
  • Ruby on Rails with Oracle FAQ
  • Ruby on Rails on Oracle Wiki

And, of course, now Oracle owns GlassFish that allows native deployment of Rails along with Java EE applications.

The highlight for me was finding a happy customer using the "perfect marriage" of JRuby, Rails, and GlassFish. More details coming on that in a separate blog. I’m giving a session on "GlassFish supports multiple Ruby frameworks … really ?" at 11am on Day 2.

Now here are some pictures so far:

And here is the evolving album so far:

And now the answers from Ola’s talk:

  1. Multiple assignments like a, b, c = 1, 2, 3 from CLU (also templates, generators)
  2. Regular expressions from Perl
  3. Symbols from Perl
  4. $/ (input record separator), $= case insensitive from Perl
  5. Object Orientation from Smalltalk
  6. Message Passing & Introspection from Smalltalk
  7. Mixins from Lisp Machine Lisp
  8. Closures from Scheme

How many did you get right ? :)

Now looking forward to Day 2 starting in a few more hours.

Technorati: conf rubyconfindia ruby jruby rubyonrails glassfish bangalore bengaluru india oracle

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

January 13, 2010

TOTD #117: Invoke a JAX-WS Web service from a Rails app deployed in GlassFish

Filed under: glassfish, rails, totd, webservices — arungupta @ 8:24 am

A user on GlassFish Forum tried invoking a JAX-WS Web service from a Rails application and faced some issues. This Tip Of The Day (TTOD) will discuss the different approaches and shows their current status.

A Rails app can be deployed on GlassFish in 3 different ways:

  1. Directory Deployment in GlassFish v3 Server – TOTD #72 explains how to deploy a trivial Rails application (with just a scaffold) on GlassFish v3 server. Even though the blog uses a Rails application, any Rack-based application can be deployed on the server. This server is also the Reference Implementation for Java EE 6 and can also run Grails and Django applications.
  2. Directory Deployment using light-weight GlassFish Gem – GlassFish Gem is a light-weight version of the full-blown server and is stripped to run, just like the server, any Rack-based application such as Merb, Rails, and Sinatra. TOTD #70 shows how to deploy the same application using GlassFish Gem.
  3. WAR file in GlassFish v2.x or v3 – TOTD #73 explains how to deploy a Rails application as WAR file on GlassFish v2. The JNDI connection pooling part of the blog may be skipped to simplify the steps but the concepts are still valid. TOTD #44 shows how to do JNDI connection pooling for GlassFish v3. As GlassFish v2 has in-built support for session replication, TOTD #92 demonstrate how Rails application can leverage that functionality.

Now lets get to the issue reported by the user using these 3 deployment models.

First, lets deploy a simple Web service endpoint and generate a JAR file of the client-side artifacts:

  1. This blog will use a simple Web service as defined in screencast #ws7. The Web service endpoint looks like:

    package server;
    
    import javax.jws.WebService;
    
    /**
     * @author arungupta
     */
    @WebService()
    public class HelloService {
     public String sayHello(String name) {
     return "Hello " + name;
     }
    }
    

  2. Generate Web service client-side artifacts as:

    ~/samples/v3/rails/webservice/tmp >wsimport -keep http://localhost:8080/HelloWebService/HelloServiceService?wsdl
    parsing WSDL...
    
    generating code...
    
    compiling code...
    
  3. Create a Web service client jar file as:

    jar cvf wsclient.jar ./server
    

Now lets write a Rails application and invoke this Web service:

  1. Create a simple Rails application as:

    jruby -S rails webservice
    

    Optionally you may specify "-d mysql" to use MySQL database. Or better un-comment the following line:

    # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
    

    in "config/environment.rb" as no database interaction is required.

  2. Create a controller and view as:

    jruby script/generate controller home index
    
  3. Update the Controller in "app/controllers/home_controller.rb" as:

    include Java
    
    class HomeController < ApplicationController
     def index
     service = Java::server.HelloServiceService.new
     port = service.getHelloServicePort
    
     @result = port.sayHello("Duke")
     end
    
    end
    
  4. Change the View in "app/views/home/index.html.erb" as:

    <h1>Home#index</h1%gt;
    <p>Find me in app/views/home/index.html.erb</p>
    
    <%= @result %>
    

Now lets deploy this Web service using the 3 different deployment models mentioned above.

GlassFish v3 allows a directory-based deployment of Rails applications. This application needs to locate the Web service client classes. The "wsclient.jar" can be copied to the "lib" directory of Rails application ("webservice/lib" in our case), "domains/domain1/lib/ext" or "JRUBY_HOME/lib". The library can also be passed during deployment using "–libraries" switch. None of this approach seem to work correctly as explained in issue# 11408. So for now, invoking a JAX-WS Web service from a Rails application deployed directly on GlassFish v3 is not possible, at least until the bug is fixed.

In order to deploy the same application using GlassFish Gem, you can copy "wsclient.jar" to the "lib" directory of your Rails application. And also add the following line to "app/controllers/home_controller.rb":

require 'lib/wsclient.jar'

Alternatively you can copy it to "JRUBY_HOME/lib" directory if this Web service client is accessed my multiple applications. In this case there is no need to add any "require" statement to your Controller. Anyway, running the application as:

jruby -S glassfish

and accessing "http://localhost:3000/home/index" shows the following output:

And finally as explained in TOTD #73, bundle up your original Rails application as WAR and then deploy on GlassFish v3 as:

asadmin deploy webservice.war

Make sure to copy "wsclient.jar" to the "lib" directory of your Rails application and then Warbler will copy it to "WEB-INF/lib" of the generated WAR file. The output is shown as below:

So if you want to invoke a Metro/JAX-WS Web service from a Rails application, then run your Rails application using GlassFish Gem or deploying as a WAR file. It’ll work on GlassFish v3 server when issue# 11408 is fixed.

Here are some additional links:

  • TOTD #104 also shows how popular Rails applications such as Redmine, Typo, and Substruct can be easily deployed on GlassFish.
  • Rails applications can be easily clustered using Apache + mod_proxy or  nginx.

A complete archive of all the TOTDs is available here.

Technorati: totd glassfish v3 jruby rails webservice jax-ws metro

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

November 5, 2009

Java EE 6 & GlassFish v3 swimming to Amsterdam – JFall 2009

Filed under: glassfish, javaee, rails — arungupta @ 10:53 am
JFall is the annual conference of NL JUG – the 11 year old JUG of Netherlands. This year its happening on Nov 11 at SPANT!

I’ll be speaking on Java EE 6 & GlassFish v3 (14:20 – 15:10) there and have lots of cool demos to show through out the talk. And also stay tuned for a brand new demo that shows JavaFX and GlassFish v3 integration.

With over 1000 attendees, the conference is already sold out so if you have not registered yet then you have to wait until next year :)

Here is the list of several Sun sessions:

  • Writing Asynchronous Web Application (Comet) using the Atmosphere Framework
  • Event driven Architecture with Glassfish ESB
  • Keynote – Enterprise 2.0: New Technologies, Innovations and Communities
  • JavaFX: Building Real World Applications
  • JDK7: What’s In and What’s Not
  • Java and JavaFX Technology and the Nintendo Wiimote: Just How Much Fun Can You Have?
  • Java EE 6 and GlassFish v3: Paving the path for future

Here are the sessions that I’d like to attend:

  • 9:00 0 -9:15: Opening
  • 9:15 – 10:00: Keynote – Enterprise 2.0: New Technologies, Innovations and Communities
  • 10:25-11:15

    • Migrating your Java EE 5 applications to Java EE 6
    • Writing Asynchronous Web Application (Comet) using the Atmosphere Framework
  • 11:20 – 12:10 Scaling Out with Hadoop and NoSql
  • 14:20 – 15:10: Java EE 6 and GlassFish v3: Paving the path for future (of course this one :)
  • 15:45 – 16:35:

    • The future of Enterprise Dependency Injection – JSR 299
    • JDK7: What’s In and What’s Not
  • 16:40 – 17:30:

    •  Eclipse e4: a new beginning
    • Java and JavaFX Technology and the Nintendo Wiimote: Just How Much Fun Can You Have?

Most of the sessions are in Dutch so may have to fall back on English speaking sessions :(

Here are some quick data points …

  • Complete list of sessions and schedule
  • Archive of previous conferences: JFall 2004, JFall 2005, JFall 2006, JFall 2007, JFall 2008
  • Archive of all NL JUG Events

Also trying to arrange a slot in the local Amsterdam Ruby Meetup to talk about JRuby/Rails/GlassFish, lets see if it works out. Otherwise we might somewhere in the hotel lobby :)

And as always, I’m looking for running trails in Amsterdam & Bussum. Any body interested in running together ?

Technorati: glassfish v3 javaee javafx sun amsterdam nljug jfall ams.rb meetup

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 7, 2009

TOTD #111: Rails Scaffold for a pre-existing table using Oracle and GlassFish

Filed under: frameworks, glassfish, rails — Tags: — arungupta @ 5:01 am

TOTD #110 explained how to create a brand new Rails application using Oracle database and run it using GlassFish v Gem. This Tip Of The Day explains how to create a scaffold for a sample schema that ships with Oracle database. Even though Rails Scaffold are good for, well, scaffolding but they do get you started easily. This blog will use the sample HR schema that comes along with Oracle database.

Lets get started!

  1. Copy the reverse_scaffold script in the "script" directory of your application created in TOTD #110. This script generates Model and Forms from a pre-existing database table. More details about this script are here.
  2. Edit "config/database.yml" and change the "development" section to:

    development:
    adapter: oracle_enhanced
    host: localhost
    database: orcl
    username: hr
    password: hr

    The changes are highlighted in bold, only the username and password values are changed to reflect the default values used with the sample database.

  3. Generate the models and forms for "departments" table as:

    ~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby script/reverse_scaffold departments department
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    
     exists app/models/
     exists app/controllers/
     exists app/helpers/
     create app/views/departments
     exists app/views/layouts/
     exists test/functional/
     exists test/unit/
     create test/unit/helpers/
     exists public/stylesheets/
     create app/views/departments/index.html.erb
     create app/views/departments/show.html.erb
     create app/views/departments/new.html.erb
     create app/views/departments/edit.html.erb
     create app/views/layouts/departments.html.erb
     create public/stylesheets/scaffold.css
     create app/controllers/departments_controller.rb
     create test/functional/departments_controller_test.rb
     create app/helpers/departments_helper.rb
     create test/unit/helpers/departments_helper_test.rb
     route map.resources :departments
     dependency model
     exists app/models/
     exists test/unit/
     exists test/fixtures/
     create app/models/department.rb
     create test/unit/department_test.rb
     create test/fixtures/departments.yml
    
  4. Edit "app/models/department.rb" and specify the primary key to "department_id" column by adding:

    set_primary_key "department_id"
    

  5. Run the application as:

    ~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby -S glassfish -l
    Starting GlassFish server at: 129.145.133.197:3000 in development environment...
    Writing log messages to: /Users/arungupta/samples/v3/rails/oracle/bookstore/log/development.log.
    Press Ctrl+C to stop.
    Oct 6, 2009 2:14:19 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
    INFO: Listening on port 3000
    
    . . .
    

    The application is now accessible at "http://localhost:3000/departments" and looks like:

  6. Similarly, create the model and forms for "employees" table as:

    ~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby script/reverse_scaffold employees employee
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    
     exists app/models/
     exists app/controllers/
     exists app/helpers/
     create app/views/employees
     exists app/views/layouts/
     exists test/functional/
     exists test/unit/
     exists test/unit/helpers/
     exists public/stylesheets/
     create app/views/employees/index.html.erb
     create app/views/employees/show.html.erb
     create app/views/employees/new.html.erb
     create app/views/employees/edit.html.erb
     create app/views/layouts/employees.html.erb
     identical public/stylesheets/scaffold.css
     create app/controllers/employees_controller.rb
     create test/functional/employees_controller_test.rb
     create app/helpers/employees_helper.rb
     create test/unit/helpers/employees_helper_test.rb
     route map.resources :employees
     dependency model
     exists app/models/
     exists test/unit/
     exists test/fixtures/
     create app/models/employee.rb
     create test/unit/employee_test.rb
     create test/fixtures/employees.yml
    

    Specify the primary key to "employee_id" by adding the following to "app/models/employee.rb" as:

    set_primary_key "employee_id"
    

    The scaffolded table is now available at "http://localhost:3000/employees" and looks like:

So we created a simple Rails CRUD application accessing information from a pre-existing table in the Oracle database server.

Thanks to @mediachk for all the help!

A complete archive of all the TOTDs is available here. The complete list of Rails blog entries are available here.

This and other similar applications will be demonstrated at the upcoming Oracle Open World.

Technorati: totd oracle database glassfish v3 jruby rails oow

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

October 6, 2009

TOTD #110: JRuby on Rails application using Oracle on GlassFish

Filed under: frameworks, glassfish, rails, totd — Tags: — arungupta @ 2:24 pm

GlassFish v3 is the Reference Implementation for Java EE 6. Following the "extensibility" principle of Java EE 6, it also allows Ruby-on-Rails, Groovy and Grails and Python/Django applications to be seamlessly deployed as well, without any additional packaging. This blog has published multiple entries on deploying a Rails application on GlassFish as given below:

  • TOTD #105: Monitor Rails application using JavaScript
  • TOTD #104: Redmine, Typo, Substruct on GlassFish v3
  • TOTD #84: Apache + mod_proxy_balancer to load balance Rails applications on GlassFish
  • TOTD #81: nginx to load balance Rails applications on GlassFish Gem
  • TOTD #73: Deploying Rails application as WAR on GlassFish v2.1
  • TOTD #72: Deploying Rails application on GlassFish v3
  • TOTD #70: Deploying Rails application on GlassFish Gem

All the existing applications have used JavaDB, SQLite3, or MySQL as the database so far. In the process of getting ready for the upcoming Oracle Open World 2009, this Tip Of The Day will show how to use an Oracle database with a JRuby-on-Rails application deployed on GlassFish v3.

Lets get started!

  1. Install Oracle database as explained in TOTD #106.
  2. Configure JRuby/Rails in GlassFish v3 using one of the mechanisms explained in TOTD #104. Alternatively you can also install the GlassFish gem as:

    >./bin/jruby -S gem install glassfish
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    
    Successfully installed rack-1.0.0
    Successfully installed glassfish-0.9.5-universal-java
    2 gems installed
    Installing ri documentation for rack-1.0.0...
    Installing ri documentation for glassfish-0.9.5-universal-java...
    Installing RDoc documentation for rack-1.0.0...
    Installing RDoc documentation for glassfish-0.9.5-universal-java...
    

    This blog will use GlassFish Gem for running the application described below.

  3. Create a new database user and grant rights using SQL*Plus as shown:

    Macintosh-187:~ oracle$ sqlplus "/ as sysdba"
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Oct 1 12:32:33 2009
    
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    
    Connected to:
    Oracle Database 10g Release 10.2.0.4.0 - Production
    
    SQL> CREATE USER glassfish IDENTIFIED BY glassfish DEFAULT tablespace users TEMPORARY tablespace temp;
    
    User created.
    
    SQL> GRANT CONNECT TO glassfish IDENTIFIED BY glassfish;
    
    Grant succeeded.
    
    SQL> GRANT UNLIMITED TABLESPACE TO glassfish;
    
    Grant succeeded.
    
    SQL> GRANT CREATE TABLE TO glassfish;
    
    Grant succeeded.
    
    SQL> GRANT CREATE SEQUENCE TO glassfish;
    
    Grant succeeded.
    SQL> exit
    Disconnected from Oracle Database 10g Release 10.2.0.4.0 - Production
    

    The user name and password are chosen as "glassfish" for simplicity. This is not a recommended setting for production usage though.

  4. Copy Oracle JDBC drivers (odjc6.jar) in JRUBY_HOME/lib directory.
  5. Create a simple Rails application

    1. Make sure the following gems are pre-installed:

      rails (2.3.4)
      activerecord-jdbc-adapter (0.9.2)
      glassfish (0.9.5)
      

      If not, then install them as:

      jruby -S gem install rails activercord-jdbc-adapter glassfish
      
    2. Create a simple Rails application as:
      jruby -S rails bookstore -d oracle
      

    3. Using the normal "jdbc" adapter will give the following error later:

      ActionView::TemplateError (book_url failed to generate from {:controller=>"books", :action=>"show", :id=>#<Book id: #<BigDecimal:3feef1eb,'10000.0',1(8)>, title: "Ultramarathon Man", author: "Dean Karnazes", created_at: "2009-10-06 00:03:14", updated_at: "2009-10-06 00:03:14">}, expected: {:controller=>"books", :action=>"show"}, diff: {:id=>#<Book id: #<BigDecimal:459bdb65,'10000.0',1(8)>, title: "Ultramarathon Man", author: "Dean Karnazes", created_at: "2009-10-06 00:03:14", updated_at: "2009-10-06 00:03:14">}) on line #13 of app/views/books/index.html.erb:
      

      As evident, the "id" column is returned as BigDecimal where as it should be integer. Fortunately the fix is simple, install the "oracle_enhanced_adapter" (docs) as:

      bookstore >~/tools/jruby/bin/jruby -S gem install activerecord-oracle_enhanced-adapter
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      
      Successfully installed activerecord-oracle_enhanced-adapter-1.2.2
      1 gem installed
      Installing ri documentation for activerecord-oracle_enhanced-adapter-1.2.2...
      Installing RDoc documentation for activerecord-oracle_enhanced-adapter-1.2.2...
      

      Using this "enhanced adapter" is highly recommended for connecting with Oracle databases from Rails applications.

    4. Edit "config/database.yml" and change the "development" section to:

      development:
       adapter: oracle_enhanced
       host: localhost
       database: orcl
       username: glassfish
       password: glassfish
      

      Notice, the username and password values are the same as chosen in the SQL statements above.

    5. Generate a scaffold as:

      bookstore >~/tools/jruby/bin/jruby script/generate scaffold book title:string author:string
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      
       exists app/models/
       exists app/controllers/
       exists app/helpers/
       create app/views/books
       exists app/views/layouts/
       exists test/functional/
       exists test/unit/
       create test/unit/helpers/
       exists public/stylesheets/
       create app/views/books/index.html.erb
       create app/views/books/show.html.erb
       create app/views/books/new.html.erb
       create app/views/books/edit.html.erb
       create app/views/layouts/books.html.erb
       create public/stylesheets/scaffold.css
       create app/controllers/books_controller.rb
       create test/functional/books_controller_test.rb
       create app/helpers/books_helper.rb
       create test/unit/helpers/books_helper_test.rb
       route map.resources :books
       dependency model
       exists app/models/
       exists test/unit/
       exists test/fixtures/
       create app/models/book.rb
       create test/unit/book_test.rb
       create test/fixtures/books.yml
       create db/migrate
       create db/migrate/20091005233152_create_books.rb
      
      
    6. Prepare your application for JDBC as:

      bookstore >~/tools/jruby/bin/jruby script/generate jdbc
      JRuby limited openssl loaded. gem install jruby-openssl for full support.
      
      http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
      
       exists config/initializers
       create config/initializers/jdbc.rb
       exists lib/tasks
       create lib/tasks/jdbc.rake
      

    7. Migrate the database as:

      ~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby -S rake db:migrate
      (in /Users/arungupta/samples/v3/rails/oracle/bookstore)
      == CreateBooks: migrating ====================================================
      -- create_table(:books)
       -> 0.0740s
       -> 0 rows
      == CreateBooks: migrated (0.0750s) ===========================================
      

  6. Lets run the application as:

    ~/samples/v3/rails/oracle/bookstore >~/tools/jruby/bin/jruby -S glassfish -l
    Starting GlassFish server at: 129.145.133.197:3000 in development environment...
    Writing log messages to: /Users/arungupta/samples/v3/rails/oracle/bookstore/log/development.log.
    Press Ctrl+C to stop.
    Oct 6, 2009 9:45:51 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
    INFO: Listening on port 3000
    
    . . .
    

    he application is now accessible at "http://localhost:3000/books" and looks like:

    Click on "New Book" and enter the values as shown:

    Click on "Create" to see the output as:

    Click on "Back" to see the main page as:

    After adding another book, this page looks like:

    And another book …

So we created a brand new JRuby/Rails application and ran it using GlassFish and Oracle backend. A subsequent blog entry will show how to create a similar application using an existing database.

A complete archive of all the TOTDs is available here. The complete list of Rails blog entries are available here.

This and other similar applications will be demonstrated at the upcoming Oracle Open World.

Technorati: totd oracle database glassfish v3 jruby rails oow

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

September 30, 2009

Running Summary Q3 2009 – 400 miles, 80% of running days

Filed under: frameworks, glassfish, rails, running — arungupta @ 11:08 pm

Here is the summary of my running logs from Q3 2009 (Jul – Sep):

Even though 3 days of less running than Q2, but the overall mileage was increased. Barely hit that 400 miles mark in Q3 and it did took some extra efforts to reach there ;-) But now tapering for the upcoming Rock-n-Roll 1/2 Marathon this weekend.

5 miles was the most favorite distance being run 17 times and 19.7 miles and 17.4 miles were run only once.

Would you like to generate similar charts for your running logs as well ?

This can be easily achieved using a Rails application or a Wicket application on GlassFish.

Technorati: rails wicket glassfish running rnrsj

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

September 24, 2009

Q&A Transcript from “Develop, Deploy, and Scale your Rails app with GlassFish” webinar

Filed under: glassfish, rails — arungupta @ 10:34 am

I delivered a "Develop, Deploy, and Scale your Rails app on GlassFish" webinar earlier today. There were over 300 unique attendees. A complete replay of the webinar is available at sun.com/software/webinars.

Many thanks to all the attendees for showing their interest in the technology and the panelists who relentlessly answered all the questions. The demos shown are available at:

An edited transcript of the Q&A session is available below. All the names have been removed for privacy reasons.

Q: I took leave from office to attend ur seession..:)
A: Thanks a lot, hopefully you’ll enjoy it :)

Q: Is Rails an abbreviation?
A: http://rubyonrails.org/

Q: can you explain the difference b/t jruby and ruby
A: Ruby is a language and it’s original interpreter is written in C. JRuby is pure Java based Ruby interpreter.

Q: What are the added benefits of installing JRuby on Glassfish – in compared to having it always in Rails app WAR?
A: What you get is the Ruby way of developing apps, code-save-refresh or agile experience

Q: Is it true on GF v2.1 as well – since the Rails app will anyway have to be packaged in a war?
A: On glassfish v2.x only WAR style Rails deployment is supported.

Q: Can I run existing rails application on GlassFish?
A: Yes. sure.

Q: is there support for rails 2.3.2? having trouble getting glassfish to run anything higher than 2.2.x
A: Yes, it is there.
A: Please send an email to dev@glassfish with your issue, we would be happy to help you

Q: what additional config is rerquired to support rails?
A: checkout http://wiki.glassfish.java.net/Wiki.jsp?page=GettingStartedGuide

Q: what I really was after is this: what is the difference of including JRuby (and dependent gems) inside your app war in compared to installing JRuby on GF and having only your own app in the war?
A: When you go in to production , you freeze your gems with app. The thing with glassfish v3 is that you can deploy rails app as WAR as well as directory deployment

Q: on jboss, i have to patch activerecord to use jndi style datasources. is that necessary on glassfish, too ?
A: No, you dont need to.

Q: do you have easy to follow lessons or tutorial for user to try a small real workable application to repeat what you are talking about from your website?
A: Check out checkout http://wiki.glassfish.java.net/Wiki.jsp?page=GettingStartedGuide

Q: y glass fish used only in java
A: GlassFish is a Java EE App Server

Q: Does Glassfish still have the PermGem out of memory issue when you deploy and undeploy applications.
A: There is a reasonable default setting for PermGen in Glassfish but it depends on your app. You can always set the PermGen to higher value
A: We have run significant number of tests to address this issue. If you do run into it, please let us know by sending an email to dev@glassfish

Q: what is mean by rails
A: http://rubyonrails.org/

Q: what is jruby?
A: Pure Java based Ruby interpreter. Checkout jruby.org

Q: what if i have glassfishv2 installed? is there any problem to install jruby gem glassfish?
A: GlassFish gem can be installed in an existing JRuby installation only. For GlassFish v2, Rails applications can only be deployed as WAR file.

Q: so the PermGen out of memory issue is supposedly fixed in Glassfish v3? Or should be fixed also in Glassfish v2.1?
A: when you start JVM there is PermGen space, scripting language interpreteres such as JRuby require higher perm gen. You just need to set it accordingly

Q: This may be a little off topic, but what are the Cons of using JRuby and glassfish? Because everything I’ve read is great
A: There might be some ruby gems that have native extensions that do not work on JRuby. Having said that, most of the ruby gems that we come across at work on JRuby just fine.

Q: on jboss, serveral jruby runtimes are added. same thing on glassfish ?
A: yes. you can configure the jruby runtime pool. See http://wiki.glassfish.java.net/Wiki.jsp?page=ConfiguringJRubyRuntimePool

Q: so why doesn’t everyone use Jruyb? (over ruby MRI?)
A: Its a choice and really depends on personal preference. BTW as a datapoint, hosting company such as engineyard.com has jruby based Ruby/Rails hosting

Q: is this presentation only for mac users? I am a bit shocked with this OSX desktop. I was hoping seeing some Opensolaris etc.
A: No, it is not only for mac users

Q: does glassfish v3 already support cluster profiles?
A: glassfish v3 does not support clustering

Q: i always asked myself if the multiple jruby runtimes write to the same log file.
A: yes they do.

Q: so do you know when (in which release) will the clustering support be added to glassfish v3?
A: It is planned for glassfish v3.1.

Q: apart from glass fish any other server supports
A: mongrel, web rick work on jruby just fine.

Q: can we get support for jruby on jrails on glassfish?
A: Yes you can.
A: Sid, for details on GlassFish subscription support options, please email glassfish @sun.com

Q: yeah I saw that, a great option I think. I’m just at a state where I can pick either Ruby or JRuby, and JRuby seems far superior and can’t really see any of it’s fautls
A: yeah, pick JRuby!

Q: Does Ruby create for us the basic GUI for each table?
A: It’s Rails that is creating the basic GUI for each table.

Q: why doesn’t glassfish support clustering
A: GlassFish v2.1 supports clustering and can be run in production environment.

Q: apart from glass fish any other server supports j2ee
A: Which version of EE are you talking about?

Q: 1.6
A: 1.6 is not final yet, so glassfish is the only implementation of EE6 right now

Q: can you please email me the presentaion slides?
A: Please see www.sun.com/software/webinars – the slides maybe there.

Q: i heard that apache and tomcat server not used for j2ee? is it so?
A: Tomcat implements a subset of the Java EE specifications. It is not a fully compliant Java EE server. GlassFish is fully compliant (it’s the reference implementation)

Q: We’ve been having some issues running Capistrano under JRuby on cygwin — it gets confused about whether it’s in a Windows or Unix-like environment. Any tips?
A: Could be cygwin issue? If not please report with details to [email protected]

Q: What is Rail Application
A: Check out http://rubyonrails.org for more details.

Q: sometimes, you might want to define a dedicated log file per deployed app. jboss logs everything to server.log by default. is it possible to define a dedicated log per app on glassfish
A: I dont have an answer to this, you may like to bring this question to [email protected]
A: I still dont see why this would an issue. As long as your logs shifts correctly and there is no locking etc. it should be fine. BTw, in production you limit your log anyway to severe error for perf reasons.

Q: so what’re the benefits of using the glassfish gem versus mongrel or thin?
A: High performance, jruby runtime pool, daemon mode etc.

Q: Is the v3 Glassfish gem considered to be production ready?
A: Many users that I know already use in production.

Q: nginx or apache is recommended? can glassfish act as the comlete server?
A: GlassFish v3 does not support clustering. It will be coming up in a future release. So you may like to use squid or nginx etc to scale your app

Q: this update is shown how it is updated on mac OSX?
A: Update Center works on all platforms

Q: i’m new to glass fish beacuse i’m just a student….any websites or links that which makes 2 gain more knowledge on it…..
A: glassfish.dev.java.net can lead you to more details

Q: hey i missed the earlier part of this presentation..!
A: You can look at the recorded session later

Q: what is the built-in web server in glassfish used in the demo? wht would i use apache?
A: grizzly + v3 kernel+ jruby container. You can use Apache to front-end a bunch of GlassFish instances running at the backend.

Q: how to add extra gems in directrory-based deployment?
A: Just how you would use with any Rails app. gem install ‘your gem’

Q: this is off the topic, is v3 glassfish going to implement directory based deployment for grails?
A: GlassFish embedded is in works and yes in will support grails directory deployment or ‘grails run-app’

Q: Is there a major performance difference between the gem and the standalone war-style deployments?
A: Not much, With glassfish gem or glassfish v3 directory deployment, you are serving the requests at pretty low level. With war deployment its served by the web container

Q: in net beans only glassfish sever is implemented?if any other severs r there in net beans what are they…..
A: There are many other servers supported by NetBeans

Q: can i get the replay after the webinar?
A: Yes, the recorded session will be posted later at sun.com/software/webinars.

Q: in my company, we use a jboss / jruby / oracle setup. we have issues with newer version activerecord-jdbcadapter (> 8.1.0). is this a known problem ?
A: No idea, consider switching to GlassFish as it works fine there :)

Q: ok, so how does glassfish handle updating the source for your rails app? will it fulfill existing requests and smoothly ’seesaw’ to updated instances? …or does it just drop everything, redeploy and start over?
A: The experience is what you will get on native/MRI Ruby/Rails. glassfish embeds jruby using its internal API and rest is all Rails.

Q: so are gems pre packages apps to deploy?
A: think of gem like packages for Ruby/JRuby platforms.

Q: Please send me a link where I can retrieve the replay of this audio and presentation coz the buffering is really disturbed out here..
A: http://www.sun.com/software/webinars/ – recording of this session will be made available

Q: Regarding java gc/memory flags, is there a recommended set of flags for optimal glassfish performance
A: sun.com/glassfish/resources has a White Paper that shows how to tune GF. Although if you get the supported version, you get an add-on called Enterprise manager that can tune the server automatically.

Q: where will jruby be located when I install Jruby glassfish admin web page?
A: glassfish-install-dir/glassfish/jruby

Q: can I use Netbeans to set up my JRuby on Rails app and Glassfish server, but then use another editor or cmd prompt to edit/add to my app?
A: yes you can, although NetBeans provide a functionally complete IDE and serves all your needs.

Q: You are assuming that your server can access the internet. For example, to get the glassfish and Ruby and all upgrades and updates your update program gets the items from your server there on the internet. A secure vault does not have access to the intern
A: True. But you can prepackage everything.

Q: JAVA AND JAVAC NO WHERE IN PICTURE
A: GlassFish runs on java.

Q: is it possible to somehow change the rails.env setting _after_ a WAR has been generated? Or does it always require re-warblerizing?
A: warble config; edit config/warble.config to change. Otherwise export RAILS_ENV=production

Q: How would you debug if you packaged the Rails app as a warfile?
A: Thats an issue with the WAR based deployment. You should use directory deployment, specially for your development.

Q: all the server and application for jruby, integration also work on Windows XP professional?
A: Yes, it should work on Windows XP

Q: so jruby is really ready for primetime? good compatibility with existing gems and plugins?
A: yes it is.

Q: A different take on my blog post of the same topic http://javaevangelist.blogspot.com/2009/08/redmine-084-deployment-on-glassfish-21.html
A: thanks!

Q: Who is the best person to talk to about Grizzly failing to handle multi-part posts in a jruby rails app?
A: Please send email to dev@glassfish. Vivek Pandey is the lead for scripting in GlassFish

Q: are there any supports for pre-compiling ruby code to java byte code?
It would be great if I can hide my ruby code when I release my apps as war.
A: I know there is some jruby option that lets you do it. Either check on jruby.org or post it to users@jruby or #jruby on irc

Q: while we are using netbeans no problem because servers are inbuilt in the netbeans itself while we usin the ordinary notepad how the servers are to be implemented
A: I do not understand what you mean by implementing a server. A server implemention is implementing to the JavaEE spec. I assume you mean deploying on a server

Q: can anyother scripts can be used instead of javascript
A: Not yet. Ruby and groovy will be coming out in a future release

Q: is it possible to get access to the glassfish admin console using the gem?
A: Sorry, not yet.

Q: so NewRelic is jruby and glassfish compatible?
A: yep

Q: is there any way I can monitor server.log in glassfish admin web interface?
A: http://docs.sun.com/app/docs/doc/819-3656/6n5s3qjga?a=view – See bottom of URL.

Q: what is the preferred hardware for jruby and rails ? our experience is: sparc is slow and 86based sun hardware is fast for jruby
A: Not required but dual core or higher means better performance

Q: it is possible to implemet content management and ERP application with glassfish and has SUN such applications?
A: We know users deploying Ruby/Rails apps in OpenESB or in SOA env. For ERP or other content management system, as long as you can run these on Glassfish you can surely host Ruby aps there as well

Q: do you have the recommendation for jruby on rails book and good glassfish book?
A: There are several GlassFish books as listed at: http://blogs.sun.com/theaquarium/entry/more_glassfish_books. Practical JRuby on Rails is a nice book as well (http://www.rubyinside.com/practical-jruby-on-rails-book-by-ola-bini-625.html).

Q: Does Eclipse incorporate Ruby as NetNeans?
A: Both Eclipse and NetBeans are IDEs. Both support ruby development

Q: any other new servers r gonna compatible with glassfish
A: Once EE6 is final many other application servers will work towards being compatible with EE6

Q: what is the difference in case of performance between standlone war style deployement and gem deployement
A: Not much. gem will give you faster development cycle, easier deployment beside being very light weight (4MB) vs for WAR you need full server.

Q: is there any other IDE which supports ruby dev
A: Not integrated deployment and server side debugging. You can develop Ruby app on IDEA/Aptna studio etc. Typicaly you just need vi or text mate etc.

Q: why can’t i run a project developed in netbeans 6.1 on netbeans 6.5
A: Please send an email to the netbeans forum

Q: can I deploy any ruby app I find on jruby?
A: JRuby 1.3.1 is 1.8.6 compliant and going to be using 1.8.7 as the baseline for upcoming JRuby 1.4. The JRuby team is also working on adding Ruby 1.9 compatibility.

Q: i’ve seen in netbeans at the end of netbeans it is end with IDE what is meant by IDE
A: IDE = "Integrated Development Environment"
A: There is a JRuby-specific distribution of NetBeans IDE

Q: why can’t i run a project developed in netbeans 6.1 on netbeans 6.5?
A: You should be able to. If not, try posting to the Netbeans User’s alias.

Q: We’ve been using JRuby on Windows, and are deploying to Solaris using Capistrano. We get mysterious problems establishing an ssh connection that we don’t get when we use native Ruby. Any ideas on this?
A: Please send more details to [email protected]
A: I guess I would need more details on this. you may like to post more info to users@jruby or #jruby irc
A: Paul: if you have purchased support – go through the support channel to address the issue quickly.

Q: Programming wise: are there any differences between ruby and jruby? b/c i think I’m now set on using glassfish, but I’d like to follow a lot of the tutorials out there, but almost all are for ruby
A: JRuby can run any Ruby application 1.8.7 and even 1.9

Q: are there any good books on the topic ?
A: There are several GlassFish books as listed at: http://blogs.sun.com/theaquarium/entry/more_glassfish_books. Practical JRuby on Rails is a nice book as well (http://www.rubyinside.com/practical-jruby-on-rails-book-by-ola-bini-625.html).

Q: the ide was complaining that some of the ‘items’ in the project are missing, how do i do it – netbeans 6.1 to 6.5
A: Sounds like a question that should be posted to the Netbeans email aliases. Sorry, the folks chatting away are GlassFish-centric.

Q: how i can more info about the EE6 and about the jruby
A: EE6 can be obtained from http://jcp.org/en/jsr/detail?id=313

Q: can JRuby run on Windows 7 and Windows Server 2008?
A: The only requirement for JRuby is JDK which is supported on those platforms, so yes JRuby should work there too.

Q: thanks! I was about to release my Jruby on rails glassfish in production. it encouraged me a lot!
A: Good to know, please send feedback to [email protected].

Q: opensource+jruby+glassfish resources on the web?
A: jruby.org for JRuby, glassfish.org for GlassFish.

Q: so again there’s full support for rails edge (2.3.2+) with the glassfish v2 server?
A: yes, you need to use warbler gem

Q: so since we already have a support contract with Sun we can also call you and ask about how to best deploy into production?
A: please email [email protected] and we will immediately reply with a call or answers to your questions.

Q: Is jruby compatible with all its older versions
A: They do maintain backwards compatibility. Ask this question at [email protected] for a normative answer.

Q: does dun provide jruby training?
A: "Ruby, JRuby, and Rails development Development (with Passion!)" is a free course that offers that training. More details at: http://www.javapassion.com/rubyonrails/.

Q: can we deploy EAR on glassfish?????
A: Yes, GlassFish is a Java EE compliant app server so any standard EE artifact, such as EAR, can be easily deployed.

Q: would purchased support require us to deploy on v2?
A: No, you can choose the version of GlassFish you would like to deploy

Q: Can i build complex web system with glass fish, using such things as corba?
A: Very much, feel free to ask detailed question at [email protected].

Q: I would like to know what would be best platform to use Glassfish on?
A: Being Sun, we prefer Solaris or OpenSolaris, but GlassFish also works well on Linux and Windows.

Q: how does jruby compare to ruby 1.9?
A: JRuby team is working on improving compatibility with Ruby 1.9. Ask your specific question to  [email protected].

Q: Great job guys! I am excited to use this.
A: Thanks, let us know your feedback on [email protected].

Q: can glassfish be installed on amazon ec2?
A: Yes. There is an AMI with GlassFish, OpenSolaris, and MySQL
A: http://wikis.sun.com/display/sunsoftwareincloud/EC2+Glassfish

Q: is it very easy to deploy on glassfish
A: asadmin deploy yourrailsapp-dir/

Q: So what is the real advantage using ruby? Why not just use java script or some existing language, and what does the Rails part refer to?
A: Its Rails that makes it interesting. Rails is a complete MVC framework

Q: from where could i got jruby
A: JRuby can be downloaded form jruby.org.

Interested in watching a replay of the webinar ? Go to www.sun.com/offers/details/rails_apps.xml for all the details.

Technorati: glassfish rubyonrails jruby webinar netbeans

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

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