Thursday Dec 10, 2009

The Ajax Experiment

Ajax was not new to our team, however, we had not used it too extensively in our application in the past -- we generated bread crumbs, calculated when the browser needed to be reloaded, and populated tree nodes when server state changed.  To solve our performance problem, we decided to Ajax was our best hope (or going back to frames -- and that was NOT going to happen)....[Read More]

Tuesday May 26, 2009

JavaOne Hidden Treasure

JaveOne is 1 week away! Hurray!  What are you going to be doing at JavaOne?  Reply with what you're looking forward to seeing at JavaOne, I'm curious. :)

One cool thing during JavaOne that I suspect many people didn't know existed, are the Hands-on Labs.  Everyone knows about the traditional sessions where you hear a good (usually) speaker talk about an interesting topic (or where you can relax and check email in peace).  However, the Hands-on Labs are the hidden treasure of JavaOne.

The Hands-on Labs take a topic and let you learn about them by doing.  Topics range from several JavaFX labs (REST, WebServices, Mobile, and more), to cloud computing, to SIP applications, or the lab that I co-authored: Building OSGi Plugins for the GlassFish v3 Administration Console.   Each lab is either presented in a Bring Your Own Laptop (BYOL) format, or has machines already configured with the lab software ready to go at JavaOne.  Regardless of format, they provide step-by-step instructions on how to complete the lab.

Hands-on Lab Instructions

The building OSGi plugins lab that I helped write shows how the GlassFish Admin Console web application was written to take advantage of OSGi bundles.  The lab walks you through the process of creating several OSGi plugin bundles which add new features to the web application.  You have a chance to create a twitter plugin (thanks to Ryan Lubke), make a Jeopardy game, add a tagging capability to the console, and more.  And best of all, the concepts in the lab can be applied to your own GlassFish web applications.  Here's a screenshot of what the tagging plugin looks like after you're done (also with a "notes" plugin installed):

GlassFish v3 Admin Console with Tags and Notes Plugin

So... if you didn't know about the JavaOne Hands-on labs, or you haven't checked them out in the past.  Give them a shot this year -- you won't be disappointed.  Remember to Bring Your Own Laptop to the ones listed as BYOL when you search Schedule Builder (the Building OSGi plugins lab will be in a machine-provided room on Wed at 1:35PM).

Whether you choose a Hands-on Lab or not, I hope everyone attending JavaOne has a great time.  Don't forget to reply and post what you're looking forward to seeing at JavaOne this year.  Also, if you're planning on attending my OSGi plugins lab, let me know!

See you at JavaOne!

Wednesday Feb 25, 2009

Looking for Opinions...

The GlassFish admin console team has been working hard on ways to simplify our development, while at the same time attempting to improve the experience of using the console.  We have created a prototype which shows a couple different designs we are considering -- we'd like your feedback.  Here's how you can help:
Here are some things we are particularly interested in feedback on:
  • Do you like (or dislike) the menus?
    v3 Console with Menus
  • Do you like (or dislike) the tree?  (Be sure to click the "Toggle Scheme" button.)
    v3 Console with a Tree
  • Do you like / dislike the tagging feature? (See first screen shot above.)
