Wednesday November 11, 2009
Attended and presented at my first NLJUG's JFall conference earlier today.
NLJUG is the Java User Group of Netherlands. It's a non-profit organization that try to get out the maximum out of content sharing with all of its members. An annual subscription to the JUG is 35.50 Euros and allows the members to attend its two annual conferences - JSpring and JFall and also provide a year long subscription to a local Java magazine.
The conference itself started with 200 attendees in 2004 and has grown up to 1250 attendees last year. This year they had to cap the limit at 1000 because of the cost control measures. NLJUG rely upon subscriptions from business partners for funding and in turn profile them within the Dutch community and offer them high-bandwidth networking opportunities at conferences like this. If you are interested in being their partner, send an email to info@nljug.org.
This year, the selection committee had to review 100+ submissions to pick the top 32 sessions and 2 hands-on-labs sessions. The conference focus has certainly expanded from Java language to the Java platform and had a few talks even on Scala, Android, and HTML 5.
The slides from my "Java EE 6 and GlassFish v3: Paving the path for future" are available below:
Several demos shown (or not because of time shortage) during the talk are available at:
Most of the English-speaking sessions are by Sun speakers so could not attend other sessions that I wanted to.
Here are some pictures from the event:
It was certainly a pleasure to meet Bert Ertman, Klaasjan Tukker, Bert Breeman and other folks involved behind NLJUG and JFall 2009. The complete photo album is available:
Now to Rome for delivering an all-day GlassFish workshop at a partner's location. And then finally home ... phew!
Technorati: conf nljug jfall amsterdam glassfish v3 javaee
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
| TOTD #113: JavaFX front-end for GlassFish v3 Administration - Using REST interface
GlassFish v3 provides a REST interface to management and monitoring information as discussed in TOTD #96. As mentioned in that blog "the REST interface is a lower level API that enables toolkit developers and IT administrators to write their custom scripts/clients using language of their choice". This blog introduces a tool that uses the REST API to provide management and monitoring of GlassFish v3 and is written using JavaFX.
This tool is only a proof-of-concept that demonstrates that GlassFish v3 REST interface is functionally very rich and can indeed be used to write third-party administration tools. The tool uses a subset of the REST interface and exposes only a limited amount of management and monitoring capabilities otherwise exposed. After all this is a proof-of-concept :-)
A screencast of this tool in action along with a downloadable JNLP version will soon be available. For now, here is a snapshot of the main window of this tool:

The main screen allows you to enter a URL for the GlassFish administration. Then the GlassFish instance can be stopped/restarted from the main window using the buttons on top right. There is an animation at the bottom of the screen where the glassfish is swimming in the ocean and is directly related to the state of server running in the background. If the server is running, the animation works. If the server is not running then the animation stops as well.
The main screen has three main buttons:
Clicking on "List Applications" shows the list of applications deployed on this particular instance. Here is how a snapshot looks like for an instance running on my localhost at port 4848:

As shown in the screen, it shows a radio-bulleted list of all the applications. Each bullet is also accompanied by an image indicating the type of application - Web or Rails for now. Select the application and click on "Monitor" button to monitor that particular application. The REST API exposes a vast amount of monitoring data but a subset of monitoring data is displayed for Web and Rails application for now. Here is a snapshot of the monitoring data published for a Web application:

As evident by the list of engines, this web application has EJBs bundled as well. It also shows total number of Servlets/JSPs loaded, number of requests made to this web application and some other monitoring data.
Here is a snapshot of the monitoring data published for a Rails application:

It shows number of JRuby runtimes configured for the application, number of requests sent to the application, number of responses with different HTTP access codes and some other data.
The monitoring levels of different containers can be easily updated by clicking on "Show Monitoring Levels" as shown below:

And finally some server statistics are shown by clicking on "Server Stats" as shown below:

