Wednesday August 27, 2008
TOTD #43: GlassFish v3 Build Flavors
Here are different flavors of GlassFish v3 builds:
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
Wednesday August 20, 2008
TOTD #42: Hello JavaServer Faces World with NetBeans and GlassFish
This TOTD (Tip
Of The Day) shows how to
create a simple Java
Server Faces application using NetBeans IDE 6.1. This
is my first ever Java Server Faces application :) Much more
comprehensive applications are already available in NetBeans
and GlassFish
tutorials.
The application is really simple - it allows you to create a database
of cities/country that you like. You enter the city & country
name on a page and click on Submit. This stores the data entered in the
backend database and displays all the stored values in a new page. This
application demonstrates simple JSF concepts:


| create table cities(id integer AUTO_INCREMENT, city_name varchar(20), country_name varchar(20), PRIMARY KEY(id)); |
| @NamedQuery(name = "Cities.findAll", query = "SELECT c FROM Cities c"), |


| private Cities cities; public void setCities(Cities cities) { this.cities = cities; } |
| <managed-bean> <managed-bean-name>cities</managed-bean-name> <managed-bean-class>server.Cities</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>dbUtil</managed-bean-name> <managed-bean-class>server.DatabaseUtil</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>cities</property-name> <value>#{cities}</value> </managed-property> </managed-bean> |
|
@PersistenceContext(unitName="CitiesPU") private EntityManager entityManager; @Resource UserTransaction utx; |
| public
Collection<Cities> getAllCities() { Collection<Cities> allCities = new ArrayList<Cities>(); List list = entityManager.createNamedQuery("Cities.findAll").getResultList(); for (int i = 0; i < list.size(); i++) { allCities.add((Cities)list.get(i)); } return allCities; } |
| public String saveCity() throws
NotSupportedException, SystemException, RollbackException,
HeuristicMixedException, HeuristicRollbackException { utx.begin(); entityManager.persist(cities); utx.commit(); return "submit"; } |



| <h2>Detail</h2> <h:form> <h:panelGrid columns="2"> <h:outputText value="Id:"/> <h:outputText value="#{anInstanceOfserver.Cities.id}" title="Id" /> <h:outputText value="CityName:"/> <h:outputText value="#{anInstanceOfserver.Cities.cityName}" title="CityName" /> <h:outputText value="CountryName:"/> <h:outputText value="#{anInstanceOfserver.Cities.countryName}" title="CountryName" /> </h:panelGrid> </h:form> |
| <h2>Detail</h2> <h:form> <h:panelGrid columns="2"> <h:outputText value="CityName:"/> <h:inputText value="#{cities.cityName}" title="CityName" id="cityName" required="true"/> <h:outputText value="CountryName:"/> <h:inputText value="#{cities.countryName}" title="CountryName" id="countryName" required="true"/> </h:panelGrid> </h:form> |
| <h:commandButton action="#{dbUtil.saveCity}" value="submit"/> |
| <br><br> <h:message for="cityName" showSummary="true" showDetail="false" style="color: red"/><br> <h:message for="countryName" showSummary="true" showDetail="false" style="color: red"/> |
| <%@taglib prefix="f"
uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> |

| <f:view> <h:form> <h1><h:outputText value="List"/></h1> <h:dataTable value="#{arrayOrCollectionOfserver.Cities}" var="item"> <h:column> <f:facet name="header"> <h:outputText value="Id"/> </f:facet> <h:outputText value=" #{item.id}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="CityName"/> </f:facet> <h:outputText value=" #{item.cityName}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="CountryName"/> </f:facet> <h:outputText value=" #{item.countryName}"/> </h:column> </h:dataTable> </h:form> </f:view> |
| <h:dataTable value="#{cities.allCities}" var="item"> |
| <h:form> <h:commandButton action="back" value="back"/> </h:form> |

|
<navigation-rule> <from-view-id>/welcomeJSF.jsp</from-view-id> <navigation-case> <from-outcome>submit</from-outcome> <to-view-id>/result.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/result.jsp</from-view-id> <navigation-case> <from-outcome>back</from-outcome> <to-view-id>/welcomeJSF.jsp</to-view-id> </navigation-case> </navigation-rule> |




Posted by Arun Gupta in web2.0 | Comments[7]
|
|
|
|
Monday August 18, 2008
TOTD# 41: How I created transparent logo of GlassFish using Gimp ?
I followed the original
instructions with Gimp 2.4.5.



