Arun Gupta's Blog
Arun Gupta is a GlassFish Evangelist focusing on Web Tier at Sun. He was the spec lead for APIs in the Java platform, committer in multiple Open Source projects, participated in standard bodies and contributed to Java EE and SE releases.
Rails on GlassFish - "most performant of all", "simpler and just works", "blazing speed"
Posted by arungupta on July 02, 2009 at 10:02 AM | Permalink
| Comments (0)
Here are some quotes about running Rails applications on GlassFish from user@jruby
mailing list :
I find the glassfish gem
to be the most performant of all -- and I don't need to war-up my app.
I also have some mongrel
cluster stuff, but glassfish is simpler and just works.
Voila...blazing speed,
can handle lots of traffic. Note that I am also cominging into apache
from a dyndns name. So, whatever IP I have, I can go straight to
execution on the glassfish gem and NO warring up! What could be easier
deployment, or a faster execution?
It's running fantasticly
and performing like nothing I've seen before :) Completely stable
memory, no wirings or anything bad for 5 days now.. (with several
ab/htperf stresstests).
It's always exciting to get good endorsements of our efforts in the
GlassFish team :)
Other similar stories for using Rails/GlassFish in production are
described at rubyonrails+stories .
Technorati: glassfish
v3 gem rubyonrails
stories
jruby
FISL 2009 Wrapup - 3 talks, 1 talk show, 14 blogs, 10 videos, 275 pics, 2 GlassFish production stories
Posted by arungupta on June 30, 2009 at 10:53 AM | Permalink
| Comments (0)
FISL 2009 wrapped up over the weekend. Even though the
conference officially ended on Saturday but the connections made there
will certainly allow us to continue all the great momentum. The
conference celebrates open source and it was certainly great to see
Federal Government and Banks with their booths in the exhibitor halls.
The visit by Brazilian President Lula certainly highlights the
importance of this conference to the local community. There were booths
from Debian, Firefox, Ubuntu and other major open source softwares.
Some commercial vendors had a booth as well and of course Sun
Microsystems had a big presence with GlassFish ,
Open Solaris , NetBeans , MySQL and other offerings .
I delivered 3 talks and participated in 1 talk show:
Java
EE 6 (slides )
&
Enterprise
Features of GlassFish (slides )
Creating powerful web applications using
GlassFish, MySQL and NetBeans/Eclipse slides
Continuous Integration using Hudson (slides )
Simon Phipps Talk Show
This blog featured 14 blogs, 10 videos, 275 pictures and 2 GlassFish
production stories over the
past week . The collage is created from some
of the pictures:
Click on the collage to see a larger version. The complete photo album
is available at:
A playlist of all the 10 videos is below:
And now all the 14 blog entries ...
Over all, thoroughly enjoyed the Brazilian spirit and looking forward
to next visit!
Many thanks to the Sun Brazil team, especially Bruno Souza ,
Mauricio
Leal , Eduardo Lima, Vitorio Sassi
and other Campus
Ambassadors !
Technorati: conf
brazil
fisl javali glassfish
netbeans
mysql
hudson
Digital TV-based Banking using GlassFish, NetBeans and MySQL - Ginga community in Brazil
Posted by arungupta on June 29, 2009 at 01:29 PM | Permalink
| Comments (0)
Learn how GlassFish
and NetBeans
helped Ginga community
to build a TV Banking application in Brazil. See a live demo of the
product, it's really exciting!
Why GlassFish ? - They love how NetBeans tooling completely hides the
complexity of what's happening underneath and the ease-of-use with
GlassFish.
Thanks Hugo Lavalle for the interview and good luck with your product!
Technorati: conf
fisl brazil glassfish
story
netbeans
mysql
ginga
digitaltv
banking
supercrud.com in Brazil picked GlassFish over JBoss - Find out why!
Posted by arungupta on June 29, 2009 at 01:28 PM | Permalink
| Comments (1)
Vinicius
Senger , founder of Globalcode
- a Java training/consulting company in Brazil, is running supercrud.com on GlassFish instead of
JBoss.
He is a Java EE architect, consultant, trainer, and do Java EE related
research as well. He is a JSF 2 Expert Group member, find NetBeans and
GlassFish integration amazing and feels its getting better all
the time. He runs supercrud.com
on GlassFish. The reasons to pick GlassFish over JBoss:
Much easier to install
Easy to manage (data sources, EJBs, redeployments) using
web-based administration console
Don't use clustering today but know it's another good
feature
He thinks that Brazilian community's expectation was expecting much
more from JBoss. He is seeing lot of Brazilian companies and developers
moving to GlassFish because it's
Faster
More modular
Faster redeployment
Better integration with NetBeans/Eclipse
Hear the short interview recorded at FISL earlier this week:
A formal production story will be published soon as well. Thanks
Vinicius for the interview!
Technorati: conf
brazil
fisl javali glassfish jboss
story
FISL 2009 Day 4 in Pictures
Posted by arungupta on June 27, 2009 at 01:14 PM | Permalink
| Comments (2)
Continuing from Day
1 , 2
and 3
...
And the complete album:
Now looking forward to head back home!
Technorati: conf
brazil
fisl glassfish
FISL 2009 Day 3 in Pictures & Videos
Posted by arungupta on June 27, 2009 at 02:08 AM | Permalink
| Comments (0)
Continuing from Day
1 and 2
...
I participated in Simon
Phipps Talk Show on GlassFish
and that was fun :) The usual points:
~50% of the projects currently target GlassFish and that
the number jumps to 73% when only counting new projects (according to Ohloh
reports )
Best price/performance, First to be Java EE 5 compliance
and Most downloaded application server
The GlassFish download numbers are much
higher than JBoss.
Brazilian community loves GlassFish
over JBoss
Somebody in audience has been using GlassFish for past one year and
very happy with it's performance.
I also delivered the Hudson
talk on behalf of Fabiane Nardon. Hudson is an open
source Continuous
Integration system that is highly extensible and has a very
healthy ecosystem around it. The slides are available here
and can also be viewed below:
Now pics from the day ...
The Brazilian President Lula visited the pavilion but I left early so
never got to see him ;-)
The speaker's dinner at 35CTG
Churrascaria was nothing special but there were some real
good live performances made the whole thing worthwhile. Enjoy it below:
And the evolving album:
See you in couple of hours at the last day of FISL
and then finally head back to home :)
Technorati: conf
brazil
fisl glassfish
hudson
FISL Day 2 in Pictures & Videos
Posted by arungupta on June 26, 2009 at 03:11 AM | Permalink
| Comments (0)
Continuing from FISL
Day 1 ...
Here is a video of the ever excited Brazilian community for soccer
balls in the pavilion:
If you didn't get a soccer ball, come by at the Sun booth tomorrow and
make sure to practice like the folks below:
The day ended with a nice soccer match between Internacional
and LDU Quito
from Ecuador at Beira
Rio stadium . Feel the enthusiasm in the video below:
We kept waiting for Internacional to score but guess it was not
there day and they lost 1-0 :(
On to Day 3 in couple of hours ....
Technorati: conf
fisl brazil internacional
soccer
football
FISL 2009 Day 1 Report
Posted by arungupta on June 24, 2009 at 08:56 PM | Permalink
| Comments (0)
I presented on "Creating
powerful web applications using GlassFish, MySQL and NetBeans/Eclipse "
as the first talk of FISL 10 yesterday. The room was only partial full
being the first talk of FISL but got packed towards the middle so that
was exciting. The slides are available here .
The key message is that NetBeans
and Eclipse
provide a seamless development/deployment environment for GlassFish .
The several demos shown in the talk are explained at:
And you can find a lot more information on the Portuguese
TheAquarium .
The soccer balls at the Sun booth in the pavilion were quite a hit as
evident by the video below:
Come by again at Sun booth until the end of conference to get one for
yourself :)
There were booths from Debian, Gnome, Firefox, Fedora and a host of
other open source projects. There were community booths from local Java
User Groups, Linux User Group, Open Solaris User Group and similar
efforts. Some government and financial companies that heavily
use/promote open source products were also present. And then there were
other commercial vendors as well!
Some attendees were playing musical
instruments to the local tunes which added to the festive atmosphere in
the exhibitor floor. Enjoy the video below:
The day ended with great food at Na
Brasa Churrascaria , love the caipirinhas !
Here are some pictures from Day 1:
This is the 10th anniversary of FISL and so here is the timline over
the past years as shown in the exhibitor pavilion:
And the evolving album:
See you in few hours at the FISL .
Technorati: conf
brazil
fisl glassfish
mysql
netbeans
eclipse
Javali 2009 Trip Report
Posted by arungupta on June 23, 2009 at 06:47 PM | Permalink
| Comments (0)
I, along with several other speakers, presented at Javali (an ancillary
event of FISL )
earlier today.
The event was sponsored by Sun Microsystems. Many thanks to Sou Java
and RS JUG for
organizing the event and thanks to Serpro for
hosting the event.
There were several
speakers from different companies making the event a good mix.
I presented on Java
EE 6 , showed GlassFish
Tools Bundle for Eclipse
and gave a brief overview of some of the enterprise features
of GlassFish .
The Java EE 6 focuses on making the platform more powerful and
adding more flexibility. The power is added by revamping several
existing specifications such as Servlet 3.0 and Java Server Faces 2.0.
The flexibility is incoporated by several mechanisms. The first is the
ability to define a profile
targeted at a particular bundle of technologies, such as Web profile
defined by the JSR
316 EG (more
details ). Secondly, some of the existing specifications that
are not widely used, such as JAX-RPC or JAXR, now can be pruned from the
platform. And lastly third-party libraries can be easily registered
using "web-fragment.xml" (more
details ). All these together make the entire platform
really powerful and flexible.
The GlassFish Tools Bundle for Eclipse provide an integrated bundle
based on Eclipse Ganymede 3.4.2 with GlassFish v2.1 and v3
integrated and pre-configured. These bits can also be installed on
Eclipse Galileo (to be released soon) as a separate plugin. The
features like Deploy-on-save and Session-preservation boosts the
productivity tremendously allowing the developer to focus on business
logic. Screencast
#28 shows more details how to easily get started.
The enterprise features of GlassFish covered were:
There were approximately 50 attendees physically present in the room
but many others in the mutliple video conference rooms and on the
Internet. Bruno told me that there were 92 viewers on the
public Internet and 132 within Serpro after my talk, so that's cool :)
The slides presented are available here
(Java EE 6) and here
(Enterprise Features).
Brian
Leonard 's talk on "Developing beyond localhost" showed
practical
strategies of taking an application developed on the localhost and
ensuring it works in the deployed environment. The basic strategy was
WOTE (W rite O nce T est E verywhere) for any
application developed within an IDE. He showed how to create a JNLP of
a web application and deploy on GlassFish Web Stack. Some of the common
mistakes like local filesystem URLs and database URLs can be easily
diagnosed by testing the application using multiple Virtual Box images.
Roger
Brinkley 's talk on Mobile
and Embedded is always fun. He
basically
talked about updates happened within that community in past one year. I
caught up only during the last part where he showed a demo of Sensor Motor
Gloves created by the community, the video is available below:
Fabiane 's
talk on Continuous Integration with Hudson showed
how to setup and configure Hudson. The cool part was the sunspot integration
where a build failure lights up the LEDs on a sunspot device.
Pat Patterson 's
talk on "Securing RESTful Web services using Open SSO" gave an
overview of the Open SSO community. He then explained the purpose of
OAuth and how it's integrated in OpenSSO using Jersey extensions.
Met Campus Ambassadors from Porto Alegre and Sao Paolo which is always
refreshing.
Talked to Vinicius Senger who is a Java EE architect and runs supercrud.com . This
website allows you to create an online application domain model and
then generate templates for different technologies such as Java Server
Faces, JPA, Spring/Hibernate, and others. The website is running on
GlassFish and more details on why he picked GlassFish instead of JBoss
will be available in a formal GlassFish story ,
thanks Vinicius! I recorded a short interview that will be published
this week as well.
There were other Portuguese speakers who were able to connect with the
audience much better ;-)
Bruno
and Mauricio
played an excellent role of translating from English
-> Portuguese for the local audience, thanks!
The day ended with a great pizza party with interesting toppings like
corn/onion, banana, chocolate and others too :)
Here are some pictures from the past couple of days:
And the evolving album:
See you tomorrow morning at 9am/40T in "Creating Quick and Powerful Web
Applications with MySQL, GlassFish, and NetBeans/Eclipse" talk at FISL .
Technorati: conf
brazil
fisl javali glassfish
GlassFish Fans in Minnesota
Posted by arungupta on June 19, 2009 at 12:45 PM | Permalink
| Comments (0)
I received the following photographs from a GlassFish
Fan (aka Ben Leadholm) in Minnesota.
And here is a picture of his daughter, Rachel, sporting the fancy GlassFish tattoo:
Thanks Ben and Rachel for promoting/using GlassFish and sharing the
pictures!
Do you have any similar pictures ? Send me an email arun dot gupta at
sun dot com and will be happy to share them with others.
The GlassFish number
plates and Tattoos (and much more) were distributed at the recently
concluded JavaOne 2009 .
Technorati: conf
javaone
glassfish
minnesota
TOTD #85: Getting Started with Django Applications on GlassFish v3
Posted by arungupta on June 18, 2009 at 12:15 PM | Permalink
| Comments (0)
GlassFish v3 is an extensible App server. Basically the core App server
functionality can be easily extended using add-ons such as an OSGi
module. This allows to keep the core light-weight and install the
required features on demand. The add-ons can be easily installed using
the Update
Center . The what/why/how about extensibility is described in
the GlassFish
v3 Extensibility One-pager .
GlassFish v3 provides support for Dynamic Languages and Web Frameworks
such as Ruby-on-Rails, Groovy/Grails, and Python/Django using this
extensibility. This blog has published multiple tips on using
Ruby-on-Rails at rubyonrails+totd
and a few tips on Groovy/Grails at grails+totd .
This blog will explain how to get started with deploying Python /Django
applications on GlassFish
v3 Preview . The blog will use Jython interpreter
which is the Java implemention of Python.
Vivek already blogged about the detailed
instructions and this blog shows how to run the pre-bundled
samples.
Download GlassFish
v3 Preview .
Install Jython 2.5
Download Jython 2.5 from here .
Install as:
java -jar ~/Downloads/jython_installer-2.5.0.jar
Choose the default options (pick your directory) as shown below:
and click on "Next" to start the installation process.
As mentioned in Django
on Jython wiki , create the following aliases:
alias
jython25=~/tools/jython2.5.0/bin/jython
alias django-admin-jy="jython25
~/tools/jython2.5.0/bin/django-admin.py"
Invoking the command "jython25" from the installation
directory shows the Jython interpreter as:
~/tools/jython/jython2.5rc4 >jython25
Jython 2.5rc4 (Release_2_5rc4:6470, Jun 8 2009, 13:23:16)
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_13
Type "help", "copyright", "credits" or "license" for more information.
>>>
Install Django
Download Django 1.0.2 from here .
Install Django 1.0.2 as:
~/tools >tar xzvf
~/Downloads/Django-1.0.2-final.tar.gz
Django-1.0.2-final/
Django-1.0.2-final/AUTHORS
Django-1.0.2-final/django/
. . .
Django-1.0.2-final/scripts/rpm-install.sh
Django-1.0.2-final/setup.cfg
Django-1.0.2-final/setup.py
~/tools/Django-1.0.2-final >jython25
setup.py install
running install
running build
running build_py
. . .
running install_egg_info
Writing
/Users/arungupta/tools/jython/jython2.5.0/Lib/site-packages/Django-1.0.2_final-py2.5.egg-info
Install Jython container for GlassFish
Start GlassFish
v3 Preview Update Center using the following command:
~/tools/glassfish/v3/preview/glassfishv3/bin
>./updatetool
to see the screen as:
Select "GlassFish v3 Jython Container" and click on
"Install", "Accept" the license and complete the installation. Close
the Update Center window. This installs Jython Container OSGi module
and Grizzly Adapter JARs in the "glassfish/modules" directory.
Start and configure GlassFish
Start GlassFish as:
~/tools/glassfish/v3/preview/glassfishv3/glassfish
>./bin/asadmin
start-domain
Configure Jython in GlassFish as:
~/tools/glassfish/v3/preview/glassfishv3/glassfish
>./bin/asadmin
create-jvm-options -Djython.home=/Users/arungupta/tools/jython2.5.0
created 1 option(s)
Command create-jvm-options executed successfully.
Make sure to specify the directory where Jython is installed.
Deploy the samples bundled with the Django installation as:
~/tools/Django-1.0.2-final/examples >~/tools/glassfish/v3/preview/glassfishv3/glassfish/bin/asadmin
deploy .
Command deploy executed successfully.
and now they are accessible at "http://localhost:8080/examples/" and
shown as:
Make sure to specify the end "/" otherwise the context root is not
resolved correctly and none of the links will work.
Click on "Hello World (HTML)" to see the output as:
And click on "Displaying request metadata" to see output as:
The same sample can, of course, run using the built-in development
server as:
~/tools/Django-1.0.2-final/examples >jython25 manage.py runserver
Validating models...
0 errors found
Django version 1.0.2 final, using settings 'examples.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
and then accessible at "http://localhost:8000" as:
More details are available in Django
Tutorial . The subsequent blogs will provide more detailed
samples.
If you are using GlassFish v2 then Django applications can be deployed
as a WAR file as explained here .
Please leave suggestions on other TOTD (Tip Of The Day) that
you'd like to see.
A complete archive of all the tips is available here .
Technorati: totd
glassfish
v3 django python
GlassFish swimming to FISL, Brazil
Posted by arungupta on June 17, 2009 at 12:56 PM | Permalink
| Comments (0)
FISL stands for "Forum Internacional Software Livre" in
the Portuguese language and means "International Free Software Forum"
in the English language. The punch line is "A technologia que liberta"
and means "The technology that liberates".
This is the biggest event about free software in America and was
attended by
7417 participants in 2008.
Just like "Freedom of Speech" is a basic human right, "Freedom of
Software" is a basic right for the technology evolution. GlassFish
gives you the freedom:
To Pick your own framework: Java EE, Ruby-on-Rails,
Python/Django,
Groovy/Grails, or any other
Choose your IDE: NetBeans ,
Eclipse , IntelliJ and
others .
Over properietary Application Servers by providing highly
reliable and production quality features like
Clustering/Load
balancing
Secure, Reliable, and Transactional, and
.NET-interoperable
Web services stack (Metro)
Easy-to-use web-based administration
console along with a powerful CLI
in an open source world.
Offers dual open-source license (CDDL or GPL v2 w/ CPE)
Similarly NetBeans allows you to create Java, Ruby, Python, Groovy,
PHP, C/C++, JavaScript, Java EE, Mobile, REST/SOAP, and a variety of
applications. Eclipse also provides an open development platform
comprised of extensible frameworks, tools and runtimes for building,
deploying and managing software across the lifecycle. MySQL is the world's most
popular open source database.
Together, GlassFish, NetBeans/Eclipse, and MySQL liberates you from the
vendor lock-in
by offering you a compelling choice.
At FISL 10 ,
learn how GlassFish ,
NetBeans /Eclipse , and MySQL
provide a powerful feature-rich yet easy to use platform for
developing/deploying
your web applications. The complete details about the session are
available here .
I plan to show multiple demos during the talk that you may find useful
in your regular work.
Where ? Porto Alegre, Brazil
When ? Jun 24-27, 2009
Click on the map below for coordinates of the venue:
Join the Facebook
Group or follow on Twitter
@fisl10 .
Close to 6000 attendees have registered for FISL so far and am
definitely
looking forward to feel/enjoy the Brazilian spirit.
To Brazil, Capirinhas, Guaranas, Churascarias, Beaches ... La
La La La La
La La La La La La La La La La La La La La La La La La La
Drop a comment if
you are interested in a meal or run together :)
Technorati: conf
glassfish
netbeans
eclipse
mysql
fisl brazil
TOTD #84: Using Apache + mod_proxy_balancer to load balance Ruby-on-Rails running on GlassFish
Posted by arungupta on June 17, 2009 at 11:06 AM | Permalink
| Comments (0)
TOTD
#81 explained how to install/configure nginx for
load-balancing/front-ending a cluster of Rails application running on GlassFish
Gem . Another popular approach in the Rails community is to
use Apache HTTPD
+ mod_proxy_balancer .
A user asked the exact details of this
setup on the GlassFish
Gem Forum . This T ip
O f T he D ay (TOTD) will
clearly explain the steps.
Create a simple Rails scaffold and run this application
using GlassFish Gem on 3 separate ports as explained in TOTD
#81 .
Setup and configure HTTPD and mod_proxy_balancer
Setup and install Apache HTTPD as explained here .
I believe mod_proxy_balancer
and other related modules comes pre-bundled with HTTPD, at least that's
what I observed with Mac OS X 10.5.7. Make sure that the
"mod_proxy_balancer" module is enabled by verifying the following line
is uncommented in "/etc/apache2/httpd.conf":
LoadModule proxy_balancer_module
libexec/apache2/mod_proxy_balancer.so
Please note another similar file exists in "/etc/httpd/httpd.conf" but
ignore that one.
Setup a mod_proxy_balancer cluster by adding the
following fragment in "httpd.conf" as:
<Proxy balancer://glassfishgem>
BalancerMember http://localhost:3000
BalancerMember http://localhost:3001
BalancerMember http://localhost:3002
</Proxy>
The port numbers must exactly match with those used in the first step.
Specify the ProxyPass directives
to map the cluster to a local path as:
ProxyPass / balancer://glassfishgem/
CustomLog /var/log/glassfishgem.log/apache_access_log combined
The "/" at the end of "balancer://glassfishgem" is very important to
ensure that all the files are resolved correctly.
Optionally, the following directive can be added to view
the access log:
CustomLog
/var/log/glassfishgem.log/apache_access_log combined
Make sure to create
the directory specified in "CustomLog" directive.
Now the application is accessible at
"http://localhost/runlogs". If a new GlassFish instance is started then
update the <Proxy> directive and restart your HTTPD as
"sudo httpd -k restart". Dynamic update of BalancerMembers can be
configured as explained here .
TOTD
#81 started the Rails application in root context. You can
alternatively start the application in a non-root context as:
~/tools/jruby/rails/runner >../../bin/jruby -S glassfish -e
production -c myapp
Starting GlassFish server at: 10.0.177.178:3000 in production
environment...
Writing log messages to:
/Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.
. . .
~/tools/jruby/rails/runner >../../bin/jruby
-S glassfish -e production -c myapp -p 3001
Starting GlassFish server at: 10.0.177.178:3001 in production
environment...
Writing log messages to:
/Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.
. . .
~/tools/jruby/rails/runner >../../bin/jruby
-S glassfish -e production -c myapp -p 3002
Starting GlassFish server at: 10.0.177.178:3002 in production
environment...
Writing log messages to:
/Users/arungupta/tools/jruby-1.3.0/rails/runner/log/production.log.
Press Ctrl+C to stop.
and then the ProxyPass directive will change to:
ProxyPass /myapp/
balancer://glassfishgem/myapp/
The changes are highlighted in bold. And the application is now
accessible at "http://localhost/myapp/runlogs".
After discussing on Apache
HTTP Server forum , the BalancerMember host/port
can be printd in the log file using a custom log format. So add the
following log format to "/etc/apache2/httpd.conf":
LogFormat "%h %l %u %t \"%r\" %>s %b
\"%{Referer}i\" \"%{User-agent}i\"
\"%{BALANCER_WORKER_NAME}e\"" custom
And change the format from the default "combined" to the newly defined
"custom" format as:
CustomLog /var/log/glassfishgem.com/apache_access_log
custom
Three subsequent invocations of "http://localhost/runlogs" then prints
the following log entries:
::1 - - [17/Jun/2009:10:53:53 -0700] "GET /runlogs
HTTP/1.1" 304 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5;
en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
"http://localhost:3002"
::1 - - [17/Jun/2009:10:54:04 -0700] "GET /runlogs HTTP/1.1" 200 621
"-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11" "http://localhost:3000"
::1 - - [17/Jun/2009:10:54:05 -0700] "GET /runlogs HTTP/1.1" 304 - "-"
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.11)
Gecko/2009060214 Firefox/3.0.11" "http://localhost:3001"
As evident from the last fragment of each log line, the load is
distributed amongst three GlassFish Gem instances. More details on load
balancer algorithm are available here .
Feel free to drop a comment on this blog if you are using GlassFish in
production for your Rails applications. Several stories are already
available at rubyonrails+glassfish+stories .
Technorati: glassfish
rubyonrails
apache
httpd
mod_proxy_balancer
loadbalancing
clustering
GlassFish at Eclipse Demo Camps Galileo 2009 - Jun 17th
Posted by arungupta on June 16, 2009 at 05:26 PM | Permalink
| Comments (2)
What is an Eclipse
Demo Camp ?
The Eclipse
DemoCamps are an opportunity to showcase all of the cool interesting
technology being built by the Eclipse community. They are also an
opportunity for you to meet Eclipse enthusiasts in your city.
The GlassFish
team will showcase the seamless integration with
Eclipse. Several blog entries are already available at glassfish+eclipse .
Do you know:
GlassFish
Tools Bundle for Eclipse provide Eclipse 3.4.2 with Java EE
support, GlassFish v 2.1 + GlassFish v3 pre-registered/configured, with
commercial support
GlassFish v3 Preview can be added
Screencast
#28 shows how develop/debug a web application using Eclipse
and GlassFish
TOTD
#66 shows how to install GlassFish plugin in an existing
Eclipse install
Eclipse
Galileo can be used for GlassFish development/deployment, use
"http://ajax.dev.java.net/eclipse" as the udpate site.
Meet us in person and hear the glory:
When ? Jun 17th, 7:30pm - 9:30pm
Where ? Oracle Headquarters, Redwood Shores
Complete details here .
Technorati: conf
glassfish
eclipse
democamp
Cognizant likes Simplicity, Easy management, and Lightweightness of GlassFish
Posted by arungupta on June 16, 2009 at 05:25 PM | Permalink
| Comments (0)
Cognizant
is system integrator combining onsite/offshore delivery model to
achieve customer satisfaction. They've started using GlassFish within
their internal "Cognizant Java Community" and also recommeding it to
their clients as opposed to "established App Servers".
Why GlassFish ? Because of its "Simplicity, Easy management, and
Lightweightness". And they are not disappointed at all.
Learn more about it in this video:
Thanks to Dr B V Kumar for the quick story! Check out
other GlassFish
Production Stories .
Technorati: conf
javaone
sanfrancisco
glassfish
stories
OKTECH - Hungarian consulting company using GlassFish for 4 years
Posted by arungupta on June 16, 2009 at 05:24 PM | Permalink
| Comments (0)
OKTECH
is a Hungarian consuting company and one of the
earliest adopters of GlassFish .
They use it for their internal company related information and for
external production with US business as well.
Why GlassFish ? Because its "Open source, pretty good quality, and
performs well". One word describes NetBeans
and GlassFish integration
for them: "Perfect".
Learn more about it in this video:
Thanks to Istvaan Soos for the quick story! Check out other GlassFish Production Stories .
Technorati: conf
javaone
sanfrancisco
glassfish
netbeans
stories
University of Utah - Ported 60 applications from Weblogic to GlassFish
Posted by arungupta on June 16, 2009 at 05:23 PM | Permalink
| Comments (0)
The University of
Utah ported 60 applications from Weblogic to GlassFish and very
happy with it. They like the clustering and failover capability,
integrated NetBeans
development environment, and are using EJBs, Java Server Faces and a
slew of other technologies.
Learn more about it in this video:
Thanks to Tim Richardson for the quick story! Check out other GlassFish Production Stories .
Technorati: conf
javaone
sanfrancisco
university
utah
glassfish netbeans
stories
OPIN Systems - Financial Application using JRuby-on-Rails on GlassFish
Posted by arungupta on June 16, 2009 at 05:22 PM | Permalink
| Comments (0)
OPIN Systems
has chosen JRuby , Rails , and GlassFish for a
customer-facing financial
application. Why ? "Easy to setup Rails application and add more
intense logic in JRuby calls"
Learn more about it in this video:
Thanks to Ben Leadholm for the quick story! Check out other GlassFish Production Stories .
Check out Ben's
"Dude,
Where's my pass ? " entry:
Read several other Rails/GlassFish
success stories .
Technorati: conf
javaone
sanfrancisco
glassfish
rubyonrails
stories
Fundamo: Call Banking System using Sun "all the way through", including GlassFish
Posted by arungupta on June 16, 2009 at 05:21 PM | Permalink
| Comments (0)
Fundamo
provides a mobile financial services platform using a full Sun stack -
hardware, operating system, and GlassFish .
They found GlassFish has more features and better support than other
open source App Servers. And it's not as big as other competitors.
GlassFish is performing "very well" for them and they like easy of
use/setup and the management console.
Learn more about it in this video:
Thanks to Cedric Franz (Chief Software Architect) for the quick story!
Check out
other GlassFish
Production Stories .
Technorati: conf
javaone
sanfrancisco
glassfish
stories
AGFA Healthcare - Using GlassFish for Field Force Automation, Time Registration, SAP Integration
Posted by arungupta on June 08, 2009 at 10:27 AM | Permalink
| Comments (0)
Here are some reasons why AGFA Healthcare
choose GlassFish
for their
Field Force Automation, Time Registration and SAP integration:
100% uptime for past 1.5 years with 8 cluster nodes
GlassFish's importance in this economy
Simple and elegant administrative console
High availability, ease-of-use, and something that works
Learn about it in this video:
They recommend GlassFish for any enterprise to consider for using in
production. Thanks to John
Yeary for the quick story!
Technorati: conf
javaone
sanfrancisco
glassfish
stories
JavaOne 2009 Day 3 in Pictures
Posted by arungupta on June 04, 2009 at 11:29 PM | Permalink
| Comments (0)
And the evolving album at ...
See ya tomorrow at JavaOne Day 4!
Technorati: conf
javaone
glassfish
sanfrancisco
Garmin nuvi 200w and Canon SD 770 Winners at JavaOne GlassFish Booth - Jun 3, 2009
Posted by arungupta on June 04, 2009 at 10:49 AM | Permalink
| Comments (0)
We are giving out more prizes today in the JavaOne Pavilion!
Help us fill the survey at tinyurl.com/j1survey
and there are couple of drawings:
1pm at the GlassFish Enteprise Server Booth (#550) in the
Pavilion
8:30pm at GlassFish BoF
More details here .
Technorati: conf
glassfish
javaone
sanfrancisco
JavaOne 2009 Day 2 in Pictures
Posted by arungupta on June 04, 2009 at 09:53 AM | Permalink
| Comments (0)
Here are some pictures from JavaOne 2009 Day 2 ...
And the evolving album at ...
See ya tomorrow at JavaOne Day 4!
Technorati: conf
javaone
sanfrancisco
GlassFish Survey for a chance to win Canon SD 770, Garmin nuvi 200w, iPod Touch, and a Wii
Posted by arungupta on June 03, 2009 at 10:18 AM | Permalink
| Comments (0)
Would you like to win any of the following gadgets ?
A 16 GB iPod Touch
Garmin nuvi 200w
Canon SD 770 s
Wii Game System
It's really simple!
Help us fill the survey at tinyurl.com/j1survey
and show up at the "GlassFish Enterprise Server" booth (#550) in the
JavaOne pavilion on any of
the following slots:
Wednesday, Jun 3rd, 4pm
Thursday, Jun 4th, 1pm
Thursday, 8:30pm, "Meet the GlassFish Team"
Birds-of-Feather session, Esplanade 301
There are multiple drawings on each slot and you may be the lucky one :)
The survey is short and simple. You can fill up the survey irrespective
of whether you are using GlassFish or not and still eligible.
And Sun employees are not eligible to win, including me ;)
Technorati: conf
javaone
sanfrancisco
glassfish
JavaOne 2009 Day 1 In Pictures
Posted by arungupta on June 03, 2009 at 12:34 AM | Permalink
| Comments (0)
Here are some pictures from JavaOne 2009 Day 1 ...
And the evolving album at ...
See ya tomorrow at JavaOne Day 2!
Technorati: conf
javaone
sanfrancisco
Community One West 2009 - In Pictures
Posted by arungupta on June 01, 2009 at 08:57 PM | Permalink
| Comments (0)
Here are some pictures from the Community
One West 2009 earlier today ...
And the evolving album at ...
See ya tomorrow at JavaOne!
Technorati: conf
javaone
sanfrancisco
communityone
GlassFish Unconference and Thirsty Bear Party - In Pictures
Posted by arungupta on May 31, 2009 at 11:09 PM | Permalink
| Comments (0)
Here are some pictures from the GlassFish
Unconference concluded earlier today ...
And then the pictures from Thirsty
Bear party ...
And the evolving album at ...
See ya tomorrow at Community
One !
Technorati: conf
javaone
sanfrancisco
glassfish
thirstybear
unconference
JVB #17: Davis Nguyen on GlassFish at JavaOne 2009
Posted by arungupta on May 29, 2009 at 09:22 AM | Permalink
| Comments (3)
Learn what Davis Nguyen will be doing at JavaOne 2009 .
His hands-on-lab details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #16: Sivakumar Thyagarajan on GlassFish at JavaOne 2009
Posted by arungupta on May 29, 2009 at 09:21 AM | Permalink
| Comments (0)
Learn what Sivakumar
Thyagarajan will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #15: Srinivas Bhimisetty on GlassFish at JavaOne 2009
Posted by arungupta on May 29, 2009 at 09:20 AM | Permalink
| Comments (0)
Learn what Srinivas Bhimisetty will be doing at JavaOne 2009 .
His hands-on-lab details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #14: Sreeram Duvur on GlassFish at JavaOne 2009
Posted by arungupta on May 29, 2009 at 09:18 AM | Permalink
| Comments (0)
Learn what Sreeram
Duvur will be doing at JavaOne 2009 .
His panel details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #10: Sreenivas Munnangi on GlassFish at JavaOne 2009
Posted by arungupta on May 28, 2009 at 06:41 AM | Permalink
| Comments (0)
Learn what Sreenivas
Munnagi will be doing at JavaOne 2009 .
See if you can answer Sreeni's question. His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #13: Jagadesh Munta on GlassFish at JavaOne 2009
Posted by arungupta on May 28, 2009 at 06:38 AM | Permalink
| Comments (0)
Learn what Jagadesh
Munta will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #12: Judy Tang on GlassFish at JavaOne 2009
Posted by arungupta on May 28, 2009 at 06:38 AM | Permalink
| Comments (0)
Learn what Judy Tang
will be doing at JavaOne
2009 .
Her session details are available here .
Don't forget to look at the exciting list of goodies Judy's team is
going to hand out :)
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #11: Prashanth Abbagani on GlassFish at JavaOne 2009
Posted by arungupta on May 27, 2009 at 11:18 AM | Permalink
| Comments (0)
Learn what Prashanth
Abbagani will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #09: Rajiv Mordani on GlassFish at JavaOne 2009
Posted by arungupta on May 27, 2009 at 11:16 AM | Permalink
| Comments (0)
Learn what Rajiv
Mordani will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #08: Vivek Pandey on GlassFish at JavaOne 2009
Posted by arungupta on May 26, 2009 at 04:55 PM | Permalink
| Comments (0)
Learn what Vivek
Pandey will be doing at JavaOne 2009 .
His session details are available here .
Get ready to loose something at JavaOne - listen all the way to the end!
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #07: Jacob Kessler on GlassFish at JavaOne 2009
Posted by arungupta on May 26, 2009 at 04:55 PM | Permalink
| Comments (0)
Learn what Jacob
Kessler will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #06: Jiandong Guo on GlassFish at JavaOne 2009
Posted by arungupta on May 26, 2009 at 04:53 PM | Permalink
| Comments (0)
Learn what Jiandong
Guo will be doing at JavaOne 2009 .
His session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #05: Bhakti Mehta on GlassFish at JavaOne 2009
Posted by arungupta on May 25, 2009 at 09:44 PM | Permalink
| Comments (0)
Learn what Bhakti
Mehta will be doing at JavaOne 2009 .
Her session details are available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #04: Kohsuke Kawaguchi on GlassFish at JavaOne 2009
Posted by arungupta on May 25, 2009 at 09:40 PM | Permalink
| Comments (0)
Learn what Kohsuke
Kawaguchi , aka "Mr Hudson", will be doing at JavaOne 2009 .
Hear a fun and stress-buster tip from Kohsuke! His session details are
available here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #03: Jim Driscoll on GlassFish at JavaOne 2009
Posted by arungupta on May 22, 2009 at 04:05 PM | Permalink
| Comments (0)
Learn what Jim
Driscoll , an 11-year JavaOne veteran, will be doing at JavaOne 2009 .
And hear one of the most important tip from Jim about JavaOne. It is
certainly re-enforced multiple times during the general
session keynotes :)
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
JVB #02: Jitendra Kotamraju on GlassFish at JavaOne 2009
Posted by arungupta on May 22, 2009 at 06:09 AM | Permalink
| Comments (0)
Learn what Jitendra
Kotamraju will be doing at JavaOne 2009 .
Jitu's session is listed here .
All previous entries are tagged javaone+vidblog .
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
TOTD #82: Eclipse Tools Bundle for GlassFish 1.0 - Now Available!
Posted by arungupta on May 22, 2009 at 06:07 AM | Permalink
| Comments (0)
The GlassFish
Tools Bundle for Eclipse 1.0 is now available .
An earlier
blog entry explains how to get started using this bundle.
If you used an earlier version (0.99.x) of this bundle, then an upgrade
is not supported. However backwards compatibility will be maintained
going forward!
Here are some pointers to get you started:
Enjoy and send us feedback at users@glassfishplugins.dev.java.net .
Technorati: glassfish
eclipse
JVB #01: Roberto Chinnici on GlassFish at JavaOne 2009
Posted by arungupta on May 20, 2009 at 04:58 PM | Permalink
| Comments (0)
This blog marks the beginning of a new series highlighting JavaOne
speakers from the GlassFish
Portfolio team.
In this first episode, learn what Roberto Chinnici will be doing at JavaOne 2009 .
Listen all the way to the end for a tip from a JavaOne veteran. The
complete list of sessions where Roberto will be speaking is
available here .
And for the curious minds, "JVB" stands for "JavaOne Video Blog". And
so all the related entries are tagged javaone+vidblog .
If you are a speaker listed at GlassFish
Portfolio at JavaOne 2009 then I'll reach out to you for a
similar recording :)
Technorati: conf
javaone
vidblog
sanfrancisco
glassfish
portfolio
TOTD #81: Getting Started with Servlet 3.0 and EJB 3.1 in Java EE 6 using NetBeans 6.7
Posted by arungupta on May 19, 2009 at 11:00 AM | Permalink
| Comments (0)
EJB 3.1 (JSR
318 ) and Servlet 3.0 (JSR 315 )
are the two new JSRs in Java EE 6 (JSR 316 ).
The EJB 3.1 specification provides multiple new features such as WAR
packaging , Optional
Local Business Interfaces , EJB.lite, Portable
Global JNDI Names , Singleton
Session Beans
(Container-managed and Bean-managed concurrency), Application
Initialization and Shutdown events, Timer Service enhancements,
Simple/Light-weight Asynchrony, and many other features defined in the specification .
The
Servlet 3.0 specification is an update to Servlet 2.5 and focuses on
ease-of-use. It also adds several new features such as "web.xml"
free
deployment (mostly), Dynamic Registration of
servlets/filters,
Pluggability
of frameworks using "web-fragment.xml" , Asynchronous API,
Security
enhancements (Constraints via annotations, programmatic
container authentication and logout), and several other miscellaneous
additions like default error page, file upload, etc.
GlassFish v3
provides the most complete implementation of EJB 3.1 and Servlet 3.0
along with other Java EE 6 specifications. This T ip O f T he D ay (TOTD) will show
how to create a simple EJB and invoke it from a Servlet, all in a
deployment-descriptor free way.
Enable support for v3 Preview in NetBeans
Using NetBeans
6.7 latest nightly , enable support for recent GlassFish v3
builds either using the command-line
switch or the
marker module .
Download and unzip GlassFish
v3 Preview 47b . The latest promoted builds are always
available here .
In the "Services" tab, right-click on "Servers" and click
on "Add Server". Select "GlassFish v3" as shown below:
and click on "Next".
Specify location of the previously unzipped bundle, click
on "Next >", and press "Finish".
Create
a new Web project by right-click in the "Projects" pane, select "New
Project", choose "Java Web" and "Web Application" as
categories
and projects.
Click on "Next >", choose "Java EE 5" as the
Java EE version and click on "Finish". A future version of NetBeans
will will provide direct support for Java EE 6.
Add a POJO-based EJB
Right-click on "Source Packages" and select "New", "Java
Class..." as shown below:
Give the class name as "HelloEJB" and package as "server" as shown
below:
and click on "Finish".
Add
"@Stateless" class-level annotation and press Shift+Command+I (default
shortcut) to fix the imports. This annotation comes from the
"javax.ejb" package.
Add the following method:
public String
sayHello(String name) {
return "Hello " + name;
}
to
the class. And can you believe it, that's your complete EJB ready to be
deployed and that too in a WAR file - the beauty of Java EE 6. The
complete class looks like:
package server;
import javax.ejb.Stateless;
/**
* @author arungupta
*/
@Stateless
public class HelloEJB {
public String sayHello(String name) {
return "Hello " + name;
}
}
Add a Servlet to invoke this EJB
Add a new class "HelloServlet" in the "server" package as
explained above.
Add
"@WebServlet" class-level annotation and Shift+Command+I to fix the
imports. This annotation comes from the "javax.servlet.annotation"
package. And specify a URL pattern as:
@WebServlet(urlPatterns="/hello")
According to the Servlet3 specification, the contract is
inherited from the "javax.servlet.http.HttpServlet" interface. So add:
to the class.
Inject a local EJB reference using the code:
Override the GET method as:
@Override
public void doGet(HttpServletRequest
req, HttpServletResponse res) throws IOException {
res.setContentType("text/html");
res.getOutputStream().print("<h1>Hosted at: " +
req.getContextPath() + "</h1>");
res.getOutputStream().print("<h2>" +
ejbClient.sayHello("Duke") +
"</h2>");
}
and again Shift+Command+I to fix the imports. The complete class looks
like:
package server;
import java.io.IOException;
import javax.ejb.EJB;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author arungupta
*/
@WebServlet(urlPatterns="/hello")
public class HelloServlet extends HttpServlet {
@EJB HelloEJB ejbClient;
@Override
public void doGet(HttpServletRequest
req, HttpServletResponse res) throws IOException {
res.setContentType("text/html");
res.getOutputStream().print("<h1>Hosted at: " +
req.getContextPath() + "</h1>");
res.getOutputStream().print("<h2>" +
ejbClient.sayHello("Duke") + "</h2>");
}
}
That
completes the project creation. Now lets make our application
deployment descriptor free by expanding "WEB-INF" directory and
deleting "sun-web.xml" and "web.xml". Java EE 6 makes the deployment
descriptors optional by introducing equivalent annotations.
Lets run the project by right-click on the
project and select "Run". The web application is deployed to GlassFish
v3 Preview 47b and "http://localhost:8080/WebApplication1" shows the
default "index.jsp" created by the IDE.
Our servlet is accessible at
"http://localhost:8080/WebApplication1/hello" and shows the output as:
The directory of the generated WAR file looks like:
As evident "WEB-INF/classes" has only two POJO classes and yet this is
a Java EE 6 application.
So we created a trivial Java EE 6 application using Servlet 3 and EJB
3.1 APIs and deployed successfully on GlassFish v3 Preview 47b using
NetBeans 6.7.
Please leave suggestions on other TOTD (Tip Of The Day) that
you'd like to see.
A complete archive of all the tips is available here .
Technorati: totd
glassfish
v3 javaee6 servlet3
ejb3.1
netbeans
Ruby-on-Rails and Ramaze production deployments on GlassFish
Posted by arungupta on May 15, 2009 at 10:00 AM | Permalink
| Comments (0)
Published three new JRuby/GlassFish production deployment stories
in as many days:
Who ?
Recipe
Why GlassFish ?
JRuby
+ Rails + GlassFish v2 + MySQL + Apache Web Server + memcached
The
GlassFish processes have been among the most stable of our deployment.
and
(The) GlassFish
team has been extremely helpful along the way with tuning and
diagnosing performance issues.
JRuby
+ Rails + GlassFish v2 + MySQL + Solaris Zones
GlassFish
works and provides useful error messages.
Recipe:
JRuby + Ramaze + GlassFish v2 + MySQL/H2
What's essential for me is that
I spend my time doing development, not sysadmin work, so I settle for a
working solution. I've had no trouble for a few
months now, and redeploy using simple scripts.
Other similar JRuby stories are available at jruby+stories .
Other GlassFish stories are available here .
Technorati: jruby
rubyonrails
ramaze
stories
glassfish
GlassFish Portfolio at JavaOne 2009 - 16 C1 sessions, 23 Technical Sessions, 17 Birds-of-Feather, 7 Hands-on-Labs, and much more
Posted by arungupta on May 14, 2009 at 05:54 AM | Permalink
| Comments (0)
Here is the list of Technical Sessions, Birds-of-Feather sessions, and
Hands-on Labs delivered by the GlassFish
Portfolio team at JavaOne
2009 .
GlassFish
Unconference (Sun, May 31)
Thirst
Bear Party (Sun, May 31)
Community One
(Mon, Jun 1-2)
S304781
Sailfin: Open Possibilities in
Communications
Prasad Subramanian
S303988
FishCAT,
or How the Community Helps Improve Software Quality
Judy
Tang, Wouter van Reeven
S307894
Sun
GlassFishâ„¢ Portfolio: Where Sun's Application Platform Is Going
Eduardo
Pelegri-Llopart
S305138
Metro
Web Services, NetBeansâ„¢ IDE, GlassFishâ„¢ Application Server, and OpenSSO
in Action with Amazon WS, Azure, and Office
Harold
Carr
S304228
Developing
RESTful Web Services with JAX-RS and Jersey
Marc
Hadley, Paul Sandoz
S304319
Social
Networking with JavaServerâ„¢ Faces 2.0 Technology, Portlet 2.0, and AJAX
Push
Ed
Burns, Neil Griffin
S304941
Web
Security in the Javaâ„¢ Servlet 3.0 API and GlassFishâ„¢ Application Server
v3
Shing
Wai Chan, Ronald Monzillo
S309048
Using
Eclipse to Develop for the GlassFishâ„¢ Application Server
Davis
Nguyen, Rochelle Raccah
S311152
Sun
GlassFishâ„¢ Mobility Platform Open-Source Project
Hans
Hrasna
S311153
Use
GlassFishâ„¢ v3 Application Server Extensions to Create Your Own
Application Server
Sreenivas
Munnangi
S311290
JRuby
Rails Workshop
Arun
Gupta, Jacob Kessler, Vivek Pandey, Nick Sieger
S311295
Open-Source
Web Stack
Ludovic
Champenois, Murthy Chintalapati, Basant Kukreja, Sriram Natarajan,
Brian Overstreet, Jeff Trawick; Jyri Virkki
S311375
Ease
of Use with Sun GlassFishâ„¢ Web Stack
Jeff
Trawick
S311377
Sun
GlassFishâ„¢ Web Stack Enterprise Manager: A Simple Yet Powerful Tool for
Monitoring AMP Deployments
Praveen
Chandrasekharan
S311579
Demoing
Nonintrusive and Lightweight Monitoring of Javaâ„¢ Technology-Based
Enterprise Applications
Prashanth
Abbagani
S311380
Lightning
Talks, Part 2
Praveen
Chandrasekharan, Ari Zilka, Sreenivas Munnangi, Jeff Trawick, Rajeshwar
Patil
Technical Sessions
(Tue - Fri, Jun 2-5)
TS-3790
Javaâ„¢ Servlet 3.0: Empowering Your
Web Applications With Async, Extensibility and More
Jan
Luehe, Rajiv Mordani, Gregg Wilkins
TS-4012
Pragmatic
Identity 2.0: Simple, Open, Identity Services Using REST
Pat
Patterson, Ron Ten-Hove
TS-4222
Asynchronous
I/O Tricks and Tips
Jean-François
Arcand, Alan Bateman
TS-4402
Metro
Web Services Security Usage Scenarios
Harold
Carr, Jiandong Guo
TS-4605
Enterprise
JavaBeansâ„¢ 3.1 (EJBâ„¢ 3.1) Technology Overview
Kenneth
Saks, Marina Vatkina
TS-4617
Using
Javaâ„¢ Technology in the Windows Azure Cloud via the Metro Web Services
Stack
Harold
Carr, Clemens Vasters
TS-4640
A
Complete Tour of the JavaServerâ„¢ Faces 2.0 Platform
Ed
Burns, Roger Kitain
TS-4733
Javaâ„¢
Platform, Enterprise Edition Technology-Based Connector Architecture 1.6
Binod
Pg, Sivakumar Thyagarajan
TS-4839
Enterprise
Integration Patterns In Practice
Andreas
Egloff, Bruce Snyder
TS-4856
GlassFishâ„¢ESB:
Get Your Apps on the Bus
Sijut
Biswas, Frank Kieviet
TS-4875
Developing
RESTful Web Services with the Javaâ„¢ API for RESTful Web Services
(JAX-RS)
Marc
Hadley, Paul Sandoz
TS-4877
Sun
GlassFishâ„¢ Mobility Platform
Satish
Hemachandran, Hans Hrasna
TS-4883
Coding
REST and SOAP Together
Martin
Grebac, Jakub Podlesak
TS-4910
Balancing
Javaâ„¢ Message Service Performance with Reliability
Robert
Davies, Gordon Sivewright,
TS-4921
Dynamic
Languages Powered by GlassFishâ„¢ Application Server v3
Jacob
Kessler, Vivek Pandey
TS-4923
Javaâ„¢
Platform, Enterprise Edition 6 with Extensible GlassFishâ„¢ Application
Server V3
Jerome
Dochez
TS-4929
Powering
Next Generation Media Services and Convergence With Java EEâ„¢
Sankara
Rao Bhogi, Binod Pg
TS-5055
Javaâ„¢
Platform, Enterprise Edition 5 and 6: Eclipse and NetBeansâ„¢ IDE Tooling
Offering
Ludovic
Champenois, Phillipe Ombredanne
TS-5295
Designing
and Building Security into REST Applications
Paul
Bryan, Sean Brydon, Aravindan Ranganathan
TS-5214
Javaâ„¢
Persistence API 2.0: What's New ?
Linda
DeMichiel, Anil Gaur
TS-5301
Continuous
Integration in the Cloud with Hudson
Jesse
Glick, Kohsuke Kawaguchi
TS-5341
Rethinking
the ESB: Lessons Learned from Challenging the Limitations and Pitfalls
Andreas
Egloff, Frank Kievit
TS-6766
Real-World
Processes with WS-BPEL
Murali
Pottlapelli, Ron Ten-Hove
Birds of Feather Sessions
(Tue - Fri, Jun 2-5)
BOF-1721
Meet
the GlassFishâ„¢ Server Team
Shreedhar
Ganapathy, Abhijit Kumar
BOF-4146
Writing a JavaServerâ„¢ Faces 2.0 Component That Uses
Ajax: It's Easy! (Really, It's Easy.)
Jim
Driscoll, Ryan Lubke
BOF-4483
Javaâ„¢
Platform, Enterprise Edition 6 (Java EE 6 Platform) Community Discussion
Roberto
Chinnici, Bill Shannon
BOF-4611
Grizzly
2.0: Monster Reloaded!
Jean-François
Arcand, Oleksiy Stashok
BOF-4878
Developing
RESTful Web Services with Jersey and Javaâ„¢ API for RESTful Web Services
(JAX-RS)
Craig
McClanahan, Jakub Podlesak, Paul Sandoz
BOF-4869
JavaServerâ„¢
Faces Platform and Ajax: State of the Union
Ted
Goddard, Roger Kitain, Andy Schwartz, Alexander Smirnov
BOF-4903
A
RESTful Approach to Identity-based Web Services
Marc
Hadley, Hubert Le Van Gong
BOF-4926
JDBCâ„¢
4.1 Specification Community Discussion
Lance
Andersen, Mark Matthews
BOF-5004
OSGi
and the Enterprise Service Bus: Friend or Foe?
Keith
Babo, Kevin Conner, Andreas Egloff, Guillaume Nodet
BOF-5009
Atmosphere:
Comet for Everyone, Everywhere
Jean-François
Arcand, Paul Sandoz
BOF-5049
Scaling
the Asynchronous Web
Jean-François
Arcand, Ted Goddard
BOF-5105
Hudson
Community Meet-Up
Kohsuke
Kawaguchi
BOF-5215
The
Java Persistence 2.0 API
Linda
DeMichiel, Mitesh Meswani
BOF-5261
Web
Services in Practice
Bhakti
Mehta, Fabian Ritzmann
BOF-5275
Using
and Participating in the OpenSSO Project
Sean
Brydon, Pat Patterson, Aravindan Ranganathan
BOF-5305
Javaâ„¢
API for XML Web Services (JAX-WS) 2.2
Jitendra
Kotamraju, Rama Pulavarthi
BOF-6730
What
Is and Will Be New in OpenESB?
Sujit
Biswas, Norbert Piega, Sherry Weng
Hands-on-Labs
(Tue - Fri, Jun 2-5)
LAB-5542
Jersey: Building RESTful Web Services on the Javaâ„¢
Platform
Srinivas
Bhimisetty , Martin Matula
LAB-5546
Developing
Composite SIP Applications with Custom Application Routers
Jagadesh Munta, Sudhir Prabhu
LAB-5556
Complex
Event Processing with the GlassFishâ„¢ Application Server ESB Intelligent
Event Processor
Bing
Lu, Sang Shin
LAB-5557
Build
a RESTful Client-Server Rich Internet Application with JavaFXâ„¢
Technology and JSR 310 (Jersey)
David
Delabassee, Sebastien Stormacq
LAB-5572
Building
OSGi Plug-Ins for the GlassFishâ„¢ v3 Application Server Administration
Console
Anissa
Lam, Ken Paulsen
LAB-6264
Implementing
Enterprise Integration Patterns with GlassFish ESB and OpenESB v3
Louis
Polycarpou, Mike Somekh
LAB-6727
Web
Application Security with OpenSSO: From Simple Log-In to Single Sign-On
to Federation
Pat
Patterson, Baby Sunil, Himanshu Vijay
There are many other GlassFish related sessions that are equally
interesting as well. Let me know if any sessions by the GlassFish
Portfolio team are missing and I'll be happy to update the list. A full
searchable catalog is available here .
And then you can always meet us at the Community
One , Pavilion ,
Hallways, and near-by restaurants :)
Here are some links to follow for live updates while we are at JavaOne:
And I've been asked multiple times about my involvement with JavaOne
this year, so let me state here. I'll not show up on a general session
keynote, no technical session/BoF, and no demos. But you'll certainly
see me on the floor talking to YOU!
Also check out:
Like last
year , I'll be posting multiple pictures during the
day to capture the event. Stay tuned for updates.
Technorati: conf
javaone
sanfrancisco
glassfish
portfolio
GlassFish and Servlet 3.0 Slides from San Francisco JUG
Posted by arungupta on May 13, 2009 at 10:36 AM | Permalink
| Comments (0)
As mentioned earlier ,
Jan and I
talked about GlassFish
and Servlet
3.0 at the San
Francisco JUG yesterday night. Approximately 40 attendees and
a great Q&A session at the end made it a truly enjoying
experience.
The GlassFish slides are available here
and Servlet 3.0 slides are available here .
And did you register for JavaOne
? The GlassFish team will be there in full force and you'll be immersed
in similar talks.
Here are some pictures from around the venue and the attendees:
Technorati: conf
jug sfjug sanfrancisco
glassfish
servlet
GlassFish Whitepapers and Webcasts
Posted by arungupta on May 13, 2009 at 10:32 AM | Permalink
| Comments (0)
Here is the list of whitepapers and webcasts that have been published
so far
Webcasts
Whitepapers
The complete and updated list of papers, webcasts, and podcasts is
always available here .
Technorati: glassfish
whitepaper
webcast
Rails Conf 2009 Day 3 Trip Report
Posted by arungupta on May 06, 2009 at 10:36 PM | Permalink
| Comments (0)
Attended a great talk by Michael
Bleigh on Twitter
on Rails . He has
built a gem, TwitterAuth ,
that uses Twitter as authentication provider (OAuth or HTTP Basic)
which allows to to quickly and easily create
Twitter applications in Rails. In Michael's words "TwitterAuth makes Twitter Rails
apps stupid simple ".
The talk built Twistener - a
Twitter application in Rails that shows how many tweepl are having a
conversation about you. A hosted version of
the application is available at twisteners.heroku.com .
The slides
and end result
of the code are always helpful.
In
a post-talk conversation he mentioned that all the gems are pure Ruby.
Any body willing to re-build the application and trying using JRuby and
GlassFish ?
And then attended Rails
3: Stepping off of the Golden Path by a "morally loose,
cheese eating surrender monkey", aka Matt Aimonetti :)
What are you going to get in Rails 3 ?
Improved performance
Increased modularity
Agnosticism (choose any JS framework)
Public API
Mountable Apps
Rails 3: ORM => ActiveRecord, JavaScript => Prototype,
Templating => ERB, Testing => Test::Unit. The defaults
are exactly same as Rails 2.x.x and the idea is to provide the least
amount of changes from user perspective, yet provide a choice.
Some other key points highlighted in the talk were:
More flexible, Less opinionated
Templating engines: HAML and ERB are the big ones.
ORM: ActiveRecord, DataMapper
Adapaters: RDBMS, File Ssytem, IMAP, YAML, REST APIs,
Custom APIs
Sequel: Prepared statement, Sharding, highly customization
SQL
Use Hibernate with either ActionORM, JRuby
Ability to talk to Non RDBMS Systems; GAE, CouchDB, Redis,
Tokyo Cabinet, etc
Had
a so-so lunch buffet at a local Indian
restaurant with a
limited variety and average food. It was hot in Vegas today
(98 degrees high and 72 degrees low) and we walked to the restaurant.
An Indian buffet and a
long walk in the high temperatures is a perfect recipe for a sleepy
afternoon ;-) But it was apparently contagious cause the person sitting
next to me dozed off while I kept awake!
Anyway here are some pictures captured earlier today:
And then the complete album:
See ya next year!
Technorati: conf
railsconf
lasvegas
rubyonrails
Rails Conf 2009 Day 3 - Chris's Keynote
Posted by arungupta on May 06, 2009 at 02:32 PM | Permalink
| Comments (0)
An informal survey this morning at Rails Conf 2009
keynote showed:
40% Rails developers in startup
30% Rails developers in consulting
30% Rails developers work in internal projects
Engine Yard got a sponsor keynote slot and announced Flex - a cloud
computing platform on EC2 to host Rails applications. They also showed
one-button self-healing clusters. One of the speakers was particularly
scared (reminds me of my early days) and IRC#railsconf
had a pool of $125 to hug him on the stage :) Anyway, read more details
here .
The highlight of the morning was keynote by Chris Wanstrath (@defunkt ). I
took multiple notes during the keynote but the transcript
has
all the details. The first part of the talk has good tips on how to
create a successful blog such as blog personality, template, killer
name and a sleek design, sparse side bar, consistency and structure,
and many others.
There was a good bashing of SourceForge towards 60% in the talk. Chris
gave a suggestion to SourceForge:
They should cut their
registration process down to a single page, remove the 200 character
"please host my project" plea, be more lenient on the categorization,
suggest an open source license for you, then allow you to change any of
these things after your project has been created.
And there are other interesting ones too. Read the full text
and enjoy!
Here were some of the Q&As at the end of keynote ...
Q. What was your inspiration for github ?
A. Inspiration is coding, doing open source software all the time,
downloading patches, relative paths were getitng in the way to coding.
Source forge registration page is too long. github is very simple for
anything code related that you want to put there.
Q. You develop these interesting pieces of software, have a job, play
guitar,
create pieces of music, drum music, how you do this in one lifetime ?
A. I outsource most of it. All of us do it, I post my music and code on
the Internet, watch a lot of TV. I'm into sharing on github. Don't have
a better work ethic, just talk a lot.
Q. What do you watch on the TV ?
A. Legend of the secret
Q. Built a bunch of tools used by non-Rubyists, how can we promote Ruby
there ?
A. RubyGems is one reason I fell in love with Ruby. Remove the friction
and lower the barrier to entry.
Q. Focus github around the code/community, it helps around the people,
opposite of Source Forge/Ruby Forge
A. Github is like facebook for code development.
Technorati: conf
railsconf
git github lasvegas
rubyonrails
Rails Conf 2009 Day 2 Trip Report
Posted by arungupta on May 06, 2009 at 05:39 AM | Permalink
| Comments (0)
This is a follow up post from David's
keynote .
Attended Women
in Rails
panel discussion. The panel, Sarah
Mei , Lori
Olson , and Desi
McAdam (from L to R), had a very interesting discussion
around
the genuine problems and possible solutions of involving more women in
Rails community.
Sarah is trying to involve more women in the San Francisco Ruby
meetup . She plans to invite non-traditional audience like
those who never programmed before, other language programmers, and
similar. The details will be shared after performing the exercise for a
year. Lori started Calgary
Ruby Group . She do lot of self promotion so that younger
women feel inspired. Desi is a co-founder of devChix with the
purpose of "build a community of women developers". All the panelists
were very vocal about being visible, having a blog and twitter presence
is a good start.
Here are some random notes captured ...
Women
drop out because of kids, try to get a job and then come back with a
gap in the resume. It's difficult to get a new job at that time. Sarah
is trying to reach out to that group who have that gap in their resume.
Visbility
is important "She did that, I can do too!".
Data point: Women % in Rails community is
much less than in other development community, e.g. Java or .NET world.
Another data point: % of women is more in larger companies, not in
smaller companies. The
reason is facilities like maternity leave, training
(don't have evening hours to train themselves, can't sacrifice family
time), etc.
Real stats from 2006: Women participation in open source community is
2-3%,
20-25% in "enterprise"
Appeal from the panelist "Guys, help us, tell .NET developer that Rails
is not all
guys, spread the word.".
Here are some Q&As captured:
Q. Should
women be given free/discounted tickets to RailsConf ?
A. If women
can't pay for it, then devChix can help them. RailsConf have
helped before. It'll help if childcare is available.
Q. Why are
we only looking at CS ? Why not other areas who have the
development skills ?
A. Panel
do reach out to multiple audience and seeks help from everybody in
spreading the word. Women will be working on JavaScript and thinks she
is designer. A guy will read 3 blog entries and thinks he is developer.
There is a market salary differential between designer and developer.
Women need to be more public about their programming status.
Q. Women
won't present themselves as something they are not confident
because they'll be called upon. How do you fix it ?
A. Everybody
is learning. David's comment "I don't know everything in Rails" was
commended. Girls need to know if it's important then they can figure it
out. They are scared of messing the impression of their gender.
And of course there was a discussion on "Pr0ngate scandal":
Sarah:
Matt is not a bad guy, he made a mistake that lot of people make in
software development. If 1 out of 100 does not match the pattern of
software developer, then that "1" may not be a software developer. The
organizers of the conference did
not do anything wrong. I voted for the talk and trust the judgement of
the people. A negative feeling started developing but don't want to see
that honestly. We learned something from it. As a relatively young
community, this was bound to happen.
Lori: Not from the
presentation itself but form the community reaction to this event.
Blown
out of proportion because of the same reasons when there is a conflict
with
developers in same company. You can't argue with somebody regarding how
they feel. Can have a discussion, but argument is never going to be a
win for anyone. That's where the community reaction devolved.
Desi:
If Matt would've said "Oh Crap, I offended and wouldnt mean to offend
you.", everything would've been fine. To David: "Next time, do us a
favor and keep your mouth shut. It didn't help."
I was certainly expecting many more women to show up in the room but
there were very few. Anyway, read Desi's blog
entry about the panel. And I reached out to all three of them
for helping in any manner :)
Why JRuby on VM ?
Best memory management
Dynamic optimizations
Reliable native threads: run threads across multiple cores
Vast number of libraries
Interop with Java, Scala, Rhino, Jython, ...
Ubiquitous
Performance
Fastest production-ready Ruby implementation
Definitely faster than 1.8.6
JRuby -> Bytecode -> Native code ->
Optimizations
Future JVM Work
"invokedynamic": Build fast dynamic invocation in JVM,
JRuby support by June, allow Hotspot to do all optimizations across
Ruby calls
Multi-language VM "Da Vinci Machine", Optimized tail calls,
continuations, fixnums, value types
Threading
Only production-ready impl with real threads
Ruby thread is a normal thread that can run on multiple
cores
Simple Rails App
1 Controller/Mode/View, send 1000 reqs
80% less memory in 10 instance example, 96% for 20 instances
GlassFish
Gem, WAR-based
nginx, Apache: mod_proxy
Ruby 1.9 is 80-90% complete, IRB works, RubyGems works
FFI
Call C functions directly from Ruby
Portable unlike extensions
Who uses JRuby ?
Kenai
Gravitor
King Pong (JRuby wrapping MonkeyEngine)
Oslo's Gardermoen Airport to refuel
planes
ThoughtWorks Mingle
No cross-platform SVN libraryfor Ruby
Bundling of installation
Security (ecnrypting source code)
Memory profile
Avoiding process proliferation
mix.oracle.com
5 developers, 6 weeks for all development, 2887
LOC
Trisano: Open source infectious disease reporting system
Ease of deployment
Every enterprise on the planet run Java
Extensive project roadmap
Check out interactive Q & A from the session in the following
video fragment:
And the keynote by Tim Ferris ,
lets not talk about it ;-) I edited pictures, authored my blog, caught
up
on email/RSS during the keynote. #railconf on IRC and twitter
were way more fun! Check the live ratings .
"1" was the lowest rating that could be given anyway!
Watch
the interview on why Sea
Change Affinity picked JRuby/GlassFish.
Finally watch some of the snapshots captured today:
And then the evolving album:
Technorati: conf
railsconf
lasvegas
jruby
rubyonrails
glassfish
netbeans
Sea Change Affinity - Why JRuby/GlassFish ?
Posted by arungupta on May 05, 2009 at 08:54 PM | Permalink
| Comments (0)
At Rails Conf
2009 , Jay
McGaffigan from Sea
Change talked about why they choose JRuby /GlassFish for their
product Affinity .
Here are some of the reasons he quoted:
Performance characterisitics (of GlassFish) have been
excellent
Picked GlassFish based upon the recommendations from the
people in
industry
Dramatically more throughput on our GlassFish installation,
400
requests/sec instead of 100 requests/sec comapred to Tomcat
Watch the interview recorded earlier today:
Read other simiar stories at glassfish+rubyonrails+stories .
Technorati: jruby
rubyonrails
glassfish
stories
Rails Conf 2009 Day 2 - DHH Keynote
Posted by arungupta on May 05, 2009 at 10:22 AM | Permalink
| Comments (0)
Rails Conf Day 2 start with DHH 's
keynote. The room was packed (close to 1200 attendees) and SRO. It was
interesting to know that 70% of the attendees are first timers and only
a handful have attended for all 4 years in a row. This is my second
in the US.
Here are the notes from DHH's keynotes:
Stop fretting about whether you are upto date with the
latest in Rails. Don't need to re-write your application everytime
something new comes up.
Gallery of "normal wounds"
Rails isn't enterprise ready, James McGovern "some
consutant, architect, or bullshit title of a big company". Can't win
the world with better arguments, some things take time.
Multiple frameworks like Grails, Sails, Biscuit, Monorail
seem to give the impression Java is easier
Switch back to PHP after 2 years on Rails y Derik Severs
(sp?)
The failed whale, "the twitter debacle" that Rails
doesn't scale.
Merb - "the most credible alternative to Rails". Even
though emotions can run high, the underlying principles are still the
same.
Fundamental principle of Rails are still the same, it's
better and faster
Philosophy of Rails3
Buck up all the unicorns - it's not going to be a rewrite
f everything
No holy cows - "There is nothing secret in Rails,
everything is up for public debate"
Have tasty burgers: it's all pre-assembled and use it the
default way, otherwise pick/choose whatever you like. Allow people to
make individual choices and still be together in one community.
Progress of Rails 3 - Ton of Rails 3 code in the
repository, no alpha release
New Router: Faster route by subdomains, user agents, more
Route to other Rack machinery. Mount multiple applications like Sinatra
and Django using this router. Much simpler routing API. "Ruby is not
about fewer lines of code, it's about expressive lines of code."
XSS protection: Flipping the convention such that all
outputting views will be escaped, so "<%=raw" will not escape it
and "<%" will escape it by default. HTML helpers "html_safe" may
be used too.
JavaScript goes unobstrusive and agnostic: Will adopt
HTML 5 custom attributes such as "data-remote" and "data-method"
attribtues will simplify "link_to_remote", "remote_form", "link_to".
More agnosticism: Action ORM is a slim wrapper around
other ORM tools, Generators (SoC project)
Great refactoring (bulk of the work): Abstract Controller
+ Action Dispatch, Active
Relation (also GSoC project ) underpins Active Record, Cherry picking from Active
Support, Speedy callbacks
Real secret to high productivity
Most developers treat requirements as stone tablets,
don't treat requirements as gospel, instead renegotiate requirements.
Use Twix instead of a fine Belgian chocolate, it doesn't
really matter most of the time.
Programmers are like puppies who want to fetch the same
ball again and again, bark back instead
Calling people programmer is like a blackbox, we are not
those boxes. Instead we should be treated as partners, work with our
stakeholders to get the job done.
Technorati: conf
railsconf
lasvegas
keynote
Rails Conf 2009 - Day 1 Trip Report
Posted by arungupta on May 04, 2009 at 11:43 PM | Permalink
| Comments (0)
Rails Conf 2009 started this morning. The first day consists of morning
and afternoon tutorials .
I attended Nick Sieger's JRuby
on Rails tutorial, the slides are available .
A survey in the room showed:
95% comfortable with Ruby/Rails
80% have used JRuby
10% use JRuby actively
Here are some of the key points highlighted in the tutorial:
Why JRuby ?
JRuby is "Less Bitter Java", after all Java is a great
platform.
Concurrency (Native threading)
Reliability (well-behaved because of Hotspot compiler, no
process monitoring, etc)
Encapsulation (take a Rails application, bundle it as a
single deployable artifact that is fully contained)
Choice (Any Java application server, huge breadth of Java
libraries, and can write thin Ruby wrappers around Java libraries)
Download JDK 5 minimum, JDK 6 preferred, MySQL 5.x, JRuby 1.2 (1.3.0
RC1 OK too), GlassFish v2.1 b60e
Common options
--server: Run with server VM, better performance
--headless: No UI
--properties: Show tweaks for compiler, JIT compiling,
thread pooling etc
-J<java-opt>: Pass any Java properties
-J-Xmx1G: Increase memory to 1G
Drawbacks :
No fork(), No native extensions (for example ParseTree,
EventMachine, RMagic cannot be used), No tty for subprocesses, Startup
time slow for short scripts
Advantages :
Improved versions of some Ruby APIs (tempfile, mutex,
thread, timeout), 1.8 and 1.9 in a single install (jruby --1.9), Wrap
Java libraries and APIs in Ruby
The slides
have much more details in terms of deployment options (WAR-based,
GlassFish Gem), and many other interesting details Scroll to slide #68
to understand all the guts of kenai.com
- a real life
application running using JRuby, Rails, and GlassFish.
The afternoon tutorial for me was A
Hat Full of Tricks with Sinatra . The tutorial was completely
code driven with no slides, just love that format!
The tutorial started with a brief introduction to Rack . A basic
Rack application can be "config.ru" or "app.rb", lets start with
"config.ru" Hello World :
run
lambda { |env|
[
200,
{
'Content-Length' => '2',
'Content-Type' => 'text/html',
},
["hi"]
]
}
Run it as ...
~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby
-S rackup
[2009-05-04 13:40:18] INFO WEBrick 1.3.1
[2009-05-04 13:40:18] INFO ruby 1.8.6 (2009-03-16) [java]
[2009-05-04 13:40:18] INFO WEBrick::HTTPServer#start:
pid=90964 port=9292
127.0.0.1 - - [04/May/2009 13:40:27] "GET / HTTP/1.1" 200 2 0.0160
127.0.0.1 - - [04/May/2009 13:40:27] "GET /favicon.ico HTTP/1.1" 200 2
0.0060
127.0.0.1 - - [04/May/2009 13:40:30] "GET /favicon.ico HTTP/1.1" 200 2
0.0100
"config.ru" is the default Rackup script, otherwise need to specify the
name. And now "app.rb" ..
App
= lambda { |env|
[
200,
{
'Content-Length' => '2',
'Content-Type' => 'text/html',
},
["hi"]
]
}
And run it as ...
~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby
-S rackup app.rb
[2009-05-04 13:43:57] INFO WEBrick 1.3.1
[2009-05-04 13:43:57] INFO ruby 1.8.6 (2009-03-16) [java]
[2009-05-04 13:43:57] INFO WEBrick::HTTPServer#start:
pid=90990 port=9292
127.0.0.1 - - [04/May/2009 13:44:09] "GET / HTTP/1.1" 200 2 0.0110
In both cases, the application is accessible at "http://localhost:9292".
Change the basic "config.ru" to convert into a class as ...
class
BasicRack
def call(env)
body = "Hello from a class"
[
200,
{
'Content-Length' => body.size.to_s,
'Content-Type' => 'text/html',
},
[body]
]
end
end
run BasicRack.new
and run the same way as earlier.
Change body to "env.inspect" to see an output as:
Sinatra allows reloading of application but that "feature" will be
removed soon. Instead install shotgun (which does not work with JRuby
yet!). Anyway, install the gem:
~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby -S gem install shotgun
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed configuration-0.0.5
Successfully installed launchy-0.3.3
Successfully installed shotgun-0.2
3 gems installed
Installing ri documentation for launchy-0.3.3...
Installing RDoc documentation for launchy-0.3.3...
And run as:
~/samples/railsconf/sinatra/basic-rack
>~/tools/jruby/bin/jruby -J-Djruby.fork.enabled=true -S shotgun
[2009-05-04 13:55:46] INFO WEBrick 1.3.1
[2009-05-04 13:55:46] INFO ruby 1.8.6 (2009-03-16) [java]
== Shotgun starting Rack::Handler::WEBrick on localhost:9393
[2009-05-04 13:55:46] INFO WEBrick::HTTPServer#start:
pid=91089 port=9393
Process separate bodies depending upon the info:
class
BasicRack
def call(env)
body = if env["PATH_INFO"] ==
"/foo"
"in foo"
else
"in other"
end
[
200,
{
'Content-Length' => body.size.to_s,
'Content-Type' => 'text/html',
},
[body]
]
end
end
run BasicRack.new
Accessing "http://localhost:9292/foo" shows "in foo" and accessing
"http://localhost:9393" shows "in other".
Target application
is the last application specified by "run".
Rack supports middleware
which are like filters, they can applied before/after a message is
processed.
Rack will initialize middleware at load, so hold on to that application
as shown:
class
BasicRackApp
def call(env)
body = "hello from app"
[
200,
{
'Content-Length' => body.size.to_s,
'Content-Type' => 'text/html',
},
[body]
]
end
end
class MyMiddleware
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
end
end
use MyMiddleware
run BasicRackApp.new
@app.call calls the next middleware in the chain.
Rack comes with couple of standard middleware, e.g.:
Example of an after filter:
def call(env)
status,
headers, body = @app.call(env)
body.map!
{ |part| part.upcase}
[status,
headers, body]
end
Lots of other
filters available.
With a basic Rack understanding, lets build a Sinatra app:
is the simplest Sinatra application. Save it in a file
"basic-sinatra.rb" and run it as:
~/samples/railsconf/sinatra/basic-sinatra
>~/tools/jruby/bin/jruby
-rubygems basic-sinatra.rb
== Sinatra/0.9.1.1 has taken the stage on 4567 for development with
backup from WEBrick
[2009-05-04 14:40:14] INFO WEBrick 1.3.1
[2009-05-04 14:40:14] INFO ruby 1.8.6 (2009-03-16) [java]
[2009-05-04 14:40:14] INFO WEBrick::HTTPServer#start:
pid=91396 port=4567
The application is now available at "http://localhost:4567". BTW, this
app can easily be run using GlassFish Gem as explained in TOTD
#79 . Add a simple GET method and "not_found" handler as:
require
'rubygems'
require 'sinatra'
not_found do
'hi from other'
end
get '/foo' do
'hi from foo'
end
Every time a request comes in, it builds a request context, instance
evals lambda and finds the one that hits.
Sinatra takes care of status and headers, the application needs to
process the body.
Another one ...
require
'rubygems'
require 'sinatra'
get '/env' do
env.inspect
end
And it shows Rack environment hash at 'http://localhost:4567".
Another one ...
require
'rubygems'
require 'sinatra'
get '/' do
end
post '/' do
end
put '/' do
end
delete '/' do
end
This adds 4 HTTP methods with different routes.
No explicit render method, e.g.
require
'rubygems'
require 'sinatra'
get '/' do
content_type "application/json"
{ "foo" => "goo" }.to_json
end
No ".rhtml.erb" or ".json.erb", instead it's just ".erb". Add
"views/index.erb" as:
<html>
<body>
Hello form Sinatra + ERB
</body>
</html>
And change GET method to:
require
'rubygems'
require 'sinatra'
get '/' do
erb :index
end
And the application now uses ERB templating.
Using HAML
templates is simple, change to:
require
'rubygems'
require 'sinatra'
require 'haml'
get '/' do
haml :index
end
And add "views/index.haml" as:
%html
%body
%h1 Hello from HAML
And now the application is using HAML templates.
__END__ is the end of Ruby, can be anything after that and it'll not
barf. Sinatra uses it for in file templates:
require
'rubygems'
require 'sinatra'
require 'haml'
get '/' do
erb :index
end
use_in_file_templates!
__END__
@@ index
<html>
<body>
Hello form Sinatra + ERB in file
</body>
</html>
Start with in-file templates, and then move out to separate directory
("views") once grows big. But no syntax highlighting etc.
Add your custom template as:
require
'rubygems'
require 'sinatra'
require 'haml'
get '/' do
erb :index
end
get '/foo' do
erb :foo
end
use_in_file_templates!
__END__
@@ index
<html>
<body>
Hello form Sinatra + ERB in file
</body>
</html>
@@ foo
<h1>FOO!</h1>
With this file "http://localhost:4567/" uses ERB template, and
"http://localhost:4567/foo" uses "foo" template.
Sinatra defines on Main. The before filters work before every single
request, executed in the same
context as lambda .
Can be used if every request needs to do some setup.
Helpers can be defined as:
require
'rubygems'
require 'sinatra'
require 'haml'
helpers do
end
without defining on Main. Or ...
require
'rubygems'
require 'sinatra'
require 'haml'
module helpers
def self.dosomething(arg)
end
end
get '/' do
Helpers.dosomething
end
Don't define something on Main, it's a bad practice.
Extension is a nice package that can be shared for other Sinatra
developers to use, like Rails plugins but does not have boilerplate,
much easier to do.
Rest of tutorial was quite fast paced so the code samples could not be
captured. But there is boatload of information available at sinatrarb.com .
Check out the pictures from Day 1:
The evening concluded with dinner at Burger
Bar at Mandalay Bay along with Project
Kenai team.
And check the evolving album at:
On to GlassFish
talk tomorrow, and running with @railsConfRunner
in the morning before that :)
Technorati: conf
railsconf
lasvegas
jruby
rubyonrails
sinatra
glassfish
TOTD #81: How to configure "database.yml" to be used with both JRuby and MRI ?
Posted by arungupta on May 04, 2009 at 09:58 AM | Permalink
| Comments (0)
In JRuby-on-Rails
tutorial at Rails
Conf 2009 , Nick
Sieger shared a nice little tip on how to configure
"database.yml" to be usable with both JRuby and MRI:
<% jdbc = defined?(JRUBY_VERSION) ? 'jdbc' : ''
%>
development:
adapter: <%= jdbc %>mysql
encoding: utf8
reconnect: false
database: myapp_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock
# ...
"JRUBY_VERSION" is defined only if your using JRuby and so the right
database adapter is picked up accordingly.
The complete slides for the tutorial are available here .
Learn about other related talks here .
Please leave suggestions on other TOTD (T ip O f T he D ay) that
you'd like to see.
An archive of all the tips is available here .
Technorati: conf
railsconf
lasvegas
tutorial
jruby
ruby rubyonrails
JRuby, Rails, and GlassFish Bootcamp - San Francisco, May 19/20, 2009
Posted by arungupta on May 01, 2009 at 12:47 PM | Permalink
| Comments (0)
Would you like to power up your Rails
applications using JRuby
and GlassFish ?
And learn that from the engineers who develop the technology.
If yes, then we have organized a bootcamp for you !
Day 1 (FREE) of this bootcamp provides an introduction to JRuby and
GlassFish and
how they serve as an excellent development and deployment environment
for Rails applications. Starting with clean slate on your laptop,
you'll be able to setup JRuby, Rails, GlassFish and learn about
different options available for running your applications.
Day 2 (need $$$) takes a deep dive on each topic and convert you into a
power user instantaneously. The topics range from Virtual Machine
tuning for JRuby and GlassFish, Warbler tricks, Java EE integration,
Deployment strategies, Monitoring applications to Running other
Rack-based frameworks. Lunch and beverages will be served on Day 2.
On both days, you get an opportunity to practice everything on your
laptop by following the experts along.
Complete details on venue, time, agenda, etc are available at railscamp.eventbrite.com .
Register now
before the seats fill out. And get ready to be drenched!
Technorati: conf
jruby
rubyonrails
glassfish
netbeans
bootcamp
sanfrancisco
TOTD #81: How to use nginx to load balance a cluster of GlassFish Gem ?
Posted by arungupta on April 30, 2009 at 05:47 AM | Permalink
| Comments (0)
nginx
(pronounced as "engine-ex") is an open-source and high-performance HTTP
server. It provides the common features such as reverse proxying with
caching, load balancing, modular architecture using filters (gzipping,
chunked responses, etc), virtual servers, flexible configuration and
much more.
nginx is known for it's high performance and low resource consumption.
It's a fairly popular front-end HTTP server in the Rails community
along with Apache, Lighttpd, and others. This TOTD (T ip O f T he D ay) will show how
to install/configure nginx for load-balancing/front-ending a cluster of
Rails application running on GlassFish
Gem .
Download, build, and install nginx using the simple script (borrowed
from dzone ):
~/tools
> curl -L -O http://sysoev.ru/nginx/nginx-0.6.36.tar.gz
~/tools > tar -xzf nginx-0.6.36.tar.gz
~/tools > curl -L -O
http://downloads.sourceforge.net/pcre/pcre-7.7.tar.gz
~/tools > tar -xzf pcre-7.7.tar.gz
~/tools/nginx-0.6.36 > ./configure
--prefix=/usr/local/nginx --sbin-path=/usr/sbin --with-debug
--with-http_ssl_module --with-pcre=../pcre-7.7
~/tools/nginx-0.6.36 > make
~/tools/nginx-0.6.36 > sudo make install
~/tools/nginx-0.6.36 > which nginx
/usr/sbin/nginx
OK, nginx is now roaring and can be verified by visiting
"http://localhost" as shown below:
Create a simple Rails scaffold as:
~/samples/jruby >~/tools/jruby/bin/jruby -S rails
runner
~/samples/jruby/runner >~/tools/jruby/bin/jruby
script/generate scaffold runlog miles:float minutes:integer
~/samples/jruby/runner >sed
s/'adapter: sqlite3'/'adapter: jdbcsqlite3'/
<config/database.yml >config/database.yml.new
~/samples/jruby/runner >mv
config/database.yml.new config/database.yml
~/samples/jruby/runner >~/tools/jruby/bin/jruby
-S rake db:migrate
Run this application using GlassFish Gem on 3 separate
ports as:
~/samples/jruby/runner >~/tools/jruby/bin/jruby -S
glassfish
Starting GlassFish server at: 192.168.1.145:3000 in development
environment...
Writing log messages to:
/Users/arungupta/samples/jruby/runner/log/development.log.
Press Ctrl+C to stop.
The default port is 3000. Start the seond one by explicitly specifying
the port using "-p" option ..
~/samples/jruby/runner >~/tools/jruby/bin/jruby -S
glassfish -p 3001
Starting GlassFish server at: 192.168.1.145:3001 in development
environment...
Writing log messages to:
/Users/arungupta/samples/jruby/runner/log/development.log.
Press Ctrl+C to stop.
and the last one on 3002 port ...
~/samples/jruby/runner >~/tools/jruby/bin/jruby -S
glassfish -p 3002
Starting GlassFish server at: 192.168.1.145:3002 in development
environment...
Writing log messages to:
/Users/arungupta/samples/jruby/runner/log/development.log.
Press Ctrl+C to stop.
On Solaris and Linux, you can run GlassFish as a daemon as well.
Nginx currently uses a simple
round-robin algorithm . Other load balancers such as nginx-upstream-fair
(fair proxy) and nginx-ey-balancer
(maximum connections) are also available. The
built-in algorithm will be used for this blog. Edit
"/usr/local/nginx/conf/nginx.conf" to specify an upstream
module which provides load balancing:
Create a cluster
definition by adding an upstream module (configuration
details ) right before the "server" module:
upstream
glassfish {
server
127.0.0.1:3000;
server
127.0.0.1:3001;
server
127.0.0.1:3002;
}
The cluster specifies a bunch of GlassFish Gem instances running at the
backend. Each server can be weighted differently as explained
here . The port numbers must exactly match as those specified
at the start up. The modified "nginx.conf" looks like:
The changes are highlighted on lines #35 through #39.
Configure load balancing by specifying this cluster using
"proxy_pass" directive as shown below:
proxy_pass http://glassfish;
in the "location" module. The updated "nginx.conf" looks like:
The change is highlighted on line #52.
Restart nginx by using the following commands:
sudo
kill -15 `cat /usr/local/nginx/logs/nginx.pid`
sudo nginx
Now "http://localhost" shows the default Rails page as shown below:
"http://localhost/runlogs"
now serves the page from the deployed Rails application.
Now
lets configure logging so that the upstream server IP address and port
are printed in the log files. In "nginx.conf", uncomment "log_format"
directive and add "$upstream_addr" variable as shown:
log_format
main '$remote_addr - [$upstream_addr]
$remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log
logs/access.log main;
Also
change the log format to "main" by uncommenting "access_log
logs/access.log main;" line as shown above (default format is
"combined"). Accessing "http://localhost/runlogs" shows the following
lines in "logs/access.log":
127.0.0.1 - [127.0.0.1:3000 ]
- [29/Apr/2009:15:27:57 -0700] GET
/runlogs/ HTTP/1.1 "200" 3689 "-" "Mozilla/5.0 (Macintosh;
U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like
Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3001 ]
- [29/Apr/2009:15:27:57 -0700] GET
/favicon.ico HTTP/1.1 "200" 0 "http://localhost/runlogs/"
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1"
"-"
127.0.0.1 - [127.0.0.1:3002 ]
- [29/Apr/2009:15:27:57 -0700] GET
/stylesheets/scaffold.css?1240977992 HTTP/1.1 "200" 889
"http://localhost/runlogs/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X
10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1
Safari/525.27.1" "-"
The
browser makes multiple requests (3 in this case) to load resources on a
page and they are nicely load-balanced on the cluster. If an instance
running on port 3002 is killed, then the access log show the entries
like:
127.0.0.1 - [127.0.0.1:3000 ]
- [29/Apr/2009:15:28:53 -0700] GET /runlogs/ HTTP/1.1 "200" 3689 "-"
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1"
"-"
127.0.0.1 - [127.0.0.1:3002,
127.0.0.1:3000 ] - [29/Apr/2009:15:28:53 -0700] GET
/favicon.ico HTTP/1.1 "200" 0 "http://localhost/runlogs/" "Mozilla/5.0
(Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1
(KHTML, like Gecko) Version/3.2.1 Safari/525.27.1" "-"
127.0.0.1 - [127.0.0.1:3001 ]
- [29/Apr/2009:15:28:53 -0700] GET /stylesheets/scaffold.css?1240977992
HTTP/1.1 "200" 889 "http://localhost/runlogs/" "Mozilla/5.0 (Macintosh;
U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like
Gecko) Version/3.2.1 Safari/525.27.1" "-"
The second log line shows that server running on port 3002 did not
respond and so it automatically fall back to 3000, this is nice!
But this is
inefficient because a back-end trip is made even for serving a static
file ("/favicon.ico" and "/stylesheets/scaffold.css?1240977992"). This
can be easily solved by enabling Rails page caching as described here
and here .
More options about logging are described in NginxHttpLogModule
and upstream module variables are defined in NginxHttpUpstreamModule .
Here are some nginx resources:
Are you using nginx to front-end your GlassFish cluster ?
Apache
+ JRuby + Rails + GlassFish = Easy Deployment! shows similar
steps if you want to front-end your Rails application running using
JRuby/GlassFish with Apache.
Hear all about it in Develop
with Pleasure, Deploy with Fun: GlassFish and NetBeans for a Better
Rails Experience session at Rails Conf
next week.
Please leave suggestions on other TOTD (T ip O f T he D ay) that
you'd like to see.
A complete archive of all tips is available here .
Technorati: rubyonrails
glassfish
v3 gem jruby nginx loadbalancing
clustering
TOTD #80: Sinatra CRUD application using Haml templates with JRuby and GlassFish Gem
Posted by arungupta on April 29, 2009 at 06:21 AM | Permalink
| Comments (0)
TOTD
#79 showed how to run a trivial Sinatra
application using GlassFish
Gem . Sinatra
provides support for Haml ,
Erb ,
Builder ,
Sass ,
and Inline templates as described here .
This TOTD will show how to get started with creating a Sinatra CRUD
application using Haml templates.
Haml is based on one primary principle - Markup should be beautiful
because beauty makes
you faster .
Get started by installing the Haml gem as:
/tools/jruby-1.2.0 >./bin/jruby
-S gem install haml --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 haml-2.0.9
1 gem installed
And follow the tutorial ,
documentation ,
and reference
page for more details.
Sinatra is ORM-agnostic and so any Ruby ORM framework such as ActiveRecord ,
DataMapper ,
Sequel ,
and others. DataMapper with JRuby requires
work so this TOTD will show how to use ActiveRecord instead.
There is sinatras-hat
which allows to create RESTy CRUD apps with Sinatra. There probably are
mutiple other ways to create this application but I prefer to
understanding the wiring so this blog will use a bare minimal structure.
Anyway, lets get started!
Create the database as:
~/tools/jruby/samples/sinatra-sample >mysql --user root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 664
Server version: 5.1.30 MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create
database hello_development;
Query OK, 1 row affected (0.00 sec)
mysql> use
hello_development;
Database changed
mysql> CREATE
TABLE `runners` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY,
`distance` float, `minutes` int(11), `created_at` datetime,
`updated_at` datetime);
Query OK, 0 rows affected (0.06 sec)
Update "hello.rb" from TOTD
#79 such that it looks like:
require 'rubygems'
require 'sinatra'
require 'activerecord'
## Setup
ActiveRecord::Base.establish_connection(
:adapter => "jdbcmysql",
:host =>
"localhost",
:username => "root",
:password => "",
:database => "hello_development"
)
## Models
class Runner < ActiveRecord::Base
end
## Controller Actions
get '/hi' do
"Hello World!"
end
get '/' do
@runner = Runner.find(:all)
haml :index
end
get '/new' do
haml :new
end
get '/:id' do
@runner = Runner.find(params[:id])
if (@runner)
haml :show
else
redirect '/'
end
end
post '/' do
@runner = Runner.new(:distance => params[:distance],
:minutes => params[:minutes])
if @runner.save
redirect "/#{@runner.id}"
else
redirect '/'
end
end
Firstly, it pulls in the ActiveRecord dependency. Then
"ActiveRecord::Base.establish_connection" is used to establish a
connection with the previously created database. "Runner" is tagged as
a model class by inheriting from "ActiveRecord::Base" and uses the
default table name ("runners" in this case). Add four new methods:
Three GET methods to show all the runners, a form to
enter new data, and show a particular log entry. Each method requires a
HAML template (will be created in next step) to render the information.
One POST method to save the newly created log entry in
the database.
Create a new directory "views" and create the following
files in that directory. Each file serves as a view and rendered from
an action in "hello.rb".
"index.haml": Show all the runners
%h1 Listing all runners ...
%table
%tr
%th Distance
%th Minutes
- @runner.each do |r|
%tr
%td= r.distance
%td= r.minutes
%br
%a{:href=>"/new"}
New Runner
"new.haml": Enter a new entry
%h1 Adding a new runner log ...
%form{:method=>"post", :action=>"/"}
Distance:
%input{:type=>"text", :name=>"distance"}
%br
Minutes:
%input{:type=>"text", :name=>"minutes"}
%br
%input{:type=>"submit", :value=>"Submit"}
%br
"show.haml": Show a particular log entry
%h1 Showing a runner log ...
Distance:
= @runner.distance
%br
Minutes:
= @runner.minutes
%br
%br
%a{:href=>"/"}= "Show All!"
The complete directory structure looks like:
.
./hello.rb
./views
./views/index.haml
./views/new.haml
./views/show.haml
That's it, now run the application as:
~/tools/jruby/samples/sinatra-sample >../../bin/jruby -S glassfish
Starting GlassFish server at: 192.168.1.145:3000 in development
environment...
Writing log messages to:
/Users/arungupta/tools/jruby-1.2.0/samples/sinatra-sample/log/development.log.
Press Ctrl+C to stop.
The main page is available at "http://localhost:3000/" and looks like:
Clicking on "New Runner" gives ...
Enter the data, and click on "Submit" to show ...
Click on "Show All!" to see all the entries added so far ...
And after adding few entries the main page looks like ...
This application shows Create and Read from the CRUD, it's fairly easy
to add Update and Delete functionality as well but that's an excercise
left for the readers :-)
You'll hear all about it at Develop
with Pleasure, Deploy with Fun: GlassFish and NetBeans for a Better
Rails Experience at Rails Conf
next week.
Technorati: totd
glassfish
jruby
sinatra
crud
TOTD #79: Getting Started with Sinatra applications on JRuby and GlassFish Gem
Posted by arungupta on April 28, 2009 at 06:16 AM | Permalink
| Comments (0)
Sinatra
is a DSL for quickly creating web-applications in Ruby with minimal
effort. Like Rails and Merb, Sinatra is not an MVC framework and
basically follows a flat-file structure instead. The framework define
conventions such as location of static files and
views, bootstrap, dev/production/test environment variables, filters,
helpers, TDD, and much more. Read Getting Started
for complete details. Even though Sinatra is not a MVC framework but sinatra-gen
may be used to generate new Sinatra projects.
GlassFish
Gem can easily run Rails ,
Merb , Sinatra , and any
other Ruby framework applications based upon Rack . TOTD
#70 shows how to run Rails applications and TOTD
#53 shows to run Merb applications. This TOTD will explain
how to run a trivial Sinatra application. A later blog will describe
how to plug
a generic Rack-based framework.
Lets see how to get started with Sinatra using JRuby and GlassFish gem.
Install Sinatra gem as:
~/tools/jruby >./bin/jruby -S gem install
sinatra
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed sinatra-0.9.1.1
1 gem installed
Installing ri documentation for sinatra-0.9.1.1...
Installing RDoc documentation for sinatra-0.9.1.1...
Create a directory "sinatra-sample", create a file
"hello.rb" in that directory with the contents shown below:
require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello World!"
end
Run your sample using GlassFish gem as:
~/tools/jruby/samples/sinatra-sample
>../../bin/jruby
-S glassfish
Log file
/Users/arungupta/tools/jruby-1.2.0/samples/sinatra-sample/log/development.log
does not exist. Creating a new one...
Starting GlassFish server at: 192.168.1.145:3000 in development
environment...
Writing log messages to:
/Users/arungupta/tools/jruby-1.2.0/samples/sinatra-sample/log/development.log.
Press Ctrl+C to stop.
And then the output is available at "http://localhost:3000/hi" and
looks like:
Neat and simple!
You'll hear all about it at Develop
with Pleasure, Deploy with Fun: GlassFish and NetBeans for a Better
Rails Experience at Rails Conf
next week.
Here is the order in which I'll seek any help:
The next blog will show how to create a Sinatra CRUD application and
run it using GlassFish.
Please leave suggestions on other TOTD (Tip Of The Day) that
you'd like to see.
A complete archive of all the tips is available here .
Technorati: totd
glassfish
jruby
sinatra
GlassFish, NetBeans, and Project Kenai at Rails Conf 2009
Posted by arungupta on April 28, 2009 at 06:14 AM | Permalink
| Comments (0)
Did you know that ...
GlassFish
Gem is already used in production
GlassFish Gem can be used to run Rails, Merb,
Sinatra, and any other Rack-based framework
Capistrano recipes are available for
starting/stopping/bouncing the server
With GlassFish ,
standard Java monitoring techniques like JMX can be used for monitoring
Rails apps
NetBeans
provide a complete development environment for Rails applications
There are many other similar nuggets that I'll be covering in my Rails Conf 2009
session. Details are given below:
Register
Today and avail a 15% discount using the code: RC09FOS.
I plan to attend these
sessions , lets see how many I can make :-) And of course,
you'll see me in the Exhibit
Hall .
And if you are interested in running with fellow attendees, follow @railsConfRunner .
And it's Vegas baby!
JRuby and GlassFish is already used in production . Do you have a success story to share ? I'll be happy to promote at RailsConf.
Technorati: conf
glassfish
netbeans
rubyonrails
kenai
railsconf
lasvegas
jruby
GlassFish asadmin CLI-driven Cluster Setup
Posted by arungupta on April 24, 2009 at 01:38 PM | Permalink
| Comments (0)
Here is simple script that:
Installs GlassFish
Creates a new domain using cluster profile
Create 2 instance s
in the cluster
Deploys a sample application to verify the cluster setup
Everything in just one simple script!
This script can be used on a virtual (Virtual
Box , EC2 instance, etc.) or a physical image of an Operating
System.
echo A | java -Xmx256m -jar
~/Downloads/glassfish-installer-v2.1-b60e-darwin.jar -console
cd $GLASSFISH_HOME
chmod +x ./lib/ant/bin/ant
./lib/ant/bin/ant -f setup.xml
cd $GLASSFISH_HOME
echo 'AS_ADMIN_ADMINPASSWORD=adminadmin' > password
echo 'AS_ADMIN_PASSWORD=adminadmin' >> password
echo 'AS_ADMIN_MASTERPASSWORD=changeit' >> password
./bin/asadmin
create-domain --user admin --passwordfile ./password --savelogin=true
--portbase 5000 --interactive=false --profile cluster cloud
./bin/asadmin start-domain cloud
./bin/asadmin create-node-agent --user admin --port 5048
--interactive=false --passwordfile ./password cloud-nodeagent
./bin/asadmin start-node-agent --interactive=false --passwordfile
./password cloud-nodeagent
./bin/asadmin create-cluster --port 5048 wines
./bin/asadmin
create-instance --port 5048 --nodeagent cloud-nodeagent
--systemproperties HTTP_LISTENER_PORT=58080 --cluster wines cabernet
./bin/asadmin
create-instance --port 5048 --nodeagent cloud-nodeagent
--systemproperties HTTP_LISTENER_PORT=58081 --cluster wines merlot
./bin/asadmin deploy --target wines --port 5048
--availabilityenabled=true samples/quickstart/clusterjsp/clusterjsp.ear
./bin/asadmin start-cluster --port 5048 --interactive=false
--passwordfile ./password wines
After
the script execution is complete, open up
"http://localhost:58080/clusterjsp". The page shows it is served from
the "cabernet" instance. Enter some session data by adding values in
the text box placed towards end of the page. Then
stop the "cabernet" instance as explained in TOTD
#67 after the string "OK, now show time!".
Now load the page "http://localhost:58081/clusterjsp" and it shows that
the page is served from "merlot" instance. And the exact same session
data is displayed towards the bottom of the page.
It basically shows that the session data added in one instance is
replicated to the "buddy instance" ("merlot" in this case)
automatically.
This scipt is tested on Open Solaris
2008/11 , Windows
Vista , and Mac
OSX 10.5.x .
The cluster and instance creation can be easily done using the
web-based admin console as described
here . But this TOTD also shows the power of scriptability for
common GlassFish administration commands - asadmin is your hidden gem
and learn more about it in this recorded
webinar !
TOTD
#69 explains how to use Sun Web Server and Load-Balancer
Plugin for the load balancer + clustering setup on Windows Vista. TOTD
#67 explains the same steps for Apache + mod_jk on Mac OSX.
Technorati: glassfish
cli asadmin clustering
highavailability
Offshore monitoring of windfarms using GlassFish - MySQL Users Conference 2009 Day 3
Posted by arungupta on April 22, 2009 at 09:00 PM | Permalink
| Comments (0)
John Powell from eMapSite
stopped by at the Whisper
Suite in MySQL
Users Conference earlier today to talk about his GlassFish
issue. The possible workaround was suggested and then the discussion
became interesting on how GlassFish is used for offshore monitoring of
windfarms and process weather forecasting data. Hear all about it and
watch a flashy demo of their product in this video:
NetBeans ,
GlassFish, and MySQL
is their development stack with a "very positive experience"!
Stay tuned for the stories
entry .
And the complete picture album is available at:
Technorati: conf
mysqlconf
mysql
santaclara
glassfish
netbeans
LOTD #21: Production Deployment Tips for running Rails on GlassFish v2 using Windows
Posted by arungupta on April 22, 2009 at 02:26 PM | Permalink
| Comments (0)
SeaChange
Affinity uses Rails and GlassFish
as their deployment platform. One of their core developers posted
tips based upon their experience so far and they are
available at:
Rails
on GlassFish v2 using Windows
Here are some of the quotes:
Glassfish can really
handle a heavy load
and
handling 400
simultaneous users under a supremely heavy load, the
memory was holding great
All previous links in this series are archived at LOTD .
Technorati: lotd
glassfish
jruby
rubyonrails
windows
MySQL Users Conference 2009 Day 3 - Cloud Shootout
Posted by arungupta on April 22, 2009 at 11:53 AM | Permalink
| Comments (0)
I arrived at the MySQL
Users Conference just in time for the The
Great Open Cloud Shootout .
Kaj Arno was asking questions to the invited panelists shown in the
picture above. Here is a partial discussion:
What is cloud ?
Thorsten
Fully
automatbale computing infrastructure, changes the way production
scale deployments operate, saves time/cost, increases reliability
Chander
Elasiticity
is an important aspect, Can "shoot for the moon without
shooting foot", accessing a pool of resources which is infinite from an
individual/organization perspective
Monty
Much
like electricity/network bandwidth, applying that same model to
computing resources
Jeremy
Virtualization
is an important piece
Lew
Not new technology, rather a new way
of delivery. As a
developer, provision the application through the code.
Who is it for ?
Monty
It's for you
Thorsten
Amazon launched, mostly for geeks. 2007
-> Amazon
skeptical and RightScale gets VC funding, 2008 -> some common
usage, 2009 -> Top-down from CIOs. Basically everybody,
cross-organiation, vertical
Mike
Horizontal technology opportunity, starting to
see mainstream
applications including ISVs/primary line of business, interest/adoption
is growing
Chander
Definitely growing for ISVs, makes backup sexy,
"Even though
running a backup company, expected to be entertaining"
Jeremy
Power outlets are shaped
differently, technology has not
matured enough. Next few years standardization will happen.
Monty
People
will never notice it exists, but able to access the
information
Prashant
Putting/Sharing
the data on cloud
Why use the cloud ?
Monty
All of a sudden facebook traffic, leverage a
collective of
people who are already investing in an effort
Lew
Cloud computing based on virtualization
Mike
More & more enterprises moving in the
cloud, gain
durability & resilience which was not an option because of a
single data center
Jeremy
Legacy apps are easiest to move into cloud, they
are better
understood and can scale easily
Prashant
Cloud is the right approach/dream,
not there yet. Traditional
apps can be moved into cloud.
Thorsten
Flexibility
in development and tests, DBA clone another slave
server with exactly the same setup to test out schema changes
Monty
Spin
up EC2 instances, run the tests and shut them down ...
everything in approx $1. Give it back to the cloud and make it more
efficient for the world in general.
Lew
We
are making it so affordable, cost can be 10% of what it was
before.
Cloud adoption barrier
Chander
Performance, a customer requested a refund where
they were
trying to shove a 1TB in an hour. US is 6Mbps, needs to significantly
increase before it can be utilized.
Thorsten
Compute needs to move where the data is.
Chander
Most businesses will find bandwidth/redundancy
limited.
Customer always need to customer where not to use cloud and set
expectations accordingly
What apps will never move
to cloud ?
Lew
Financially sensitive applications, owning your
own data center
Chander
Trust and privacy, it's more about education
though.
Encryption is going tobe a key.
Jeremy
Competitiion, unless other companies battle it
out and making
it easy to to migrate from one service to other, it'll be difficult.
Avoid vendor lockin.
Are there cloud standards
?
Mike
Based on open industry standards, no
deep rooted
concern in the user community
Thorsten
Way to operate across different clouds, API is
not the most
important level. What is a server ? Can I hibernate it, mount it, how
much storage volume is allowed, cross-data center boundary are a better
abstraction.
Lew
Very early to lock the standards, everybody is
currently in a
stage of experiementation
Monty
Potential downside to premature standardization,
too early to
jump to standards
Chander
Open standards are a definite key to
success. S3 fostered innovation.
Thorsten
S3
is a good standard but not an open API. It will be doubly
nice if it's "free" or "open" or whatever the word is.
Mike
Standards
dont really matter if the performance cannot be met.
When innovating at a rapid rate, it' difficult to make everybody agree
upon standards.
Lew
At
least publish the API where everybody can use them.
Chander
Showing
backup to Sun cloud, Sun has S3 compatible APIs, also
compatible to WebDAV.
Cloud Business
Opportunities
Monty
You can
Mike
Very unique and compelling business opportunity.
Amazon Dev
Pay :
Buy infrastructure on demand, setup your software on AMI, set your own
price and then customers can use it, "Software as a Innuity"
Chander
Traditional backup vendors will be worried.
Prashant
Database on the cloud
Lew
Seeing an explosion in the amount of
data/compute required,
accordingly analytics. Tremendous amount of opportunity when Cassandra
& Drizzle are cloud-enabled.
Mike
More
ISVs in the cloud.
Jeremy
How
to do performance tuning and optimizations in cloud, do
that for major cloud infrastructure.
Monty
Freedom
to work from anywhere, don't need to be physically at the
datacenter, enables multinational consulting
Chander
When
more clouds become available, it'll be explosion which
will happen later this year.
How is cloud measured ?
Jeremy
CPU time in terms of use, storage centric clouds
pay for
integrity
Lew
Creating Data centers with loading docks.
Monty
Paying for CPU cycle, like mainframe model.
Thorsten
Cloud is like mainframe but very elastic.
Chander
Billing is not a challenge, storage
clouds are better because
of pricing, compute is challenging
Databases & Clouds
Thorsten
Flexibility of moving to the next volume,
master, slave makes
is very refreshing
Monty
Start out thinking M x N problems, never think
about one
database instance in cloud, there will be X > 1
And the shootout had to be shutdown because the timing estimates were
slightly misjudged
But all in all, an interesting discussion!
Come meet us at the GlassFish booth in the Exhibit
Floor .
Or you can stop by at room #205 for the Whisper Suite for a more
personal and 1-1 conversation.
Technorati: conf
mysqlconf
mysql
santaclara
glassfish
cloud
MySQL Users Conference 2009 Day 2
Posted by arungupta on April 21, 2009 at 09:53 PM | Permalink
| Comments (0)
I presented on Creating
Quick and Powerful Web Applications with MySQL, GlassFish, and NetBeans .
The key messages conveyed during the preso are:
GlassFish
is an open source community and delivers production-quality Java EE
compliant Application Server.
GlassFish v2 is the Java EE 5 Reference Implementation and
GlassFish v3 for Java EE 6. Read complete difference here .
Java Persistence API makes it really easy to create
database-backed Web applications. It even creates MySQL-specific
queries , when possible.
The web-based administration console and CLI are powerful
GlassFish management tools that meets the need of any IT administrator.
NetBeans
provides comprehensive and seamlessly integrated tooling for GlassFish.
The goal is to make the Eclipse
tooling at par with NetBeans.
The slides are available here .
And then notes from some of the sessions I attended:
State
of the Dolphin
12+ million users, 70k downloads/day, 1100 MySQL Partners
Multiple platforms: LAMP, Windows, Mac, OpenSolaris,
Solaris, RedHat,
Suse, Ubuntu
Multiple Languages: php, Perl, Python, Ruby, Java, C, C++,
C#
MySQL 5.1: 3 million downloads in 100 days
MySQL
5.4
announced: InnoDB Scalalbility, Sub-query optimizations, 59% faster
than 5.1, 40% improvement in read/write test, 71% throughput increase
InnoDB:
Fast index creation (add/drop indexes w/o copying the data), Data
compression (shrink tables, to significantly reduce storage and i/o)
Embedded
InnoDB (announced today): Proven high-performance and reliability and
functionality of InnoDB, low-level but powerful non-SQL API for app
programmers, operational characteristics needed for stand-alone apps
where there is no DBA
Dr DBA was awarded "Acquirer of the Year: Oracle" :-)
MySQL Cluster 7.0: 99.999% availability, 4.3x higher
throughput, 140k+
TPM and 4x less power and consumption than 6.3
MySQL
Query Analyzer: Continuous query monitoring, find and fix problem SQL
code, historical and real-time analysis, drill down into execution
statistics
InnoDB:
Innovative Technologies for Performance and Data Protection
Dr Heikki Tuuri, was professor at Helsinki, founded
Innobase, got
acquired by Oracle
Performance and Data Integrity are basic features
Architected and written by one person
Full transaction support, Unlimited row-level locking,
multi-version
read-consistency, automatic deadlock detection
Innovative: adaptive hash indexes, insert buffer (performance
benefits ), doublewrite buffer, InnoDB plugin
Oracle/Innobase + Sun/MySQL
Rethinking
MySQL, Enter Drizzle
Goals
Pluggable/Infrastructure Aware
Community Developed
Multicore/Concurrency (load up 10,000 connections in db)
Focus on Web applications/enable others
Modernize codebase for manageability (currently C/C++,
can we reuse STL and other libraries)
Philosophies
Have open and well-documented interfaces
Have transparent goals and processes, that are
communicated publicly
Have fun and encourage collaboration
Remove barriers to contribution and participation for
everyone
Enable contributors to build a business around Drizzle
Drizzle announced at OSCON last year
Translated into 30+ languages since then
7% of developers are from Sun
100+ contributors (>500 on the mailing list), even
Postgres and Firebird developers \
Cirrus
available now, Aloha
next
Drizzle
Developer Day 2009 scheduled this Friday
No patches are contributed back to MySQL Enterprise
Will be ready for production deployment Jun 2010
References
High
Performance Rails and MySQL
David Berube: Apress books on "Author Practical Ruby Gems",
"Practical Rails Plugins", "Practical Reporting with Ruby on Rails"
Finding performance issues in Rails
Rails development log
eabe_db_tools: Ajax popup- displays query count, query
each time for a each query on a page. Will be available on github next
week.
mysql_slow_log
Is it a database problem: Firebug, YSlow, Ping, tracert,
etc.
Let the database do the heavy lifting instead
of Ruby: for example, don't sort in Ruby
Deep eager loading: don't load that is not required
Use built-int Rails grouping and aggregate functions
Caching: simple ootb caching, Cache Fu, MySQL triggers for
DB function caching, Rails triggers for other caching
Did you know 1.3 billion emails were sent as part of Obama's election
campaign - and all powered by MySQL ? Hear the details from Blue State Digital
engineers who created the solution and maintained it:
And you can always read the complete
case study .
Some pictures from earlier today ...
And then the evolving picture album is available at:
Come meet us at the GlassFish booth in the Exhibit
Floor .
Or you can stop by at room #205 for the Whisper Suite for a more
personal and 1-1 conversation.
Technorati: conf
mysqlconf
mysql
santaclara
glassfish
netbeans
MySQL Users Conference 2009 Day 1 in Photos
Posted by arungupta on April 20, 2009 at 09:17 PM | Permalink
| Comments (1)
MySQL Users Conference started earlier this morning with tutorials. I
attended MySQL
Cluster Tutorial and part of Scale-Up,
Scale-Out, and High Availability: Solutions and Combinations .
Both of them were very involving with practical real-life advice.
Here are tweets from the morning of MySQL Cluster Tutorial:
And now the tweets from "Scale-Up,
Scale-Out, and High Availability: Solutions and Combinations" session:
Here are some pictures captured during the day:
And tomorrow I present on Creating
Quick and Powerful Web Applications with MySQL, GlassFish, and NetBeans .
And then the evolving picture album is available at:
Come meet us at the GlassFish booth in the Exhibit
Floor .
Technorati: conf
mysqlconf
santaclara
glassfish
netbeans
GlassFish and NetBeans at MySQL Users Conference 2009
Posted by arungupta on April 17, 2009 at 06:13 AM | Permalink
| Comments (4)
What is open source, production-quality, supported by a large vibrant
community, and comes with full enterprise support ? - GlassFish and MySQL .
Did you know that GlassFish ...
is the only open-source Java EE 5 compliant Application
Server
can be used to deploy Rails, Grails, and Django applications
has 13x better price/performance than Dell/HP, and
therefore a much lower TCO
has an easy-to-use and intuitive web-based administration
console
has enterprise features like clustering/high availability,
.NET-interoperable Web services, ...
Are you attending MySQL
Users Conference 2009 and interested to learn how GlassFish
and MySQL together provides an ideal deployment platform for all your
web applications ?
There are several other advantages which I'll be speaking on Creating
Quick and Powerful Web Applications with MySQL, GlassFish, and NetBeans
and the coordinates are:
When:
April
21, 2009 (Tuesday), 3:05 pm
Where:
Ballroom A
You can also find us on the Exhibitor
Floor !
Technorati: conf
glassfish
netbeans
mysql
mysqlconf
santaclara
LOTD #20: How to create a JPA application using GlassFish Tools Bundle for Eclipse ?
Posted by arungupta on April 09, 2009 at 11:27 AM | Permalink
| Comments (0)
Here is a great screencast (from the community) that shows how to
create a JPA application
using EclipseLink and deploy on GlassFish v2.1 - all using GlassFish
Tools Bundle for Eclipse .
Click on the image below for the video:
Thanks!
I'll work on a MySQL version of it :)
All previous links in this series are archived at LOTD .
Technorati: lotd
glassfish
eclipse
jpa javadb screencast
TOTD #78: GlassFish, EclipseLink, and MySQL efficient pagination using LIMIT
Posted by arungupta on April 08, 2009 at 05:52 AM | Permalink
| Comments (2)
EclipseLink
JPA replaces TopLink
Essentials as the JPA implementation in GlassFish v3 . One
of the benefits of using EclipseLink is that it provides efficient
pagination support for the MySQL database by generating
native SQL statements such as "SELECT ... FROM <table>
LIMIT <offset>, <rowcount>".
The MySQL LIMIT clause definition
says:
The
LIMIT clause can be used to constrain the number of rows returned by
the SELECT statement. LIMIT takes one or two numeric arguments, which
must both be non-negative integer constants (except when using prepared
statements).
With two arguments, the
first argument specifies
the offset of the first row to return, and the second specifies the
maximum number of rows to return. The offset of the initial row is 0
(not 1):
SELECT * FROM tbl LIMIT
5,10; # Retrieve rows 6-15
So instead of fetching all rows from the database and then filtering
from row 6-15, only rows 6 through 15 are fetched.
This TOTD (T ip
O f T he D ay) explains how to
create a JPA Persistence Unit for sakila
(MySQL sample database) using NetBeans ,
use EclipseLink as the Persistence Provider, and then write a JPA query
to leverage the pagination support - all on GlassFish v3.
Create a Persistence Unit for "sakila" as explained in this
blog using bullets #1 - 3. The differences are explained
below:
In 2.1, choose "GlassFish v3 Prelude" as the server. Even
though "GlassFish v3 Prelude" is chosen as the server but it will be
replaced with a recent promoted build because pagination feature is not
implemented in the Prelude. Alternatively you can use NetBeans 6.7 M3
and GlassFish v3 as explained
here .
In 3.3, EclipseLink
is shown as the default Persistence Provider as shown below:
In 3.5, there is no need to specify the properties for
"user" and "password as the JDBC resource is stored in the server
configuration. Instead specify the following property:
<properties>
<property name="eclipselink.logging.level"
value="FINE"/>
</properties>
This will log any SQL statement sent by JPA to the underlying
persistence provider (EclipseLink in this case).
If GlassFish v3 was configured using NetBeans 6.7 M3, then
the JDBC Connection Pool and JDBC resource were created in the server
directly. If not, then download and unzip the latest GlassFish v3 latest
promoted build (b43
as of this writing). Create the JDBC Connection Pool as:
./asadmin create-jdbc-connection-pool
--datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --property
user=duke:password=glassfish:ServerName=localhost:portNumber=3306:databaseName=sakila
jdbc-mysql-pool
and the JDBC resource:
./asadmin create-jdbc-resource --connectionpoolid
jdbc-mysql-pool jndi/sakila
GlassFish v3 b43
bundles "Eclipse Persistence Services - 2.0.0.r3652-M1". A
later blog will explain how to replace the bundled EclipseLink version
with a newer/different EclipseLink version.
Create a new Servlet "QueryServlet". Inject the
javax.persistence.EntityManagerFactory resource:
@PersistenceUnit
EntityManagerFactory emf;
and change the "processRequest" operation to:
EntityManager em = emf.createEntityManager();
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
int startRow = Integer.valueOf(request.getParameter("start_row"));
int howMany = Integer.valueOf(request.getParameter("how_many"));
Query q = em.createNamedQuery("Film.findAll");
q.setFirstResult(startRow);
q.setMaxResults(startRow + howMany);
for (Object film : q.getResultList()) {
out.print(((Film)film).toString() + "<br/>");
}
} finally {
out.close();
}
This Servlet reads two parameters from the request and sets parameters
on the JPA Query to enable pagination.
Deploy the application on GlassFish v3.
Using NetBeans 6.7 M3, select "Deploy" from the
context-sensitive menu.
Using NetBeans 6.5.1, select "Clean and Build" and then
manually deploy the WAR file using "asadmin deploy dist/Pagination.war".
If the project name was "Pagination", then the Servlet is accessible at
"http://localhost:8080/Pagination/QueryServlet?start_row=1&how_many=10"
and shows ten rows starting at index "1". The output looks like:
The log file in "domains/domain1/logs/server.log" show the following
SQL query generated by EclipseLink:
[#|2009-04-07T14:01:12.815-0700|FINE|glassfish|org.eclipse.persistence.session.file:
/Users/arungupta/tools/glassfish/v3/b43/glassfishv3/glassfish/domains/domain1/applications/Pagination/WEB-INF/classes/-PaginationPU.sql|
_ThreadID=15;_ThreadName=Thread-1;ClassName=null;MethodName=null;|SELECT
film_id AS film_id1, special_features AS special_features2, last_update
AS last_update3, rental_duration AS rental_duration4, release_year AS
release_year5, title AS title6, description AS description7,
replacement_cost AS replacement_cost8, length AS length9, rating AS
rating10, rental_rate AS rental_rate11, language_id AS language_id12,
original_language_id AS original_language_id13 FROM film LIMIT ?, ?
bind => [1, 11]|#]
As you can see, the query uses the LIMIT clause which optimizes the
data returned from the table.
If a different database, for example Derby, is used then the generated
SQL query looks like as:
[#|2009-04-07T17:00:34.210-0700|FINE|glassfish|org.eclipse.persistence.session.file:
/Users/arungupta/tools/glassfish/v3/b43/glassfishv3/glassfish/domains/domain1/applications/Pagination/WEB-INF/classes/-PaginationPU.sql|
_ThreadID=15;_ThreadName=Thread-1;ClassName=null;MethodName=null;|SELECT
film_id, special_features, last_update, rental_duration, release_year,
title, description, replacement_cost, length, rating, rental_rate,
language_id, original_language_id FROM film|#]
In this case, the entire table is fetched and the rows are filtered
based upon the critieria specified on the client side.
If the number of rows is huge (a typical case for enterprise) then
MySQL provides efficient fetching of records. And GlassFish v3, with
EclipseLink JPA integrated, makes it much seamless for you.
Thanks to Mr
GlassFish Persistence (aka Mitesh :) for helping me
understand the inner workings.
Discuss this more at Creating
Quick and Powerful Web Applications with MySQL, GlassFish, and NetBeans
technical session in the upcoming MySQL Users Conference!
Please leave suggestions on other TOTD (T ip O f T he D ay) that
you'd like to see.
A complete archive of all the tips is available here .
Technorati: totd
glassfish
v3 eclipselink
jpa mysql
LOTD #19: Securing GlassFish Installation
Posted by arungupta on April 07, 2009 at 10:16 AM | Permalink
| Comments (0)
Found great (old) blogs (part
1 , part
2 ) by Masoud Kalali that discusses the different ways to
secure a GlassFish
installation.
Changing master password and admin console passwords (both web-based
and CLI) are two fairly trivial operations:
/tmp/glassfish >./bin/asadmin
change-master-password
Please enter the new master password>changeit2
Please enter the new master password again>changeit2
Master password changed for domain domain1
and
/tmp/glassfish >./bin/asadmin
change-admin-password
Please enter the old admin password>adminadmin
Please enter the new admin password>adminadmin2
Please enter the new admin password again>adminadmin2
Updated .asadminpass file with new password.
Command change-admin-password executed successfully.
And then the blog discusses how to secure administration listener using
client-cert authentication or mutual authentication, reduce the
visibility of listeners (as appropriate), and other similar techniques.
Read Part
1 and Part
2 .
The GlassFish
Administration Guide provide more details on how to manage
your GlassFish installation!
Technorati:
glassfish
administration
security
GlassFish at San Francisco Java Users Group - May 12th, 2009
Posted by arungupta on April 07, 2009 at 10:15 AM | Permalink
| Comments (0)
Are you living in the San Francisco Bay Area and like to hear all the
craze around GlassFish
?
Jan Luehe
(from the GlassFish
Webtier team) and Roberto Chinnici
(Java EE 6
specification lead) will be speaking on May 12th at the San
Francisco JUG meetup . So get ready to drink from the firehose
:)
There will be pizza, refreshments, book giveaways and other interesting
goodies!
Click on the map below for directions:
Complete details about the event here ,
make sure to RSVP!
Technorati: conf
glassfish
jug sanfrancisco
meetup
July 2009
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Search this blog:
Categories
Community
Community: Glassfish
Community: Java Tools
Community: Java User Groups
Community: Java Web Services and XML
Community: NetBeans
Eclipse
J2EE
J2SE
JavaOne
JSR
Open Source
Tools
Web Applications
Web Services and XML
Archives
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
Recent Entries
Rails on GlassFish - "most performant of all", "simpler and just works", "blazing speed"
FISL 2009 Wrapup - 3 talks, 1 talk show, 14 blogs, 10 videos, 275 pics, 2 GlassFish production stories
Digital TV-based Banking using GlassFish, NetBeans and MySQL - Ginga community in Brazil