It shows when the server was started, host/port information, version and finally how long the server has been running for. The dials are an animation that shows the server up time.
Here are other related JavaFX and GlassFish related blogs published earlier:
How are you going to use the REST interface exposed by GlassFish v3 in your environment ?
Are you using JavaFX with GlassFish together in any way ?
Leave a comment on this blog if you do!
Technorati: javafx glassfish v3 rest web jruby rubyonrails rest administration monitoring management
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Thursday November 05, 2009
Java EE 6 & GlassFish v3 swimming to Amsterdam - JFall 2009
![]() |
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:
Here are the sessions that I'd like to attend:
Most of the sessions are in Dutch so may have to fall back on English speaking sessions :(
Here are some quick data points ...
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
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Tuesday October 20, 2009
Comparing GlassFish and JBoss: Helping you decide!
![]() |
The majority of developers building Java applications will find that the GlassFish application server offers distinct advantages compared with JBoss. This paper summarizes the features and capabilities that make GlassFish a superior choice for building, deploying, and managing enterprise-class Java applications and Web services. |
Here are some other recently published GlassFish white papers:
A list of white papers & webinars published earlier this year is available here. An updated list is always available in the Resources section of GlassFish Portfolio.
Technorati: glassfish jboss whitepaper
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Thursday October 15, 2009
Oracle Open World 2009 – Day 4 with Larry, Arnold , and Aerosmith

Day 4 of Oracle Open World 2009 (Day 1, Day 2, Day 3) was all about about spending time at the Java EE 6 exhibit, attending Larry's keynote and finally the Appreciation Event.
Larry talked about Oracle Enterprise Linux, Exadata v2, Oracle Enterprise Manager, and Fusion Apps.
Exadata v2 runs Oracle database faster than any other machine on the planet. With Exadata v1, the advantages were pretty obvious with customers reducing query times from 24 hours to 30 mins and 30 min to 1 min and some observing 10x - 72x improvements. Exadata v2 is much faster and bigger than v1 with 400 GB of DRAM + 5 TB of flash gives spectacular random IO memory (1 million I/Os per second).
Arnold Schwarzenegger made a surprise appearance during Larry's keynote to talk about the technology innovation. Watch him speak in the 2-part videos below:
Watch Arnold's endorsement of Oracle/Sun merger starting at 1:15 in part 2 video above.
This was my first experience to watch Arnold speaking live at a conference and must say I was truly impressed, and feel honored, by our esteemed governor. He is a great business men who did not deter from the opportunity to sell "Kaalifornia" to all the conference attendees. And he still very much carry the charm & persona from his previous life as a superstar.
The Appreciation Event had an impressive lineup of rocks bands including Aerosmith and Roger Daltrey. There was a boardwalk carnival with Ferris wheel, thrill rides and a games arcade. And of course there were exotic treats to feed you. One thing was clear, Oracle certainly knows how to take care of their customers!
Here are some pictures from yesterday:
|
|
|
|
|
|
|
|
|
After attending Oracle Open World 2009 for four days, I'm more than eagerly waiting for the merger to complete now. Now whether they keep me or not, I'm confident that they'll be able to turn Sun around and make money out of it. If they keep me, I'm part of that success. If not, I'll get job elsewhere but at least will be happy to see Sun's products generating revenue :-)
Cmon EU!
Technorati: conf oracle openworld oow glassfish javaee otn bloggers arnold
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Tuesday October 13, 2009
Oracle Open World 2009 – Day 3 Report

Day 3 of Oracle Open World 2009 (Day 1, Day 2) started on an adventurous note for me. The San Francisco Bay Area got hit with the strongest October storm in 47 years and so the ride from home to Moscone Center took almost 30 extra minutes, because of flooded roads, strong winds, other accidents, and hydroplaning multiple times. Anyway only missed first few minutes of Thomas Kurian's keynote. Kurian is no stranger to the Java crowd because he is a regular keynote speaker at JavaOne. However it was totally impressive to see customer endorsements (both quality and quantity) and how they are using Oracle to solve operational problems.
Some more observations from the floor:
I spent some time on the Java EE 6 booth talking about the technology and showcasing GlassFish features such as monitoring and Rails deployment.
Enjoy videos of marketing gimmicks by some vendors at the show floor:
The evening ended with the OOW Bloggers Meetup at LJ's Martini Club & Grill. It was good to meet fellow bloggers from Oracle and other companies. OTN folks arranged a game to promote social networking. Basically, everybody was given a tee-shirt to wear and whoever has the most signatures from other bloggers wins an HP notebook. A MacBook would've been a better incentive to compete for me ;-) Anyway there was beer and muchies to keep the bloggers happy. Thanks to Justin (aka "King of OTN") for picking the bill!Here are some pictures from earlier today:
|
|
|
|
|
|
|
|
|
|
|
|
If you are not able to attend in person, then you can follow OOW Blogs, Open World Live, @OpenWorld (twitter), Community tweets with #oow.
Looking forward to see Arnold Schwarzenegger discussing technology innovation with Larry Ellison tomorrow.
Technorati: conf oracle openworld oow glassfish javaee otn bloggers
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
| Hudson Webinar and Q&A – 10/14, 10am PT
Koshuke (aka "Mr Hudson") is giving a webinar and a live Q&A session on Hudson tomorrow.
Please register now!
Technorati: glassfish hudson webinar
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Monday October 12, 2009
Oracle Open World 2009 - Day 2 Report