Posted by Arun Gupta in General | Comments[3]
|
|
|
|
Wednesday August 06, 2008
TOTD #40: jQuery Autcomplete widget with MySQL, GlassFish, NetBeans
TOTD
#39 explained how to create an Autocomplete widget
(server-powered autocompleting of text fields, similar to Google
Suggest) using Prototype/Script.aculo.us libraries
with NetBeans, GlassFish and MySQL. This Tip Of The Day (TOTD) builds
upon that project and shows how same functionality can be achieved
using jQuery
Library.
|
<script src="javascripts/jquery-1.2.6.min.js"
type="text/javascript"></script> <script type="text/javascript"> function autocomplete(autocomplete) { if (autocomplete.length == 0) { $('#autocomplete_choices').hide(); } else { $.post("/Autocomplete/StatesServlet", { autocomplete_parameter: "" + autocomplete + ""}, function(data) { if (data.length > 0) { $('#autocomplete_choices').show(); $('#autocomplete_choices').html(data); } }); } } </script> |


Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
Tuesday July 29, 2008
TOTD #39: Prototype/Script.aculo.us Autcomplete widget with MySQL, GlassFish, NetBeans
There are several JavaScript libraries that can be embedded in your
webapplication to create a visually appealing interface. Script.aculo.us is
one of the popular ones and is built on the Prototype JavaScript
Framework. The library provides an easy-to-use, cross-browser
user interface JavaScripts that allows you to create fancy effects
commonly visible on web pages these days.
This blog entry gets you started by using Ajax.Autocompleter
that allows for server-powered autocompleting of text fields.
Basically, you type a character in a text field and suggestions for
possible correct values starting with that character are
shown . This is achieved by by sending an Ajax request to the
data source on server, passing the typed character in the request and
processing the response to display on the web page. This effect was
first popularized by Google
Suggest.
In this TOTD (Tip
Of The Day) we will create
a simple web application with a text field in a JSP page that will use
Servlet as the data source. The Servlet retrieves the parameter from
the RequestContext, uses Java Persistence API to query the database and
return response in the expected format. We will use:
| @NamedQuery(name = "States.findLikeName", query = "SELECT s FROM States s WHERE LOWER(s.name) LIKE :searchString"), |

|
String searchString = request.getParameter("autocomplete_parameter"); List<States> list = em.createNamedQuery("States.findLikeName"). setParameter("searchString", searchString.toLowerCase() + "%"). getResultList(); out.println("<ul>"); for (int i = 0; i < list.size(); i++) { States s = list.get(i); out.println("<li>" + s.getName() + "</li>"); } out.println("</ul>"); |
|
<script src="javascripts/prototype.js"
type="text/javascript"></script> <script src="javascripts/scriptaculous.js?load=effects,controls" type="text/javascript"></script> <script type="text/javascript"> window.onload = function() { new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "/Autocomplete/StatesServlet", {}); } </script> |
|
<input type="text" id="autocomplete"
name="autocomplete_parameter"/> <div id="autocomplete_choices" class="autocomplete"></div> |
| .autocomplete { position:absolute; width:250px; background-color:white; margin:0px; padding:0px; overflow:hidden; } .autocomplete ul { list-style-type:none; margin:0px; padding:0px; overflow:auto; } .autocomplete ul li.selected { background-color: #ffb;} .autocomplete ul li { list-style-type:none; display:block; margin:0; padding:2px; height:32px; cursor:pointer; } |
| <LINK href="stylesheets/autocompleter.css" rel="stylesheet" type="text/css"> |





|
window.onload = function() { new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "/Autocomplete/StatesServlet", { minChars: 2 }); } |
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
Friday July 25, 2008
TOTD #38: Creating a MySQL Persistence Unit using NetBeans IDE
This TOTD (Tip
Of The Day) shows how to
create a Persistence Unit (PU) for a MySQL
database using NetBeans
IDE. This PU can then be used in any of Java EE artifacts (JSP,
Servlet, EJB, ...) for database interaction.

| ~ >sudo
mysqld_safe --user root Password:<YOUR PASSWORD> Starting mysqld daemon with databases from /usr/local/mysql/data |
| mysql> CREATE
USER duke IDENTIFIED by 'duke'; Query OK, 0 rows affected (0.00 sec) mysql> create database states; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL on states.* TO duke; Query OK, 0 rows affected (0.00 sec) |


| CREATE TABLE STATES ( id INT, abbrev VARCHAR(2), name VARCHAR(50), PRIMARY KEY (id) ); |