Of course all other comments are also welcome (What's missing?  What do you really like?  What do you hate? etc.).  We know there are many issues with this UI, it is an early prototype -- far from production ready.  Just a few of the major issues we're aware of:
  • Many broken button clicks (particularly posts that don't do a redirect)
  • 404 pages cause a loop due to a JSF bug
  • Performance -- it's not good right now, it will be MUCH better when it's not a prototype (note: it also doesn't help that this prototype is running on a small desktop machine over a DSL-line... ;) ).
  • Many pages are broken (some intentionally for the public demo, others are simply not implemented)
  • List of tagged pages can sometimes show duplicates
  • Ajax for updating tags and other portions of the screen is not implemented
  • Breadcrumbs do not exist

So... as you can see we're not looking for bugs, but rather general feedback on the navigation and Look-and-Feel.  So post your thoughts and help make GlassFish better. :)

Thanks for taking a look!

Monday Feb 09, 2009

Introducing GlassFish Performance Tuner

Today, along with the announcement of Sun GlassFish Enterprise Server 2.1 (docs, download), Sun is pleased to announce Sun GlassFish Enterprise Manager!

Sun has lead the GlassFish community in delivering fully documented, full featured, production quality enterpise software -- for no cost.  In addition, Sun has offered valuable support contracts for indemnification and help beyond that provided by the GlassFish community; it's great to have someone to call when you really need help!  Sun GlassFish Enterprise Manager just upped the value of purchasing support with the introduction of tuning and self-management tools.

I was privileged to help devleop the Performance Advisor "Tuner" feature of the Enterprise Manager.  The Tuner typically improves performance by 300% or more, and on Sun's CoolThreads hardware the performance gain can be greater than 600%!  The performance tuner does this by taking into account the hardware configuration, and how it is used.  It then recommends configuration changes that will improve your system's performance.  Here's what the tool looks like:

Performance Advisor Tuner Screenshot

As you can see, the UI is intuitive with lots of inline help to guide you.  Your hardware will be automatically inspected to see if you have a homogeneous environment (a cluster of like-hardware machines), if not, you'll be informed about customizing specific instances which have different numbers of cores, RAM, etc.  Reasonable defaults are pre-populated in the form, making it easy to know approximately what the correct response is likely to be.  After you are satisified, click "Next" and you are presented with the list of recommendations.  This includes the steps required to manually apply the changes if you'd rather do it yourself versus allowing the Tuner to do it for you.  If you let the Tuner to do it, it is kind enough to backup your old configuration so you can compare -- or revert -- your original settings.  Many of the settings are configured with "tokens" which can be independently configured per instance in your cluster -- making settings easy to modify for machines which need special settings.

That's it... it really is that simple.  After the changes are applied, you can enjoy tremendous performance gains.  The Sun GlassFish Enterprise Manager Performance Tuner is a must-have for anyone deploying serious applications with GlassFish.

To learn more, check out Anissa's screencast of the Performance Advisor features.  This includes a Performance Tuner demo, plus many of the other features in the Enterprise Manager product.


Tuesday May 06, 2008

Tips for creating a GlassFish Admin Console Plugin

If you're at JavaOne 2008 you've probably already heard about the "Plug into GlassFish v3 Contest".  I'm going to give a few hints here to help get you started.

First, attend the "Plugin into GlassFish with JavaServer Faces and jMaki" lab.  Unfortunately this lab is difficult to get into, but don't worry!  If you are unable to attend the lab on Wednesday night from 6:30PM - 8:30PM, you can visit booth #175 and ask for a copy of the lab.  You can then do the lab exercises on your own time.  Or, if you attend another Hands-on Lab during JavaOne 2008, you can find the GlassFish plugin lab on the DVD (lab #4520).

Ok, now that you've worked on the lab, let me point out a few important things you need to know to be successful.

  1. Come up with a great idea.  In order to win the contest, you will need to have interesting content that appeals to GlassFish users and developers.  Plugins which add-on to GlassFish or highlight existing GlassFish features are also more likely to be picked.
  2. Be aware of your "plugin id."  The plugin id is specified in your "console-config.xml" file.  The value of the "id" attribute on the "console-config" element specifies your "plugin id".  This same value shows up in all urls to pages, images, CSS, and JavaScript.  If you include an aboslute path, you will need to know this value.  For example if your plugin id is "jeopardy," you might have something like this:

    <img src="#{request.contextPath}/resource/jeopardy/glassfish.gif" />

    So obviously your plugin id must be unique.  So make sure you change this value if you're copying code from the plugin lab.

  3. Load your resources from a jar file.  The plugin you create will be an OSGi bundle, which is a jar file.  This means a normal request for a resource (JavaScript, images, etc.) will fail.  However, simply adding "/resource" after your context path will solve this.  See the url in the image tag above for an example.
  4. Adding new Java code is broken.  We have not yet fixed some issues related to finding new Java code added via your OSGi plugin jar file.  To get around this, you must place your new code inside a jar and put the jar in the "<install-root>/lib/install/applications/__admingui/WEB-INF/lib" directory.

If you get stuck, get help.  You can post a question on this blog, email, or visit the GlassFish Pod #175.  We'll be happy to help get you unstuck.

For those of you not at JavaOne, you won't be able to participate in this contest, however, this may be a good way to contribute to GlassFish.  By contributing to GlassFish you may qualify for the GlassFish Awards Program.  Check the GAP program rules for details and earn your share of the $175,000.

Good luck!

Sunday May 04, 2008

GlassFish Birds Of a Feather (BOF) Session at JavaOne 2008

Tuesday night from 7:30PM - 8:20PM, there will be a GlassFish BOF (BOF 7900: GlassFish Application Server: Open Source, Fast, Easy and Reliable) in Gateway 104.  You'll be able to meet with many of the big names behind GlassFish, or get your tough questions answered by GlassFish experts.  In addition, the GlassFish team will challenge the audience to see what they know by playing a round of Glassfish Jeopardy for cool prizes!  This will be a fun BOF and a great networking opportunity -- see you there!

GlassFish game board

Friday May 02, 2008

Don't forget your laptop!

Are you lucky enough to be going to JavaOne 2008?  If so, don't forget your laptop!

This year at JavaOne there will be quite a few Hands-on Lab sessions where you will be able to try out cool technologies rather than just hear about them.  In many of them you'll be given courseware and the software needed to use the technology on your laptop, other labs will provide machines for you to use.

I will be one of the presenters for the "Plug into GlassFish v3 with JavaServer Faces and jMaki" lab.  The lab will show how GlassFish v3 will provide a pluggable platform which enables anyone to extend the functionality provided by the GlassFish v3 administration console.  This is done in the context of our JavaServer Faces application with the help of OSGi bundles and our plugin API for our application.  If you're already signed up, great!  If not, you can try to get in (the lab is already full) or stop by the GlassFish booth #175 in the Pavilion and you can get a copy of the lab to try on your own time.  Oh... and if you do create a GlassFish v3 plugin during JavaOne, you're eligible for a chance to win a Canon PowerShot SD1000 Digital Camera!  See the contest rules for more details.

Thursday May 01, 2008

Where will you be at JavaOne?

Here's my schedule of events I'm considering:

Ken's JavaOne Calendar

I'm unsure about many of them, but I will definitely be at the GlassFish BOF at 7:30 PM on Tuesday, (Gateway 104).  I am speaking at the "Plug into GlassFish v3 with JavaServer Faces and jMaki" Hands-on Lab (Wednesday @ 6:30PM, Hall E 132).  I also helped out with a demo that will be shown during the 1:30 PM General Session on Tuesday, so I don't want to miss that.  Everything else I'll try to make on a best effort basis.

See you at JavaOne!

Wednesday Feb 20, 2008

GlassFish Book Review

A couple months ago I found a book called Java EE Development using GlassFish Application Server.  As a GlassFish developer, I was immediately curious as I hadn't heard anything about this book until it was already published.  Perhaps this is a sign of how popular GlassFish has become.

When I first opened the book and thumbed through it, I was impressed (flattered?) by the number of screen shots of the GlassFish Admin Console -- which for those who don't know is the part of GlassFish I help develop.  The book's chapters are well organized and topics are very easy to find.  The book reads like a well-written tutorial that easily takes someone completely new to GlassFish (or even Java EE) and walks them step-by-step through building applications and learning each major component.  I was impressed.  To give you an idea of the topics covered, here are the chapter titles:

GlassFish Book Cover


  1. Getting Started with GlassFish
  2. Servlet Development and Deployment
  3. JavaServer Pages
  4. Database Connectivity
  5. JSP Standard Tag Library
  6. JavaServer Faces
  7. Java Messaging Service
  8. Security
  9. Enterprise Java Beans
  10. Web Services
  11. Beyond Java EE

So as you can see from the chapter titles, the book covers it all.  However, it's only about 400 pages, so as you can imagine the depth of coverage for any one of these technologies is minimal.  However, this is perfect for an introduction to each of these technologies so that you know what the each one is good for and how to get started with them.  It certainly beats buying and wading through half a dozen different books to come up to speed on all of these technologies!

However, there are a few things in the book that I would have liked to see different.  First, JSP is introduced early and doesn't mention JSF for a few more chapters.  Since this book is aimed at an introductory level, I would have expected the text to at least suggest using JSF instead of JSP before it discussed JSP in detail -- new users should start on JSF instead of JSP, or at least be given the option.  Why learn bad habits from JSP?  In fact, I think the book should have done its readers a favor and deemphasized JSP a lot more in general.  The 2 chapters dedicated to JSP (JSP & later JSTL) should have been combined.

As for the JSF chapter, again it used JSP.  However, in this case, I can see the authors dilemma.  JSP is the only view technology that is immediately available out-of-the-box when GlassFish is installed, but JSP isn't the way anyone should write JSF applications.  In my opinion, the author should have mentioned JSP, maybe showed one quick example... then merged the Facelets section at the back of the book (in the Beyond Java EE chapter) into the JSF chapter.  The majority of the examples should have been using Facelets -- or better yet JSFTemplating (ok I'm biased and I admit it!  BTW, did you know JSFTemplating supports the Facelets syntax and is a GlassFish project?).  While we're at it, throw in Ajax4JSF which would otherwise be left lonely at the back of the book.

Another thing I would have liked to have seen is a chapter, or maybe an appendix, on GlassFish sub-projects explaining what they are (JSFTemplating, Metro, jMaki, Phobos, Grizzly, Sailfin, Shoal, Woodstock, HK2, etc. -- there's a list on the bottom of the GlassFish homepage).  I would have also liked to see a couple paragraphs at the beginning of the book when introducing GlassFish about the GlassFish community.  It could have point users to The Aquarium blog, GlassFish Forums, the GlassFish Wiki, GlassFish IRC Channels, and of course give some information on how to participate in the community.

So, would I recommend this book?  I would absolutely recommend it, to anyone just learning Java EE or anyone that would like a quick overview of everything Java EE offers.  It's also a great book for more experienced developers that may not be familiar with all parts of Java EE.  However, if you're looking for an in-depth book on any one of the topics covered in this book... do the math, the book is 400 pages and covers ALL of Java EE (with lots of screen shots!).

If you're ready to buy the book, here's a link to it on Amazon (I don't get paid if you click on this link... unless someone can tell me how! ;)).


Monday Apr 03, 2006

Jive Forums Gold 5 on GlassFish

In an earlier entry I wrote about Security Manager woes when I attempted to install Jive Forums from Jive Software.  Many applications (including Jive Forums) require privileges that may be considered "unsafe" in some environments -- Java's security manager allows administrators to control the settings ensure applications don't write to disk, send email, load unsafe classes, etc.  However, this can get in the way when a user attempts to install trusted software, yet the server doesn't have security properly configured (and it's not easy to properly configure).

GlassFish has changed.  It no longer enables the security manger by default.  This is consitent with most other application servers and makes deploying applications (such as Jive Forums) much easier.  Here's what I had to do when installing Jive Forums Gold 5 on GlassFish (build 42):

  1. Download Jive Forums files (server + license file) (Find it on: Jive Software's web site)

  2. Copy jiveHome to a new directory

  3. Copy the license file into the new diretory; name it jive.license

  4. Start GlassFish (i.e. asadmin start-domain)

  5. Go to GlassFish's Admin GUI: http://localhost:4848 
    - Applications -> Web Applications -> Deploy
    - Upload "jiveforums.war"
    - Select options (defaults are fine)

  6. Go to the application (I clicked on "Launch" button in Admin GUI)

  7. Message states jiveHome is not set.  Type in the correct path (the new directory from step 2).  Click the update button.

  8. Click continue (everything should have a "success" check now).

  9. Choose embedded DB (you may want something else), click continue.

  10. Click continue (db should be configured properly).

  11. I picked "Default" for authentication. Click continue.

  12. Setup your email server settings. Click continue.

  13. Setup your admin user.  Click continue.

  14. Setup should be complete, click "Login to Admin Tool"

  15. I logged in as "admin" / "<admin-password>"...
That's it... in fact everything after step 6 is just walking through Jive's software setup.  No more security errors, everything just works.

Have fun!





« July 2016