Monday July 21, 2008
JRuby 1.1.3 released - Getting Started with GlassFish
JRuby 1.1.3 was released
last week - download
here. The highlights are:
| ~/testbed/jruby-1.1.3
>./bin/jruby -S
gem install rails glassfish --no-ri --no-rdoc JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed activesupport-2.1.0 Successfully installed activerecord-2.1.0 Successfully installed actionpack-2.1.0 Successfully installed actionmailer-2.1.0 Successfully installed activeresource-2.1.0 Successfully installed rails-2.1.0 Successfully installed glassfish-0.3.1-universal-java 7 gems installed |
| ~/testbed/jruby-1.1.3/samples/rails
>../../bin/jruby
-S rails helloworld -d mysql create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create db create doc . . . create log/server.log create log/production.log create log/development.log create log/test.log |
| ~/testbed/jruby-1.1.3/samples/rails
>../../bin/jruby
-S glassfish_rails helloworld Jul 21, 2008 8:32:03 AM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on HK2 platform Jul 21, 2008 8:32:03 AM com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient INFO: Cannot find javadb client jar file, jdbc driver not available Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3000 Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_protocols_disabled Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_ciphers_disabled Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3131 Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3838 Jul 21, 2008 8:32:04 AM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot INFO: Admin Console Adapter: context root: /admin Jul 21, 2008 8:32:05 AM com.sun.grizzly.jruby.RailsAdapter startRubyRuntimePool INFO: Starting Rails instances Jul 21, 2008 8:32:09 AM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Jul 21, 2008 8:32:10 AM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: JRuby and Rails instance instantiation took : 5623ms Jul 21, 2008 8:32:10 AM org.glassfish.scripting.rails.RailsDeployer load INFO: Loading application helloworld at / Jul 21, 2008 8:32:10 AM com.sun.enterprise.v3.server.AppServerStartup run INFO: Glassfish v3 started in 7046 ms |
| ~/testbed/jruby-1.1.3/samples/rails/helloworld
>../../../bin/jruby
script/generate scaffold runner distance:float minutes:integer 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/runners exists app/views/layouts/ exists test/functional/ exists test/unit/ exists public/stylesheets/ create app/views/runners/index.html.erb create app/views/runners/show.html.erb create app/views/runners/new.html.erb create app/views/runners/edit.html.erb create app/views/layouts/runners.html.erb create public/stylesheets/scaffold.css create app/controllers/runners_controller.rb create test/functional/runners_controller_test.rb create app/helpers/runners_helper.rb route map.resources :runners dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/runner.rb create test/unit/runner_test.rb create test/fixtures/runners.yml create db/migrate create db/migrate/20080721153737_create_runners.rb |
| ~/testbed/jruby-1.1.3/samples/rails/helloworld
>../../../bin/jruby
-S rake db:create (in /Users/arungupta/testbed/jruby-1.1.3/samples/rails/helloworld) ~/testbed/jruby-1.1.3/samples/rails/helloworld >../../../bin/jruby -S rake db:migrate (in /Users/arungupta/testbed/jruby-1.1.3/samples/rails/helloworld) == 20080721154435 CreateRunners: migrating ==================================== -- create_table(:runners) -> 0.0097s == 20080721154435 CreateRunners: migrated (0.0104s) =========================== |