| INSERT INTO STATES VALUES (1, "AL", "Alabama"); INSERT INTO STATES VALUES (2, "AK", "Alaska"); INSERT INTO STATES VALUES (3, "AZ", "Arizona"); INSERT INTO STATES VALUES (4, "AR", "Arkansas"); INSERT INTO STATES VALUES (5, "CA", "California"); INSERT INTO STATES VALUES (6, "CO", "Colorado"); INSERT INTO STATES VALUES (7, "CT", "Connecticut"); INSERT INTO STATES VALUES (8, "DE", "Delaware"); INSERT INTO STATES VALUES (9, "GL", "Florida"); INSERT INTO STATES VALUES (10, "GA", "Georgia"); INSERT INTO STATES VALUES (11, "HI", "Hawaii"); INSERT INTO STATES VALUES (12, "ID", "Idaho"); INSERT INTO STATES VALUES (13, "IL", "Illinois"); INSERT INTO STATES VALUES (14, "IN", "Indiana"); INSERT INTO STATES VALUES (15, "IA", "Iowa"); INSERT INTO STATES VALUES (16, "KS", "Kansas"); INSERT INTO STATES VALUES (17, "KY", "Kentucky"); INSERT INTO STATES VALUES (18, "LA", "Louisiana"); INSERT INTO STATES VALUES (19, "ME", "Maine"); INSERT INTO STATES VALUES (20, "MD", "Maryland"); INSERT INTO STATES VALUES (21, "MA", "Massachussetts"); INSERT INTO STATES VALUES (22, "MI", "Michigan"); INSERT INTO STATES VALUES (23, "MN", "Minnesota"); INSERT INTO STATES VALUES (24, "MS", "Mississippi"); INSERT INTO STATES VALUES (25, "MO", "Missouri"); INSERT INTO STATES VALUES (26, "MT", "Montana"); INSERT INTO STATES VALUES (27, "NE", "Nebraska"); INSERT INTO STATES VALUES (28, "NV", "Nevada"); INSERT INTO STATES VALUES (29, "NH", "New Hampshire"); INSERT INTO STATES VALUES (30, "NJ", "New Jersey"); INSERT INTO STATES VALUES (31, "NM", "New Mexico"); INSERT INTO STATES VALUES (32, "NY", "New York"); INSERT INTO STATES VALUES (33, "NC", "North Carolina"); INSERT INTO STATES VALUES (34, "ND", "North Dakota"); INSERT INTO STATES VALUES (35, "OH", "Ohio"); INSERT INTO STATES VALUES (36, "OK", "Oklahoma"); INSERT INTO STATES VALUES (37, "OR", "Orgeon"); INSERT INTO STATES VALUES (38, "PA", "Pennsylvania"); INSERT INTO STATES VALUES (39, "RI", "Rhode Island"); INSERT INTO STATES VALUES (40, "SC", "South Carolina"); INSERT INTO STATES VALUES (41, "SD", "South Dakota"); INSERT INTO STATES VALUES (42, "TN", "Tennessee"); INSERT INTO STATES VALUES (43, "TX", "Texas"); INSERT INTO STATES VALUES (44, "UT", "Utah"); INSERT INTO STATES VALUES (45, "VT", "Vermont"); INSERT INTO STATES VALUES (46, "VA", "Virginia"); INSERT INTO STATES VALUES (47, "WA", "Washington"); INSERT INTO STATES VALUES (48, "WV", "West Virignia"); INSERT INTO STATES VALUES (49, "WI", "Wisconsin"); INSERT INTO STATES VALUES (50, "WY", "Wyoming"); |



|
<properties> <property name="toplink.jdbc.user" value="duke"/> <property name="toplink.jdbc.password" value="duke"/> </properties> |
| <?xml version="1.0"
encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="AutocompletePU" transaction-type="JTA"> <jta-data-source>jndi/states</jta-data-source> <class>server.States</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="toplink.jdbc.user" value="duke"/> <property name="toplink.jdbc.password" value="duke"/> </properties> </persistence-unit> </persistence> |
| EntityManager em; @Override public void init() throws ServletException { EntityManagerFactory emf = Persistence.createEntityManagerFactory("AutocompletePU"); em = emf.createEntityManager(); } |
|
@PersistenceContext(unitName="AutocompletePU") EntityManager em; |
|
String abbrev = request.getParameter("abbrev"); List<States> list = em.createNamedQuery("States.findByAbbrev"). setParameter("abbrev", abbrev). getResultList(); if (list.size() > 0) { States s = list.get(0); out.println("Found " + s.getName() + " with abbrev \"" + abbrev + "\""); } else { out.println("No matching state found with \"" + abbrev + "\""); } |