Following from Day 1, the Day 2 started with Charles Phillips and Safra Catz keynote. The keynotes at Open World are significantly different from JavaOne or any other developer conference I've attended so far. Of course they are expected to be because Open World is not primarily a developer's conference. Oracle Develop (OD) certainly closely mimic any of the conferences I've typically attended. My "exhibitor" badge restricted me from attending any of the sessions at OD though :-(
Here are some interesting statistics about the conference:
5 content streams (Database, Applications, Industries, Management & Infrastructure, & Middleware)
314 demo kisosk
401 partners & customer exchibiting
1966 educational sessions (10% more than last year)
4500 Oracle developers/experts for you
81,266 hotel room nights
170,000 cups of coffee
182,000 online participation
Here are some interesting sightings from the Open World exhibitor pavilion:
On a personal front, everything that possibly could went wrong as part of the demo installation yesterday and rehearsal for my talks earlier today. NetBeans was not able to connect to the Oracle database (couple of machine restarts solved that), GlassFish Tools Bundle for Eclipse was timing out attempting to start GlassFish (removing workspace solved that problem), NetBeans's RESTful tooling not recognizing JPA entities, and also found a blocking bug (issue #10166) in deploying Rails app to latest GlassFish promoted build. These demos have worked seamlessly for me all the time time and fortunately worked well during the talk.
My talk at the Unconference on Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBeans/Eclipse went well. It was truly an unconference event with no projector or mic in the presentation room. But the small attendance allowed us to huddle around the table and luckily all the demos worked seamlessly. The slides are available at:
Several demos shown in the talk are available at:
The slides have pointers to several other demos as well. Also showed the simplicity of Java EE 6 development using Eclipse in Java Platform, Enterprise Edition: The Foundation and Future of Your Enterpise.
The day concluded with OTN Night in Howard St tent. Check out a brief video from the event:
Here are some pictures from earlier today:
|
|
|
|
|
|
|
|
|
|
|
If you are not able to attend in person, then you can follow OOW Blogs, Open World Live, @OpenWorld (twitter), Community tweets with #oow.
Back tomorrow on Day 3 with more pictures :-)
Technorati: conf oracle openworld oow glassfish javaee netbeans eclipse
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
|
Sunday October 11, 2009
Oracle Open World 2009 - Day 1 Report

