<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Jim Driscoll&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/" />
<modified>2008-06-26T22:05:44Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, driscoll</copyright>
<entry>
<title>Mojarra&apos;s JSF 2.0 EDR1 ships</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/06/mojarras_jsf_20.html" />
<modified>2008-06-26T22:05:44Z</modified>
<issued>2008-06-26T22:05:44Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.10042</id>
<created>2008-06-26T22:05:44Z</created>
<summary type="text/plain">The Mojarra Project is proud to announce the release of the JSF 2.0 EDR1 implementation.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>J2EE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[The Mojarra Project is proud to announce the release of the JSF 2.0 EDR1 implementation.
<P>
"EDR" stands for Early Draft Review, so this is a <i>very</i> early snapshot of what we're doing with the new version of JSF.  It should be of interest to anyone who'd like to see where JSF is headed in the months ahead.
<P>
You can download the new API, along with the implementation, from the <a href="https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=9437&expandFolder=9437&folderID=0">Mojarra project download area</a>.  For the folks using the <a href="https://glassfish.dev.java.net/">Glassfish Application Server</a>, the new API will be available via the Glassfish Update Center later today... but remember that this is very early code, so don't update your production machines just yet.  <a href="https://javaserverfaces.dev.java.net/nonav/rlnotes/2.0.0/index.html">Release notes for the EDR1 release of Mojarra</a> are also available.
<P>
The actual JSF 2.0 EDR1 specification is available from <a href="http://jcp.org/en/jsr/detail?id=314">the JCP site</a>.
<P>
For those who'd prefer a more example-laden description of some of the new JSF 2.0 features, please check out <a href="http://blogs.sun.com/rlubke/">Ryan Lubke's blog</a> - he's been blogging about the new 2.0 features since February - skip back a bit in his blog to <a href="http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2">Part 1</a>, and start reading from there.
<P>
As always, we'd love to hear your feedback!  The whole purpose of this release is to get feedback both on the API, as well as on the implementation of it, so feel free to leave comments either here, on <a href="http://forum.java.sun.com/forum.jspa?forumID=427">our forum</a>, or on <a href="https://javaserverfaces.dev.java.net/mailinglists.html">the mailing lists</a> - or you could even just file a bug, either on <a href="https://javaserverfaces.dev.java.net/issues/">the implementation</a> or <a href="https://javaserverfaces-spec-public.dev.java.net/servlets/ProjectIssues">the spec</a>.]]>

</content>
</entry>
<entry>
<title>Writing a (bit complex) Glassfish Update Module</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/06/writing_a_littl.html" />
<modified>2008-06-25T21:49:01Z</modified>
<issued>2008-06-24T20:55:35Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.10019</id>
<created>2008-06-24T20:55:35Z</created>
<summary type="text/plain">Creating a program that works with the Glassfish update center isn&apos;t especially hard, but it isn&apos;t very well documented.  This blog is an attempt to remedy that.

I just finished writing a Glassfish update center module.  While simple examples have already been blogged about, this one is a little more complex - it installs a new version of JSF on Glassfish.  I&apos;ll go over some of the things you have to do to make a more complex update than just dropping a zip file into a new directory.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Community: Glassfish</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>
There have already been a few blogs on creating Glassfish addon modules and update center modules.  In particular, the one by <a href="http://weblogs.java.net/blog/manveen/archive/2007/06/creating_a_glas_1.html">Manveen</a> and <a href="http://blogs.sun.com/alexismp/entry/using_the_glassfish_update_center">Alexis</a> are pretty good, and clear.  Please read them first, if you're looking to create an update center module.
<P>
That said, they both only cover a small amount of the information you need.
<P>
I was able to put together the rest of the information required by looking at<a href="https://roller.dev.java.net/source/browse/roller/roller_installers/glassfish_uc/src/javanet/roller/installer/glassfishuc/"> an existing example for Roller</a>, as well as reading <a href="https://updatecenter.dev.java.net/addon/javadoc/api/com/sun/appserv/addons/package-summary.html">some of the API docs</a>.
<P>
First, let's go over the actual structure of the program - there's really three different parts:  The addon module (which has two parts, the installer and the configurator), and the update center module itself.  The addon module is the way to actually modify Glassfish, while the update center module is just a delivery mechanism for the addon module.  In fact, you can run the addon module without the update center by issuing the command <code>asadmin install-addon addonfilename.jar</code>, as well as removing the addon with <code>asadmin uninstall-addon addonname</code>.
<P>
The addon module is divided into two parts - the installer, and the configurator.  The installer runs when the addon is first run, and it knows about the location of the install directory of the App Server.  This is the process that you'd use to actually move all the files around to their proper places.  The configurator runs when you next restart the App Server, and it knows about the location of the server instance that it's started under.  This is the process that you would use to modify the server's configuration, located in the domain.xml file.
<P>
So, with all that in mind, <a href="https://mojarra.dev.java.net/source/browse/mojarra/trunk/updatecenter/">take a look at the code that I wrote</a>, and follow along:
<P>
First, we'll write <a href="https://mojarra.dev.java.net/source/browse/mojarra/trunk/updatecenter/src/com/sun/faces/glassfishuc/GFInstaller.java?rev=4980&view=markup">the installer</a>.  This class implements com.sun.appserv.addons.Installer, and there are two methods that matter to us right now - install and uninstall.  To install, we're going to take two files (jsf-api.jar, and jsf-impl.jar) and put them into the lib directory of Glassfish, backing up the existing jsf-impl.jar.  Uninstall will reverse the process.  First, we need to find destination directory - we do this by using the InstallationContext we're passed as part of the method call:

<pre>
        File appserverDir = ic.getInstallationDirectory();
        String appServerInstallRoot = appserverDir.getAbsolutePath();
        String appServerLibDir = appServerInstallRoot + File.separator + "lib";
        
</pre>

And we also need to find the source for these files - which is the jar that we created for the install.  

<pre>
        String addOnsDir = appServerInstallRoot + File.separator + "addons";
        String installerJar =
                addOnsDir + File.separator + INSTALLER_JAR;
</pre>

Where INSTALLER_JAR is the name of the installer file.
<P>
Now, the rest of the program is just standard unjar, copy, and move commands in Java, except for one last thing:  we also need to place the configurator jar someplace where the starting App Server instance will find it upon next startup.

<pre>
        String addOnsLibDir = appServerInstallRoot + File.separator+ "lib" + File.separator + "addons";
        ....
        File confJarFrom = new File(tmpWorkDir +  File.separator + CONFIGURATOR_JAR);
        File confJarTo = new File(addOnsLibDir +  File.separator + CONFIGURATOR_JAR);
        copyFile(confJarFrom, confJarTo);
</pre>

Where, once again, CONFIGURATOR_JAR is the name of the jar file that holds the configurator information.

<P>
Now we'll talk about <a href="https://mojarra.dev.java.net/source/browse/mojarra/trunk/updatecenter/src/com/sun/faces/glassfishuc/GFConfigurator.java?rev=4980&view=markup">the configurator</a>.  Don't worry, we'll discuss packaging next.  The configurator implements com.sun.appserv.addons.Configurator, and once again, there are two methods we need to be concerned about:  configure and unconfigure.  Our configure method does only one thing:  it loads the domain.xml configuration file into a DOM tree, modifies the part that we need to change, and then writes it back out.  Unconfigure will reverse this process.  First, we need to find the domain.xml file for the running instance:

<pre>
        String domainRoot = cc.getDomainDirectory().getAbsolutePath();
        String domainFilePath = domainRoot 
                + File.separator + "config" 
                + File.separator + "domain.xml";
        File domain = new File(domainFilePath);
</pre>

Then we simply modify the xml and rewrite it in a fairly standard manner.  Note that since we're going to be changing the classpath of the server, a addtional restart is going to be required, for a total of two restarts (one to run the configurator, and one more to change the classpath.)
<P> 
Now, let's talk packaging, because that's the entirety of what's left to do.  <a href="http://weblogs.java.net/blog/manveen/archive/2007/06/creating_a_glas_1.html">Manveen's blog</a> covers this, but it's worth going over again.
<P>
The configurator jar will have two parts - a file, called services/com.sun.appserv.addons.Configurator which contains the name of the file implementing Configurator as it's content, and the class files, including the named file.  Also, the configurator jar file should be named something like addonname_configurator_versionstring.jar by convention.
<P>
The installer jar is similar in structure - a file, named services/com.sun.appserv.addons.Installer containing the name of the file implementing the Installer interface.  The installer jar will also have the files to install, such as jsf-impl.jar in our case, as well as the configurator jar file mentioned above.  This installer jar is the file that you can use with the asadmin install-addon command.
<P>
Lastly, there's the Update Center module jar.  The format of this jar is based on the Netbeans module format.  Pretty simple stuff - there's two top level directories - info and module.  Under module, we have the installer jar file.  Under info, we place a small info.xml file, which is basically just a stub.  Ours looks like this:

<pre>
&lt;module codenamebase="jsf2.0"&gt;
    &lt;description&gt;JavaServer Faces 2.0 EDR1 Release&lt;/description&gt;
&lt;/module&gt;
</pre>
<p>

Lastly, if you want to put this into the official Glassfish Update Center, you'll need an additional xml file - for information on this, check out <a href="http://weblogs.java.net/blog/manveen/archive/2007/06/testing_your_up_1.html">Manveen's Update Center Testing blog</a>.

<P>

So, that's it - how to write an update center module that installs a new library, and adds it to the classpath of the app server in domain.xml.  Hope this helps you.

<P>

UPDATE:  There's a little confusion about how uninstalling works, so it's probably worth a quick note:  GF v2 doesn't support a programmatic unconfigure (or for that matter, uninstall) via the updatetool - when you want to uninstall an installed module, you need to first <b>manually</b> edit a configuration file called domain-registry in your domain's config directory (the same place as the domain.xml file).  You'll find two properties there - change them to "false".  My file looks like this:

<pre>
#Wed Jun 25 13:17:28 PDT 2008
jsf2.0_configurator_01_00_00.configured=true
jsf2.0_configurator_01_00_00.enabled=true
</pre>

Once you've changed these files, bounce the server.  That will run the Configurator's unconfigure method of the configurator class.  Then, uninstall the package either via the updatetool or via <code>asadmin uninstall-addon addonname</code> - that will then run the uninstall method of the installer class.
]]>

