Wednesday March 11, 2009
TOTD
#70, #71,
#72
shows the first three integration tests that I typically run to ensure
that the
latest JRuby and GlassFish versions work nicely with each other.
#70
showed how to create a trivial Rails application and run it using GlassFish
Gem. #71
showed how the same application can be deployed on GlassFish
v3 Prelude. #72
showed how to deploy the same application on GlassFish v3.
The next test in the series is to ensure WAR-based deployment of a
Rails application continue to work on GlassFish v2. It also shows that
JNDI database connection pooling also work as expected. The latest
publicly
available build is GlassFish
v2.1.
Lets begin integration test #4.
| ~/tools/jruby-1.2.0RC2/samples/rails/runner
>../../../bin/jruby
-S gem install warbler JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed warbler-0.9.12 1 gem installed Installing ri documentation for warbler-0.9.12... Installing RDoc documentation for warbler-0.9.12... |
| production: adapter: mysql encoding: utf8 database: runner_production pool: 5 username: root password: socket: /tmp/mysql.sock |
| production: adapter: jdbcmysql encoding: utf8 database: runner_production pool: 5 username: duke password: glassfish socket: /tmp/mysql.sock jndi: jdbc/runner_production driver: com.mysql.jdbc.Driver |
| ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S rake
db:create RAILS_ENV=production (in /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner) ~/tools/jruby-1.2.0RC1/samples/rails/runner >../../../bin/jruby -S rake db:migrate RAILS_ENV=production (in /Users/arungupta/tools/jruby-1.2.0RC1/samples/rails/runner) == CreateRunners: migrating ================================================== -- create_table(:runners) -> 0.1150s -> 0 rows == CreateRunners: migrated (0.1170s) ========================================= |
| ~/tools/glassfish/v2.1/glassfish/ >cp ~/tools/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar ./lib |
| ~/tools/glassfish/v2.1/glassfish/bin
>./asadmin
start-domain Starting Domain domain1, please wait. Default Log location is /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/logs/server.log. Redirecting output to /Users/arungupta/tools/glassfish/v2.1/glassfish/domains/domain1/logs/server.log Domain domain1 started. Domain [domain1] is running [Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs)] with its configuration and logs at: [/Users/arungupta/tools/glassfish/v2.1/glassfish/domains]. Admin Console is available at [http://localhost:4848]. Use the same port [4848] for "asadmin" commands. User web applications are available at these URLs: [http://localhost:8080 https://localhost:8181 ]. Following web-contexts are available: [/web1 /__wstx-services runner ]. Standard JMX Clients (like JConsole) can connect to JMXServiceURL: [service:jmx:rmi:///jndi/rmi://Macintosh-187.local:8686/jmxrmi] for domain management purposes. Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ]. Domain supports application server clusters and other standalone instances. |
| ~/tools/glassfish/v2.1/glassfish/bin >./asadmin
create-jdbc-connection-pool --datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype
javax.sql.DataSource --property
"User=duke:Password=glassfish:URL=jdbc\:mysql\://localhost/runner_production"
jdbc/runner_pool Command create-jdbc-connection-pool executed successfully. |
| ~/tools/glassfish/v2.1/glassfish/bin >./asadmin create-jdbc-resource
--connectionpoolid jdbc/runner_pool jdbc/runner_production Command create-jdbc-resource executed successfully. |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >../../../bin/jruby -S warble
config cp /Users/arungupta/tools/jruby-1.2.0RC2/lib/ruby/gems/1.8/gems/warbler-0.9.12/generators/warble/templates/warble.rb config/warble.rb |
| # Include all gems which are used by the
web application require "#{RAILS_ROOT}/config/environment" BUILD_GEMS = %w(warbler rake rcov) for gem in Gem.loaded_specs.values next if BUILD_GEMS.include?(gem.name) config.gems[gem.name] = gem.version.version end |
| config.gems += ["activerecord-jdbc-adapter"] |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >../../../bin/jruby -S warble mkdir -p tmp/war/WEB-INF/gems/specifications cp /Users/arungupta/tools/jruby-1.2.0RC2/lib/ruby/gems/1.8/specifications/rails-2.2.2.gemspec tmp/war/WEB-INF/gems/specifications/rails-2.2.2.gemspec mkdir -p tmp/war/WEB-INF/gems/gems . . . cp public/javascripts/prototype.js tmp/war/javascripts/prototype.js cp public/stylesheets/scaffold.css tmp/war/stylesheets/scaffold.css mkdir -p tmp/war/WEB-INF |
| ~/tools/jruby-1.2.0RC2/samples/rails/runner >~/tools/glassfish/v2.1/glassfish/bin/asadmin
deploy runner.war Command deploy executed successfully. |

Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Today's Page Hits: 1687
Total # blog entries: 1002
Posted by Arun Gupta's Blog on March 16, 2009 at 11:48 AM PDT #
Posted by Arun Gupta's Blog on March 16, 2009 at 11:53 AM PDT #
Posted by Arun Gupta's Blog on August 12, 2009 at 06:10 AM PDT #
Posted by Arun Gupta's Blog on August 12, 2009 at 09:14 AM PDT #