Sun Microsystems is the innovation sponsor of Oracle Open World 2009. And that's what was the theme of Scott McNealy's keynote on a "Sun"day. It's been a while that I've seen Scott on the keynote stage and it truly was an enjoyable experience. In his characteristic way, he gave top 10 reasons that "Engineers have gone wild" as:
10. Who needs thumb drive in the shape of sushi ?
9. "Noble prize" recently awards for gas mask bra - no more ridiculous than other noble prizes recently awarded
8. OS/2
7. Patent awarded for face mask with voice modification capability
6. I could do an entire top 10 of worlds strangest keyboards (strangest being iPhone, "Friends don't let friends type on iPhone")
5. Windows 7
4. Man uses SPARCstation for his ashses
3. New market in "family size' plots
2. Mainframe running Linux
1. Some one came up with this crazy idea for a 'Java Ring'
And then on a more serious note, and keeping with the keynote theme, top 10 innovations from Sun:
10. NFS/PC-NFS Technology (1983)
9. SPARC (1989)
8. Open Source Software (Berkeley Unix, "Red Hat of Berkeley Unix", #1 contributor to OSS community)
7. BSD + UNIX System 5 = Solaris
6. Java (Java card, EE/SE/ME, JavaFX)
5. E10K (64-way Solaris, no longer mainframe required)
4. ZFS/Open Storage/Flash (Exadata)
3. Project Blackbox, world's first modular datacenter
2. SunRay
1. Chip multithreading "CoolThreads"
And the biggest innovation from Sun:
Kicked Butt
Had Fun
Didn't CHeat
Loved our customers
Changed computing for ever
Scott explained why SPARC, Solaris, MySQL, Java are here to stay. "Kick Butt, Have Fun" is truly the spirit at Sun :-)
James Gosling, the father of Java, showed up on the stage to talk about Java's relevance for Oracle. Also showed "The Gospel of Java according to James" and the video is shown below:
John Fowler talked about several brand new Sun/Oracle world-record benchmarks. A key point from these benchmarks "Oracle and Sun were able to set the world record using 1/8th the hardware that IBM used for its largest benchmark". And we also announced F5100 Flash Array, the world's fastest solid-state flash array.
And here are some quotes from Larry Ellison's keynote appearance:
It totally reminded me of Scott McNealy's "dot-not" (as compared to .NET) and "c-flat" (for C#) quotes from JavaOne :-)
Check out related articles about Sun's presence at Open World:
Here are some pictures:
If you are not able to attend in person, then you can follow OOW Blogs, Open World Live, @OpenWorld (twitter), Community tweets with #oow.
On a personal note, this is my first Open World and am totally amazed by the size of attendees, and it's only a Sunday. The entire Howard St is shutdown and tents are installed to accommodate the conference. All 3 Moscone halls (North, South, and West) are used. A scale down replica of Larry's "Rising Sun" is also displayed on Howard Street. And for the first time in 10 years, I'm getting only an Exhibitor badge at Moscone :-)
Also installed GlassFish, NetBeans/Eclipse demos on the booth machine and ready to wow the audience with Java EE 6 in the exhibitor hall for the next 3 days! And of course, I'm talking at the Unconference tomorrow at 11am on Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBeans/Eclipse. Get ready to see lots and lots of demos!
Back tomorrow with more pictures :-)
Technorati: conf oracle openworld oow glassfish netbeans eclipse
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Thursday October 08, 2009
TOTD #112: Exposing Oracle database tables as RESTful entities using JAX-RS, GlassFish, and NetBeans
This Tip Of The Day explains how to expose an existing Oracle database table as a RESTful Web service endpoint using NetBeans tooling and deployed on GlassFish.
Lets get started!















Do you have the need to expose your Oracle database tables as RESTful entities ?
A complete archive of all the TOTDs is available here.
This and other similar applications will be demonstrated at the upcoming Oracle Open World.
Technorati: totd oracle database glassfish v3 netbeans javaee jax-rs jpa rest
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Wednesday October 07, 2009
TOTD #111: Rails Scaffold for a pre-existing table using Oracle and GlassFish
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!
development:
adapter: oracle_enhanced
host: localhost
database: orcl
username: hr
password: hr
~/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
set_primary_key "department_id"
~/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
. . .
~/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
set_primary_key "employee_id"

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
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Tuesday October 06, 2009
TOTD #110: JRuby on Rails application using Oracle on GlassFish
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:
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!
>./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...
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.
rails (2.3.4)
activerecord-jdbc-adapter (0.9.2)
glassfish (0.9.5)
jruby -S gem install rails activercord-jdbc-adapter glassfish
jruby -S rails bookstore -d oracle
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:
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...
development:
adapter: oracle_enhanced
host: localhost
database: orcl
username: glassfish
password: glassfish
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
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
~/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) ===========================================
~/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
. . .






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
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Sunday October 04, 2009
Silicon Valley Code Code Camp 2009 Trip Report
The Foothill college was sprawling with developers, architects, engineers, et al from all over the San Francisco Bay Area to attend the Silicon Valley Code Camp 2009. This was my third speaking engagement (2008, 2007) and the code camp has certainly matured over the last years. The attendance is steadily growing and the quality of sessions is become more mature as well.
I presented on Java EE 6, GlassFish, and Eclipse Tooling for GlassFish/Java EE 6 and the slides are available below:
and
Both the talks were demo intensive and showed Deploy-on-Save, Preserving session state across deployments, Java EE 6 wizards in NetBeans (1, 2, 3, 4, 5) and Eclipse (1, 2, 3), Metro JAX-WS Web services development in Eclipse, GlassFish v3 Monitoring, GlassFish v3 REST interface to management and monitoring and many others. All the demos are available as screencasts and/or blog entries and the complete set of links are listed in the presentations.
Here are some pictures from the event:
That's it folks, see ya next year!
Technorati: siliconvalleycodecamp svcc glassfish javaee eclipse
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Friday October 02, 2009
TOTD #109: How to convert a JSF managed bean to JSR 299 bean (Web Beans) ?
This entry is a follow up to TOTD #95 and shows how to use the recent integrations of JSR 299 in GlassFish v3 to convert a JSF managed bean to a JSR 299 bean (aka Web Beans). The TOTD #95 describes a simple Java EE 6 web application that uses Java Server Faces 2.0 components for displaying the results of a database query conducted by EJB 3.1 and JPA 2.0 classes.
The EJB class, which also acts as the JSF managed bean, looks like:
@javax.ejb.Stateless
@ManagedBean
public class StateList {
@PersistenceUnit
EntityManagerFactory emf;
public List getStates() {
return emf.createEntityManager().createNamedQuery(”States.findAll”).getResultList();
}
}
Three changes are required to convert this class into a JSR 299 compliant bean (Web Bean) as listed below:
@PersistenceUnit
EntityManagerFactory emf;
EntityManager emf = Persistence.createEntityManagerFactory("HelloEclipseLinkPU");