Posted by Arun Gupta in web2.0 | Comments[8]
|
|
|
|
Wednesday July 02, 2008
TOTD #37: SQLite3 with Ruby-on-Rails on GlassFish Gem
![]() |
The default database for Rails 2.0.x application is SQLite3. This database is bundled with Mac OSX Leopard and so makes it really easy to get started with Ruby-on-Rails. But it requires couple of additional steps if you are using JRuby. |
| ~/samples/jruby
>~/testbed/jruby-1.1.2/bin/jruby -S rails runner create create app/controllers create app/helpers create app/models create app/views/layouts . . . create log/server.log create log/production.log create log/development.log create log/test.log |
| # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 timeout: 5000 |
| ~/samples/jruby/runner
>~/testbed/jruby-1.1.2/bin/jruby
-S gem install activerecord-jdbcsqlite3-adapter JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed activerecord-jdbc-adapter-0.8.2 Successfully installed jdbc-sqlite3-3.5.8 Successfully installed activerecord-jdbcsqlite3-adapter-0.8.2 3 gems installed Installing ri documentation for activerecord-jdbc-adapter-0.8.2... Installing ri documentation for jdbc-sqlite3-3.5.8... Installing ri documentation for activerecord-jdbcsqlite3-adapter-0.8.2... Installing RDoc documentation for activerecord-jdbc-adapter-0.8.2... Installing RDoc documentation for jdbc-sqlite3-3.5.8... Installing RDoc documentation for activerecord-jdbcsqlite3-adapter-0.8.2... |
| development: adapter: jdbcsqlite3 database: db/development.sqlite3 timeout: 5000 |
| ~/samples/jruby/runner
>~/testbed/jruby-1.1.2/bin/jruby
script/generate scaffold run 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/runs exists app/views/layouts/ exists test/functional/ exists test/unit/ exists public/stylesheets/ create app/views/runs/index.html.erb create app/views/runs/show.html.erb create app/views/runs/new.html.erb create app/views/runs/edit.html.erb create app/views/layouts/runs.html.erb create public/stylesheets/scaffold.css create app/controllers/runs_controller.rb create test/functional/runs_controller_test.rb create app/helpers/runs_helper.rb route map.resources :runs dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/run.rb create test/unit/run_test.rb create test/fixtures/runs.yml create db/migrate create db/migrate/20080630211244_create_runs.rb |
| ~/samples/jruby/runner
>~/testbed/jruby-1.1.2/bin/jruby
-S rake db:migrate (in /Users/arungupta/samples/jruby/runner) == 20080630205502 CreateRuns: migrating ======================================= -- create_table(:runs) -> 0.0410s -> 0 rows == 20080630205502 CreateRuns: migrated (0.0420s) ============================== |
| development: adapter: jdbcsqlite3 database: runner/db/development.sqlite3 timeout: 5000 |
| ~/samples/jruby
>~/testbed/jruby-1.1.2/bin/jruby
-S glassfish_rails runner Jun 30, 2008 1:52:08 PM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on HK2 platform Jun 30, 2008 1:52:08 PM com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient INFO: Cannot find javadb client jar file, jdbc driver not available Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3000 Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_protocols_disabled Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_ciphers_disabled Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3131 Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3838 Jun 30, 2008 1:52:09 PM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot INFO: Admin Console Adapter: context root: /admin Jun 30, 2008 1:52:09 PM com.sun.grizzly.jruby.RailsAdapter startRubyRuntimePool INFO: Starting Rails instances Jun 30, 2008 1:52:16 PM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Jun 30, 2008 1:52:17 PM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: JRuby and Rails instance instantiation took : 7998ms Jun 30, 2008 1:52:17 PM org.glassfish.scripting.rails.RailsDeployer load INFO: Loading application runner at / Jun 30, 2008 1:52:17 PM com.sun.enterprise.v3.server.AppServerStartup run INFO: Glassfish v3 started in 9430 ms |

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
Tuesday July 01, 2008
TOTD# 36: Writing First Test for a Rails Application
I've created a Rails "Hello World" app numerous
times. But I decided to write a simple using the testing
framework provided by Rails. This blog explains my experience of
writing such a test.
| ~/samples/jruby/test
>~/testbed/jruby-1.1.2/bin/jruby
-S rails helloworld
create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers . . . create log/production.log create log/development.log create log/test.log |
| ~/samples/jruby/test/helloworld >~/testbed/jruby-1.1.2/bin/jruby script/generate controller home index |
| JRuby
limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:278:in `load_missing_constant': uninitialized constant ActiveRecord (NameError) from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in `const_missing' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:479:in `const_missing' from /Users/arungupta/samples/jruby/test/helloworld/config/initializers/new_rails_defaults.rb:5:in `/Users/arungupta/samples/jruby/test/helloworld/config/initializers/new_rails_defaults.rb' from /Users/arungupta/samples/jruby/test/helloworld/config/initializers/new_rails_defaults.rb:502:in `load' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:475:in `load_application_initializers' ... 8 levels... from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/generate.rb:27:in `require' from /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from script/generate:3 |
| if defined?(ActiveRecord) # Include Active Record class name as root for JSON serialized output. ActiveRecord::Base.include_root_in_json = true # Store the full class name (including module namespace) in STI type column. ActiveRecord::Base.store_full_sti_class = true end |
| ~/samples/jruby/test/helloworld
>~/testbed/jruby-1.1.2/bin/jruby
script/generate controller home index JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL exists app/controllers/ exists app/helpers/ create app/views/home exists test/functional/ create app/controllers/home_controller.rb create test/functional/home_controller_test.rb create app/helpers/home_helper.rb create app/views/home/index.html.erb |
| ~/workspaces/glassfish-scripting/rails/v3/src/test/rails
>~/testbed/jruby-1.1.2/bin/jruby
-S glassfish_rails helloworld Jun 27, 2008 2:46:18 PM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on HK2 platform Jun 27, 2008 2:46:18 PM com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient INFO: Cannot find javadb client jar file, jdbc driver not available Jun 27, 2008 2:46:18 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3000 Jun 27, 2008 2:46:18 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_protocols_disabled Jun 27, 2008 2:46:18 PM com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator configureSSL WARNING: pewebcontainer.all_ssl_ciphers_disabled Jun 27, 2008 2:46:19 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3131 Jun 27, 2008 2:46:19 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start INFO: Listening on port 3838 Jun 27, 2008 2:46:19 PM com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot INFO: Admin Console Adapter: context root: /admin Jun 27, 2008 2:46:19 PM com.sun.grizzly.jruby.RailsAdapter startRubyRuntimePool INFO: Starting Rails instances Jun 27, 2008 2:46:24 PM SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Jun 27, 2008 2:46:24 PM com.sun.grizzly.jruby.RubyObjectPool$1 run INFO: JRuby and Rails instance instantiation took : 5169ms Jun 27, 2008 2:46:24 PM org.glassfish.scripting.rails.RailsDeployer load INFO: Loading application helloworld at / Jun 27, 2008 2:46:24 PM com.sun.enterprise.v3.server.AppServerStartup run INFO: Glassfish v3 started in 6419 ms Jun 27, 2008 2:46:28 PM com.sun.grizzly.jruby.RailsAdapter$Logger log INFO: |
| require 'home_controller' class HomeControllerTest < ActionController::TestCase def test_index get :index assert_response :success end end |
| ~/workspaces/glassfish-scripting/rails/v3/src/test/rails/helloworld
>~/testbed/jruby-1.1.2/bin/jruby
-S rake test (in /Users/arungupta/workspaces/glassfish-scripting/rails/v3/src/test/rails/helloworld) /Users/arungupta/testbed/jruby-1.1.2/bin/jruby -Ilib:test "/Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb" /Users/arungupta/testbed/jruby-1.1.2/bin/jruby -Ilib:test "/Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb" "test/functional/home_controller_test.rb" JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Loaded suite /Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader Started . Finished in 0.308 seconds. 1 tests, 1 assertions, 0 failures, 0 errors /Users/arungupta/testbed/jruby-1.1.2/bin/jruby -Ilib:test "/Users/arungupta/testbed/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb" |
Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.
Technorati: rubyonrails jruby ruby glassfish totdPosted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
Monday June 23, 2008
TOTD #35: Rails Database Connection on Solaris
Are you deploying your JRuby-on-Rails applications
on Solaris
(or any variety of Unix) and not able to connect to the database ?
I experienced it last week so thought of sharing the tip here. Luckily
it's really simple.
Here is the default generated "config/database.yml"
| development: adapter: mysql encoding: utf8 database: runner_development username: root password: socket: /tmp/mysql.sock |
| development: adapter: mysql encoding: utf8 database: runner_development username: root password: socket: /tmp/mysql.sock host: 127.0.01 |
Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.
Technorati: totd rubyonrails jruby ruby opensolaris mysqlPosted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|