| ~/testbed/glassfish/v3/snapshot/glassfish
>java
-DJRUBY_HOME=/Users/arungupta/testbed/jruby-1.1.3 -jar
modules/glassfish-10.0-SNAPSHOT.jar Jul 21, 2008 9:40:41 AM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on Apache Felix OSGi platform Jul 21, 2008 9:40:41 AM com.sun.enterprise.glassfish.bootstrap.ASMainOSGi getSharedRepos INFO: /Users/arungupta/testbed/glassfish/v3/snapshot/glassfish/domains/domain1/lib does not exist Welcome to Felix. ================= . . . INFO: Started bundle org.glassfish.common.container-common [91] Jul 21, 2008 9:47:13 AM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot INFO: Admin Console Adapter: context root: /admin Jul 21, 2008 9:47:13 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.deployment.deployment-common [71] Jul 21, 2008 9:47:13 AM com.sun.enterprise.v3.server.AppServerStartup run INFO: Glassfish v3 started in 1507 ms |
| ~/testbed/jruby-1.1.3/samples/rails
>~/testbed/glassfish/v3/snapshot/glassfish/bin/asadmin
deploy helloworld Command deploy executed successfully. |
| Jul
21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.web.war-util [65] Jul 21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.persistence.jpa-connector [25] Jul 21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.scripting.gf-jruby-connector [13] Jul 21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.core.security [22] Jul 21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.web.gf-web-connector [86] Jul 21, 2008 9:47:49 AM OSGiModuleImpl loadClass INFO: Started bundle org.glassfish.connectors.gf-connectors-connector [53] Jul 21, 2008 9:47:49 AM com.sun.grizzly.jruby.RailsAdapter startRubyRuntimePool INFO: Starting Rails instances Jul 21, 2008 9:48:01 AM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Jul 21, 2008 9:48:02 AM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: JRuby and Rails instance instantiation took : 12852ms Jul 21, 2008 9:48:02 AM org.glassfish.scripting.rails.RailsDeployer load INFO: Loading application helloworld at /helloworld Jul 21, 2008 9:48:02 AM com.sun.enterprise.v3.deployment.DeployCommand execute INFO: Deployment of helloworld done is 13326 ms |

Posted by Arun Gupta in web2.0 | Comments[9]
|
|
|
|
|
Today's Page Hits: 3489
Total # blog entries: 1002
Hi Arun,
Your Glassfish gem is very cool, especially the ease of use. But I'm still missing a few features to use it for production usage:
1) I think JNDI JDBC connection pooling isn't working with the gem, see my bug report here:
http://rubyforge.org/tracker/index.php?func=detail&aid=21115&group_id=5450&atid=21080
2) I doubt Rails static page caching works properly. Indeed, even if you stored to cached files at the right place and serve them as regular static content, you would probably encounter that bug I just patched with Warble:
http://jira.codehaus.org/browse/JRUBY-2832
So that's why I'm sticking with Glassfish v2 so far, but it would be great to make that gem just as good to use it for production as well. So I would appreciate to know more about those two issues.
Regards,
Raphaël Valyi.
Posted by Raphaël Valyi on July 21, 2008 at 12:04 PM PDT #
Posted by Arun Gupta's Blog on August 06, 2008 at 02:58 PM PDT #
Posted by Arun Gupta's Blog on August 27, 2008 at 04:08 PM PDT #
Posted by Arun Gupta's Blog on September 05, 2008 at 10:19 PM PDT #
I am using JRuby 1.1.6, Rails 2.2.2 and the v3 prelude server. If I run my application using the gem, as in -
glassfish_rails myapp
then Rails comes up correctly in the threadsafe version (I have config.threadsafe! in my configuration)
When I deploy the same application using asadmin deploy, the application starts, but it looks like Rails does not come up in the threadsafe mode, causing the instance to hang (my application relies on threadsafe mode and has long running requests). Any ideas on how to make Rails come up in threadsafe mode while running apps natively?
Posted by Girish Kulkarni on December 26, 2008 at 10:21 AM PST #
Girish, have you tried the instructions at:
http://blogs.sun.com/arungupta/entry/getting_started_with_edge_rails
?
Posted by Arun Gupta on January 05, 2009 at 03:28 PM PST #
Arun,
Yes, I followed those instructions. I am using more recent versions of JRuby (1.1.6) and the Prelude server than mentioned at the above link, but I don't think it should matter.
Rails does come up in the thread safe mode when started as 'glassfish_rails myapp', as indicated by the application behavior (it works as expected) as well as the following message -
INFO: config.threadsafe sighted! All hands prepare for multithread mode!
On the other hand, if I start the glassfish server after using asadmin to deploy the application, it does not work as expected. Are there any settings apart from what I have in the environments file? Any traces to see what is happening under the covers?
Thanks,
- Girish
Posted by Girish Kulkarni on January 05, 2009 at 05:28 PM PST #
Girish, This is reported as bug at:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=6977
Please monitor the bug for further updates on this issue.
Posted by Arun Gupta on January 08, 2009 at 04:11 PM PST #
Posted by JabberTags - Find New Sites and Explore the Internet on March 10, 2009 at 12:19 AM PDT #