That's it, re-deploy your application and now you are using the Web Beans integration in GlassFish v3 instead of JSF managed bean. The output is available at "http://localhost:8080/HelloEclipseLink/forwardToJSF.jsp" as shown:
This is the exact same output as shown in TOTD #95.
Now, one-by-one, JPA, EJB, Transactions and other components will start working. Read Roger's blog for another example of Web Beans in GlassFish.
A complete archive of all the tips is available here.
Technorati: totd glassfish v3 mysql javaee6 javaserverfaces webbeans jsr299 netbeans
Posted by Arun Gupta in General | Comments[2]
|
|
|
|
|
Thursday October 01, 2009
TOTD #106 explained how to install Oracle database 10g R2 on Mac OS X. TOTD #107 explained how to connect this Oracle database using NetBeans. This Tip Of The Day will explain how to use the sample HR database (that comes with Oracle database server) to write a simple Java EE 6 application.
This application will use Java Server Faces 2.0 for displaying the results, Enterprise Java Beans 3.1 + Java Persistence API 2.0 for middle tier, and Oracle database server + GlassFish v3 as the backend. The latest promoted build (65 of this writing) will not work because of the issue #9885 so this blog will use build 63 instead.
Several improvements have been made over NetBeans 6.8 M1 build and this blog is using the nightly build of 9/27. The environment used in this blog is:
Lets get started!
./bin/asadmin start-domain --verbose &
./bin/asadmin create-jdbc-connection-pool --datasourceclassname oracle.jdbc.pool.OracleDataSource --restype javax.sql.DataSource --property "User=hr:Password=hr:URL=jdbc\:oracle\:thin\:@localhost\:1521\:orcl" jdbc/hr
./bin/asadmin ping-connection-pool jdbc/hr
./bin/asadmin create-jdbc-resource --connectionpoolid jdbc/hr jdbc/hr









@javax.ejb.Stateless
@javax.faces.bean.ManagedBean
@PersistenceUnit
EntityManagerFactory emf;
public List getEmployees() {
return em.createNamedQuery("Employees.findAll").getResultList();
}
@Stateless
@ManagedBean
public class EmployeesBean {
@PersistenceContext
EntityManager em;
public List getEmployees() {
return em.createNamedQuery("Employees.findAll").getResultList();
}
}
<h1>First Java EE 6 app using Oracle database</>
<h:dataTable var="emp" value="#{employeesBean.employees}" border="1">
<h:column><h:outputText value="#{emp.lastName}"/>, <h:outputText value="#{emp.firstName}"/></h:column>
<h:column><h:outputText value="#{emp.email}"/></h:column>
<h:column><h:outputText value="#{emp.hireDate}"/></h:column>
</h:dataTable>

So we can easily create a Java EE 6 application using NetBeans, Oracle, and GlassFish.
A complete archive of all the TOTDs is available here.
This and other similar applications will be demonstrated at the upcoming Oracle Open World.
Technorati: totd oracle database glassfish v3 javaee javaserverfaces ejb jpa netbeans oow
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Today's Page Hits: 926
Total # blog entries: 1002