</content>
</entry>
<entry>
<title>Comet TicTacToe</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/05/comet_tictactoe_1.html" />
<modified>2008-05-08T02:45:43Z</modified>
<issued>2008-05-08T02:45:36Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.9741</id>
<created>2008-05-08T02:45:36Z</created>
<summary type="text/plain">Here&apos;s the Comet TicTacToe that I went over in my BOF on Comet on Wednesday night.  It&apos;s pretty simple - just 200 lines of Java code (including the game logic), 50 lines of JavaScript (embedded in an HTML page), 50 lines of HTML, and a 75 line CSS file.  Simple stuff, but if you&apos;re looking to write your own Comet app, this might help get you started.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[Here's the Comet TicTacToe that I went over in my BOF on Comet on Wednesday night.  It's pretty simple (though not as simple as <a href="http://weblogs.java.net/blog/driscoll/archive/2008/05/dead_simple_com.html">my first example</a>, or even <a href="http://weblogs.java.net/blog/driscoll/archive/2008/05/solving_the_com_1.html">the somewhat improved version</a>) - just 200 lines of Java code (including the game logic), 50 lines of JavaScript (embedded in an HTML page), 50 lines of HTML, and a 75 line CSS file.  Simple stuff, but if you're looking to write your own Comet app, this might help get you started.
<P>
You can find the full Netbeans project <a href="http://weblogs.java.net/blog/driscoll/archive/javaone08/tictactoe.zip">here</a>.
<P>
Essentially, the program logic is contained in only two files:  ttt1.html, and CometServlet.java.  Check 'em out. After my initial example <a href="http://weblogs.java.net/blog/driscoll/archive/2008/05/dead_simple_com.html">two posts ago</a>, these should be pretty self explanatory.  If you have any questions, by all means ask in the comments below.]]>

</content>
</entry>
<entry>
<title>Solving the Comet timeout problem</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/05/solving_the_com_1.html" />
<modified>2008-05-05T22:07:37Z</modified>
<issued>2008-05-05T22:07:33Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.9667</id>
<created>2008-05-05T22:07:33Z</created>
<summary type="text/plain">In my previous blog, I wondered what the best way to solve the problem on the client of the server connection timing out.  The answer is so obvious that I&apos;m a little embarressed I missed it - it&apos;s the onload event for iframe.  This solution works for both long polling and HTTP Streaming connections that use a hidden iframe.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[In <a href="http://weblogs.java.net/blog/driscoll/archive/2008/05/dead_simple_com_1.html">my previous blog</a>, I mentioned that I didn't like the hack of reloading the iframe via the post action - it's hacky, and it's not hard to imagine it messing things up in a more complex program.
<P>
Turns out the answer is both easy and blindingly obvious once you think of it:  the iframe onload event.  And while we're add it, we'll add a onerror event too.
<P>
In my previous program, I had had a hidden iframe, and on every update, I would reset the source for the iframe using the location property.
<P>
We'll still do that, but add a new function:
<P>
<pre>
       &lt;iframe name="hidden" src="CometCount" frameborder="0" height="0" width="100%"
       onload="restartPoll()" onerror="restartPoll()" &gt;&lt;/iframe&gt;
</pre>
<P>
Note the onload and onerror events - whenever the server closes the connection, these will be called.  And here's the function that's called:
<P>
<pre>
            var retries = 0;
            function restartPoll() {
                if (retries++ > 10) {
                    alert("The connection has errored out too many times");                    
                } else {
                    hidden.location = url;                    
                }
            }
</pre>
<P>
Also, I've added a retry limit in there - it wouldn't do to have the client go into a fatal spin just because the server is down.
<P>
Now when the server closes the connection (from a timeout, or an error), the client will continue to function, automatically calling back into the server.  Not a solution you'll want for every situation, but useful enough, especially for our small example.
<P>
Lastly, there was a bug in my previous version under IE - sorry about that.  It turns out that if you send a POST via IE, you need to have a content body, or IE gets fussy.  The fix is to change the line
<pre>
            xhReq.send(null);
to
            xhReq.send("null");
</pre>
I've uploaded new versions of the files <a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple2/index.html">index.html</a> and <a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple2/CometCount.java">CometCount.java</a>, so you can see the complete code in context.

]]>

</content>
</entry>
<entry>
<title>Dead Simple Comet Example on Glassfish v3 / Grizzly</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/05/dead_simple_com.html" />
<modified>2008-05-04T22:11:07Z</modified>
<issued>2008-05-01T23:02:54Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.9654</id>
<created>2008-05-01T23:02:54Z</created>
<summary type="text/plain">Using Grizzly&apos;s Comet APIs (now available in Glassfish v3), I create a dead simple Comet example, with about 100 lines in two files.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[I was looking at a <a href="http://blogs.sun.com/swchan/entry/a_simple_comet_example_hidden">recent blog by Shing Wai Chan</a> and going through the Comet example, when I noticed that the example wasn't working correctly.  <a href="http://blogs.sun.com/swchan/entry/follow_up_on_a_simple">Although he updated his example to get around that problem</a>, I was still a bit unsatisfied, and decided to sit down, using his basic example, and see if I could make it even simpler.
<p>
I've whittled it down to about 100 lines, and only 2 files, and I thought I'd go over it here.  The full example (both files) are
<a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple/index.html">index.html</a>  and <a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple/CometCount.java">CometCount.java</a>.  So this will be a little long, but if you're tired of reading my rambling, just look at the files, and the code should speak for itself.
<p>
First, about the app:  It's a simple counter, which is updated every time you hit a button on the page.  Pretty basic, except - every other web browser viewing that page will have the counter updated as well, through the magic of Comet. 
<P>
About setting it up: make sure that the url mapping points to /CometCount, the value is hardcoded in a few places.  Also, to compile you'll need access to the Grizzly Comet APIs - you can either get them from Grizzly, or Glassfish v3 tp2.  You'll need to also add the jar in the modules directory named grizzly-optionals to your classpath in order to build, along with the standard Servlet API.  You'll also need to update the domain.xml of the v3 instance to add the property cometSupport=true, as you see below:
<pre>
        &lt;http-listener acceptor-threads="1" address="0.0.0.0" 
           blocking-enabled="false" default-virtual-server="server"
           enabled="true" family="inet" id="http-listener-1" port="8080"
           security-enabled="false" server-name="" xpowered-by="true"&gt;
                &lt;property name="cometSupport" value="true"/&gt;
        &lt;/http-listener&gt;
</pre>
<P>
Now on to the description of the program flow.  On startup, the servet is initialized, and registers itself with with the Comet Engine (make sure the servlet is installed with a url CometCount, or it won't work).  We set a timeout of 2 minutes.
<P><PRE>
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        ServletContext context = config.getServletContext();
        contextPath = context.getContextPath() + "/MyComet";
        
        CometEngine engine = CometEngine.getEngine();
        CometContext cometContext = engine.register(contextPath);
        cometContext.setExpirationDelay(120 * 1000);
    }
</PRE><P>
Then on the first load of index.html in the browser, the hidden iframe makes a call to the doGet of the servlet - this call suspends, awaiting further action.  It does this by attaching the response to a handler (of type CounterHandler), and attaching the handler to the servlet's CometContext.  This also gives rise to the first bug of the program - there's no display of initial result.
<P>
<PRE>
So this:
&lt;iframe name="hidden" src="CometCount" frameborder="0" height="0" width="100%"&gt;&lt;/iframe&gt;
calls this:
   protected void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {
        
        CounterHandler handler = new CounterHandler();
        handler.attach(res);
        
        CometEngine engine = CometEngine.getEngine();
        CometContext context = engine.getCometContext(contextPath);
        
        context.addCometHandler(handler);
    }
</PRE>
<P>
Next, someone, somewhere, who's also using the program, hits the button marked "click".  This calls the onclick method, postMe().  postMe sends an empty POST to the servlet, triggering the doPost method.
<P>
<PRE>
So this:
&lt;input type="button" onclick="postMe();" value="Click"&gt;
Calls this:
            var url = "CometCount";
            function postMe() {
                function createXMLHttpRequest() {
                    try { return new XMLHttpRequest(); } catch(e) {}
                    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
                    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
                    alert("Sorry, you're not running a supported browser - XMLHttpRequest not supported");
                    return null;
                };
                var xhReq = new createXMLHttpRequest();
                xhReq.open("POST", url, false);
                xhReq.send(null);
                hidden.location = url;
            };
</PRE>
<P>
The doPost method increments the counter, and then sends a notify event to the servlet's CometHandler.
<P>
<PRE>
    protected void doPost(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {

        counter.incrementAndGet();
        
        CometEngine engine = CometEngine.getEngine();
        CometContext<?> context = engine.getCometContext(contextPath);
        context.notify(null);
    }
</PRE>
<P>
This event now wakes up that initial GET request, and sends a bit of javascript down the line.  Lastly, we call resumeCometHandler, which marks the current event as completed, removing it from the active queue.
<P>
<PRE>
        public void onEvent(CometEvent event) throws IOException {
            if (CometEvent.NOTIFY == event.getType()) {
                int count = counter.get();
                PrintWriter writer = response.getWriter();
                writer.write("&lt;script type='text/javascript'&gt;parent.updateCount('" + count + "')&lt;/script&gt;\n");
                writer.flush();
                event.getCometContext().resumeCometHandler(this);
            }
        }
</PRE>
<P>
Back at the client, that javascript that got sent down gets put into the hidden iFrame, and then executed.  This calls the updateCount function, which updates the counter with the new value.  Then, we set the iframes' location object, which reconnects with GET to the servlet, and we're ready for our next request.
<P>
<PRE>
            function updateCount(c) {
                document.getElementById('count').innerHTML = c;
                hidden.location = url;
            }

</PRE>
<P>
That is, unless we time out.  If we time out (remember, we set the timeout to 2 minutes, not "infinite"), the iframe goes dead, the GET polling loop is broken, and we never again update the counter on the webpage, though the user's increasing frustrated button pushing on the client will happily update counter on the server.  So, to get around this, we add a single line at the end of our postMe function, updating the hidden iframe's location again.  This is the one really hacky part of the program, and I'd love to know a better way to do it.  Also, it gives rise to the second bug of our program, related to the first - if the connection dies, you need to click the button twice to see an update of the counter on the client.
<P>
So - ta da!  We have a bare bones, long polling comet application in two files and about 100 lines. 
<P>
Again, here's the programs
<a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple/index.html">Download file index.html</a>
<a href="http://weblogs.java.net/blog/driscoll/archive/deadsimple/CometCount.java">Download file CometCount.java</a>
<P>
Jeanfrancois Arcand and I have a BOF on Wednesday night (May 7th, 2008) at JavaOne.  If you're at JavaOne and are just getting started with Comet, come on by.]]>

</content>
</entry>
<entry>
<title>JSF Datatable Howto</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/03/jsf_database_ho.html" />
<modified>2008-05-09T01:11:46Z</modified>
<issued>2008-03-12T18:59:24Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.9350</id>
<created>2008-03-12T18:59:24Z</created>
<summary type="text/plain">I&apos;m currently learning JSF, and wanted to give a little Google link love to a really great guide to learning JSF&apos;s use with databases, especially the Datatable component..

The JSF Datatables Howto (at http://balusc.blogspot.com/2006/06/using-datatables.html) written by BalusC is a great getting started guide to using databases with JSF, and if this is something you&apos;re looking for, check it out...</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[I'm currently learning JSF, and wanted to give a little Google link love to a really great guide to learning JSF's use with databases, especially the datatable component.

The <a href="http://balusc.blogspot.com/2006/06/using-datatables.html">JSF Database Howto</a> written by BalusC is a great getting started guide to using datatables with JSF, and if this is something you're looking for, check it out...

It's quite literally better than any of the books on JSF that I've read on this topic.]]>

</content>
</entry>
<entry>
<title>Patching Java to work on Ubuntu Hardy Heron</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2008/02/patching_java_t.html" />
<modified>2008-02-25T18:04:42Z</modified>
<issued>2008-02-25T18:04:36Z</issued>
<id>tag:weblogs.java.net,2008:/blog/driscoll/22.9265</id>
<created>2008-02-25T18:04:36Z</created>
<summary type="text/plain">The latest Alpha of Hardy Heron breaks all installed Java apps.  Here&apos;s how to patch it to get back up and running.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Linux</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<p>Java's been broken on Hardy Heron for a while, but I just upgraded to Alpha 5 and found out for myself :-(</p>

<p>The symptoms of the bug are a crash with an error message that contains:<br />
<code>xcb_xlib_unlock: Assertion `c->xlib.lock' failed.</code></p>

<p>At <a href="http://daveshuck.instantspot.com/blog/2008/01/29/cxliblock-failed-error-on-Java-applications">Dave Shucks blog</a>, I found a patch that works:</p>

<p><code><br />
LIB_TO_PATCH=libmawt.so<br />
for f in `find /opt -name "$LIB_TO_PATCH"`<br />
do<br />
echo "Patching library $f"<br />
sudo sed -i 's/XINERAMA/FAKEEXTN/g' "$f"<br />
done<br />
</code></p>

<p>Where "/opt" is a directory where you keep your JDKs.</p>

<p>The fix is widely available on the internet, but I thought it was worth restating here.</p>]]>

</content>
</entry>
<entry>
<title>JavaOne meetings starting up</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/09/javaone_meeting.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-09-01T18:26:52Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.5478</id>
<created>2006-09-01T18:26:52Z</created>
<summary type="text/plain">It&apos;s that time again...</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>It's that time again...  JavaOne time.  What?  Barely over the parties from last year?  That's ok - it's in May.  But meetings are starting to determine the content for May, and I thought I'd write a quick blog to ask - what do *you* want to see at JavaOne in May?  I'm working on web track (again), so web related suggestions are especially appreciated.
<P>
My current thought - we're going to have lots of stuff related to modern web practices (i.e., Web 2.0, I don't care for the term).  But like last year, it's going to be a balancing act - we can't have every session be "Introduction to AJAX Programming".   Besides, we try not to cover things two years in a row.
<P>
What do you want to see?  Please leave me comments below.]]>

</content>
</entry>
<entry>
<title>JavaOne Tech Sessions are Up</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/07/javaone_tech_se.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-07-10T17:31:52Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.5167</id>
<created>2006-07-10T17:31:52Z</created>
<summary type="text/plain">A quick notice - the JavaOne technical sessions are online at http://developers.sun.com/learning/javaoneonline/</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[Like all of Sun US, I was off last week, so I apologize if this was already mentioned (and I missed it), but the <a href="http://developers.sun.com/learning/javaoneonline/">JavaOne Tech Sessions for 2006 are now online</a>.<BR><BR>
Enjoy.]]>

</content>
</entry>
<entry>
<title>JavaOne: What worked and what didn&apos;t</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/05/javaone_what_wo_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-19T19:19:59Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.4851</id>
<created>2006-05-19T19:19:59Z</created>
<summary type="text/plain">In a little while, we&apos;re going to have a meeting to discuss the next JavaOne.  While I cringe at the thought, I want to be ready - help me with my list of things that worked and didn&apos;t.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[So, as I've mentioned <a href="http://weblogs.java.net/blog/driscoll/archive/2006/05/schedulebuilder.html">too </a><a href="http://weblogs.java.net/blog/driscoll/archive/2006/05/new_way_to_atte.html">often</a>, I'm on the Program Committee for JavaOne.
<P>
One thing we'll do is have a Lessons Learned meeting, and I want to be ready - so I thought I'd throw out my ideas for what worked and what didn't, and ask for a little help in working on my list.  Here's your chance to kvetch with me!
<P>
First, what worked:  I thought the talks pretty much rocked.  Now, prehaps I'm a little biased, but really, I didn't hit any clunkers.  This is the one thing I DON'T need to worry about for the meeting, since we'll have *very* accurate data on attendance and evaluations.  But I'm pretty pleased with this, since the talks *are* mostly why you came to JavaOne, right?  Also, I thought that the keynotes were mostly OK, and there were some neat demos.
<P>
The food at lunch wasn't bad - for cafeteria food, anyway (ok, it's a low bar).  And the lines for lunch moved more quickly than I would have thought possible, given just how many people were filing through there.
<P>
I'm going to go out on a limb, but I'm going to say that by the last day, the reserved seating thing was working well.  Over and over again, I went to full talks, confident that I'd get in.  The lines moved much faster, crowd control was better, and they had more card readers and docents.
<P>
Then, there's what didn't work:  The stage crew was noticably incompetant.  I watched a speaker beg for his slides to be shown for about 4 minutes - and this was the third time that that had happened to him that talk.  And it happened to him in a previous talk that day.  And he wasn't alone.  Demo screens only on the left side of the room?  Excuse me?  There were lots of problems with audio in 307.  And ask any keynote demo person about the sysadmins... and you'll get an earful.  The WiFi was up and down like a yoyo.  But at least the cardreaders worked better than last year - in fact, I think those worked well.
<P>
A loud audible alarm went off at the end of a speaker's talk - several commented that they would have liked a more subtle 1 minute warning, though other speakers seemed to have no trouble - by watching the clock up on stage.
<P>
I think that covers it - did I miss anything?  Tell me below.  Both bad and good (so we don't forget to do it next time :-)
<P>
See you next year!
<P>]]>

</content>
</entry>
<entry>
<title>Sun, AJAX and JavaScript</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/05/suns_ajax_effor.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-19T18:20:20Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.4763</id>
<created>2006-05-19T18:20:20Z</created>
<summary type="text/plain">In the global discussion of AJAX that&apos;s been happening in the last year, Sun has been largely absent.  That just changed.  And not only do we love JavaScript on the browser, we love it on the server too.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>
Sun started working on a lot of AJAX things about a year ago.  As the manager for the Java Web Tier, that meant that I was pretty involved with most of the work we're doing.  But for the most part, we kept quiet - in large part because we don't like to preannounce things.
<P>
Well, we're now far enough along to talk about things - there' quite a few different things in particular that we've announced this week that merit special attention:
<P>
The old standard of the Blueprints Petstore has gotten a new look, in the new <a href="https://blueprints.dev.java.net/petstore/">Java Petstore 2.0 EA</a> - with lots of AJAXey goodness.  If you haven't checked it out yet, you should.  The Blueprints guys have also been working hard on all getting out <a href="https://blueprints.dev.java.net/ajax.html">all kinds of AJAX related information</a>, including a <a href="https://blueprints.dev.java.net/ajaxcomponents.html">nifty set of JSF AJAX components</a>, that are also usable in <a href="http://developers.sun.com/prodtech/javatools/jscreator/">Java Studio Creator</a>...
<P>
But of course, that's not all - <a href="https://ajax.dev.java.net/">Project jMaki</a> is a really neat wrapping technology (Maki is "wrap" in Japanese) that takes JavaScript widgets and puts them inside JSP and JSF tags in a really simple way - and Greg's got a bunch of components aready done - check it out - there's support for <a href="http://dojotoolkit.org/">Dojo</a>, <a href="http://script.aculo.us/">Scriptaculus</a>, <a href="http://developer.yahoo.com/yui/">Yahoo UI Widgets</a> and <a href="http://www.dhtmlgoodies.com/">DHTML Goodies</a>.
<P>
There's also <a href="https://jsf-extensions.dev.java.net/">JSF Dyamnic Updating</a> - this is a JSF extension library which divides the page into zones, and allows partial updating of pages through these zones.
<P>
Lastly, who says JavaScript needs to just be on the client?  <a href="https://phobos.dev.java.net/">Project Phobos</a> is a framework to allow scripting on the server side.  And since there's native support for JavaScript in Rhino in Mustang, JavaScript is supported out of the box in Phobos - it's really interesting, check it out.
<P>
And of course, there's more on the way - watch <a href="http://developers.sun.com/ajax/">our main AJAX page</a> to hear more.]]>

</content>
</entry>
<entry>
<title>Schedulebuilder Tryout - Day 1</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/05/schedulebuilder.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-17T01:20:21Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.4782</id>
<created>2006-05-17T01:20:21Z</created>
<summary type="text/plain">Looking back at how well the new schedule system worked out, after a full day of use.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>
In a <a href="http://weblogs.java.net/blog/driscoll/archive/2006/05/new_way_to_atte.html">previous post</a>, I talked about how the people who run the conference were planning on having a new way to schedule and attend talks at JavaOne this year.
<P>
Well, first day is mostly done, and I think we've gotten a pretty good idea of how it's working.
<P>
My evaluation is "could be better".  I've yet to see the first 3 slides of <B>ANY</B> talk that I've attended - and I was registered for all of them.  On the other hand - I actually got in to all the talks that I wanted to see - <i>because</i> I was registered (and 2 of them were totally full).
<P>
So - what's the problem?  Crowd control is an issue - the lines are longer, and take longer to traverse, than in previous years.  Which means that crowd control is more of an issue, and was probably not planned for well enough.
<P>
Also, if you're going to stuff 1200 people into a room in 15 minutes, how many stations for reading cards would you have?  Hint:  More than 4.
<P>
And lastly, if you've got a real problem with getting people in quickly, doesn't it make sense to open the rooms up as soon as you can?  So far, they haven't - rooms were closed until 15 minutes before the sessions started, even if the rooms were free.
<P>
So, what can be done about this?  Well, it seems clear that in order for this to be successful, we're going to have to put more people on crowd control, and get more badge readers.
<P>
I know that the organizers are looking hard at this, and I suspect that we'll see improvements tomorrow.  What's your experience?  Please comment below.
]]>

</content>
</entry>
<entry>
<title>New way to attend JavaOne talks</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2006/05/new_way_to_atte.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-05T19:05:28Z</issued>
<id>tag:weblogs.java.net,2006:/blog/driscoll/22.4362</id>
<created>2006-05-05T19:05:28Z</created>
<summary type="text/plain">This year, they&apos;ll be doing things a bit differently for attending talks - no more getting shut out of a talk you&apos;re dying to go to...  But it means you have to plan ahead.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>One nice thing about being <a href="http://weblogs.java.net/blog/driscoll/archive/2005/12/servlet_history_1.html">around this stuff forever</a>:  You end up on all the interesting committees.  I'm on the <a href="http://java.sun.com/javaone/sf/">JavaOne</a> Program Committee, which helps decide the content at JavaOne.
<P>
Every year at JavaOne, we have the same problems - some talks are in big rooms, and you can hear the crickets chirp.  Others are in medium (600 capacity) rooms, and there are people sitting on the floor - or worse, turned away at the door.  We do the best we can at guessing, but it's impossible to get it right 100% of the time.  And hastily thrown together overflow rooms are only a patch on the problem.
<P>
So, JavaOne is going to be run a bit differently this year.  Instead of queueing up outside the talk you wish to attend (or camping in the room prior to the previous talk ending), there's going to be reserved seating.
<P>
No, really... reserved seating.  You'll be required to register ahead of time for the talks you wish to attend, and everyone who's registered will get to go in first.  Only after all the registered people go in will the unregistered people be allowed to go into the room.  This also means that the rooms will be cleared after each talk.
<P>
I have to say, when I first heard this, I was a little skeptical - the Esplanade, in particular, tends to get really crowded with human traffic at every talk change.  Visions of mobs of unhappy people milling about in that narrow corridor quickly sprang to mind.  I wasn't the only one who was skeptical, either.  But the conference organizers assured us that they'd done the same thing for other conferences as well (many as big as JavaOne), and they had answers for every objection that we threw at them.  In the end, we were convinced - moving around 10k+ people is a difficult job, but it's what they do for a living, and they're pretty good at it.
<P>Doing things this way has some obvious benefits - for one thing, it'll allow us to change our plans for how we'll be giving talks <strong>BEFORE </strong>everyone shows up at the door.  It also has some interesting benefits that may not be readily apparent at first glance - such as allowing us to really plan a better JavaOne <em>next </em>year, since we'll finally have a truely accurate attendance number for each talk.
<P>
So, I'm optimistic about the process.  But it will only work if everyone goes out and <a href="http://java.sun.com/javaone/sf/schedulebuilder.jsp">registers for the talks they want to attend</a>.  So, if you've already registered for JavaOne, please don't skip this step.
<P>
As always, I'd love to hear what you think of this idea.  Let me know below.]]>

</content>
</entry>
<entry>
<title>Servlet History</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2005/12/servlet_history_1.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-12-11T04:58:11Z</issued>
<id>tag:weblogs.java.net,2005:/blog/driscoll/22.3769</id>
<created>2005-12-11T04:58:11Z</created>
<summary type="text/plain">I&apos;ve been reading Beyond Java, and since Bruce got some of his facts wrong about the history of servlets, I thought I&apos;d issue a correction.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<p>I've been doing servlets and JSPs longer than any other person on the planet (which in itself is a story for another time), so when I read a few things about the history of servlets in Beyond Java by Bruce Tate, I cringed.  But I realize that such ancient history (10 years ago!) isn't recorded anywhere, so I thought that I'd set the record straight.</p>

<p>In his book, Bruce says:  "In the halls of Netscape, server-side Java emerged.  <I>Servlets</I> (a term originally coined by O'Reilly) made server-driven Internet applications available to application developers.  Sun capitalized on this movement quickly with a standard, and an open source implementation of a servlet engine called Tomcat."</p>

<p>Whoosh, where to start.  Prehaps at the beginning:</p>

<p>Servlets were originally conceived of by James Gosling in 1995, but put aside for other interests.  After some time, the concept was picked up by Pavani Diwanji, who built on the concept to create servlets as part of a project then called Jeeves (from a fictional character).  This project was eventually productized into the Java Web Server, which many of us in Java EE land remember fondly to this day.  I still have a shirt showing Duke in a Tux holding a platter, the symbol for Java Web Server.  And incidently, the first versions of the servlet package were called java.servlet.*, since the javax extension hadn't been invented yet.</p>

<p>Incidently, JSP was invented over a weekend by Anselm Baird-Smith, then later elaborated on as a specification by Satish Dharmaraj (now of Zimbra).  (Just in case anyone was curious.)</p>

<p>The server-side Java container conceived of by Netscape was done as a parallel effort, as was another similar thing done by Oracle.  (I was part of the team that visited both companies to try to sell them on this technology.)</p>

<p>The Tomcat stuff came a few years later, as did the first version of the servlet spec, written by James Davidson.</p>

<p>As for O'Reilly coining the term servlets, I don't know for sure about that, but given the history I do know, I'm skeptical.</p>

<p>There, I've gotten that off my chest.</p>

<p>Know something I don't?  Please comment below.</p>]]>

</content>
</entry>
<entry>
<title>OSI Mailing lists</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/driscoll/archive/2005/10/osi_mailing_lis.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-10-27T21:19:33Z</issued>
<id>tag:weblogs.java.net,2005:/blog/driscoll/22.3503</id>
<created>2005-10-27T21:19:33Z</created>
<summary type="text/plain">The OSI has mailing lists where all sorts of license issues get discussed.  If you like that kind of thing, it&apos;s quite entertaining.</summary>
<author>
<name>driscoll</name>

<email>Jim.Driscoll@sun.com</email>
</author>
<dc:subject>Open Source</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/driscoll/">
<![CDATA[<P>Did you know that the <a href="http://www.opensource.org">Open Source Initiative</a>, aka the OSI, has a mailing list to discuss license issues?
<P>
Neither did I, until a couple of months ago.<P>
<P>
So, if you're the kind of person who likes to watch sausage being made, or you're just an amateur fan of the Open Source license process, go check it out:
<P>
To subscribe to the mailing list, send an email to <a href="mailto:license-discuss-subscribe@opensource.org">
license-discuss-subscribe@opensource.org</a>
<P>
The original pointer on the OSI site is <a href="http://www.opensource.org/licenses/#email">here</a>.  It's a little hard to find without a full read of the site, so I thought I'd help point interested people in that direction.
<P>
So what's discussed on this list?  Well, remember that in order for a license to be called <em>Open Source</em>, that license needs to be approved by the OSI's directors.  This list acts as a group of advisors to the OSI (in classic FOSS fasion, you get a voice by just showing up and making sense).
<P>Currently, it's a little slow, so it's a perfect time to sign up - there isn't any current crisis that's driving email traffic.
<P>Look forward to seeing you there.]]>

</content>
</entry>

</feed>