And another thing...
Tim Quinn's Blog

Wednesday Jan 11, 2006

So, suppose you have an existing application or are developing a new one that includes one or more app clients. In this post I try to answer the first few questions you may have about using the new Java Web Start feature in the GlassFish project app server. This post assumes you'll take all the defaults. In later entries I'll talk about how you can override those.

What do developers and administrators have to do so end-users can launch those app clients using Java Web Start technology?

Nothing, other than deploy the application.

How do end-users use the Java Web Start feature to launch app clients?

Do any of the following:

  • Use a browser and enter the URL for the app client.

  • Use the Java Web Start utility javaws and specify the app client's URL as a command-line argument.

  • Place a link to the app client's URL on a web page in the application so end-users can simply click on it.

What's the URL for launching an app client?

For a stand-alone app client in the file MyClient.jar: http://host:port/MyClient

For the app client MyClient embedded in the ear file MyApp.ear: http://host:port/MyApp/MyClient

What happens during the launch?

You'll see some screens about files being downloaded. Don't panic the first time you launch an app client! Remember from my earlier post that there is a lot to bring down to the client. But once it's there all the infrastructure will be reused.

What about the certificate?

You'll also be prompted to accept a certificate.


Briefly, the GlassFish build uses what's called a self-signed certificate which means the build created the cert and there is no trustworthy authority backing up the fact that it was really GlassFish who created it. I'll have more to say on this later. For now, if you have just built or downloaded the app server and have not allowed others to tamper with your installation, you can accept the cert.

What about System.in, System.out, and System.err?

If the app client uses a GUI to display and gather information, then end-users can work with the GUI just as if they had started the app client using the appclient script as in earlier releases of the app server.


On the other hand, if the app client uses System.in to collect input and uses System.out to display output then things are more complicated. To see output you can open the Java Control Panel and in the advanced tab:

  • Open the Debugging group and enable tracing. Each Java Web Start app will create a new trace file in

    /your-home-dir/.java/deployment/log

    or

    C:\Documents and Settings\your-username\Application Data\Sun\Java\Deployment\log

  • Open Java console group and cliek Show console. Each Java Web Start application will automatically open a console output window.

There is currently no way to provide keyboard input via System.in to any Java Web Start application, including app clients. If your app clients requires this, launch the app client using the old reliable appclient script.

Comments:

Hello; JWS with Glassfish is a very good feature ! My client applications works very well with Java 5.0 but doesn't work with Java SE 6.0. Is there any solutions to solve this problem? Thank you for your answer.

Posted by Frédéric Barbier on March 13, 2007 at 02:11 PM CDT #

I'm glad you find this feature useful. Can you explain in what way it does not work with Java SE 6.0? There is a known problem for this that was fixed for Sun Java Application Server 9.0 update release 1. What release of the product - or of GlassFish - are you using that has this problem? If it is older than this please try with a more recent build and see if the problem still exists. If so, perhaps you could turn on tracing (see the blog entry on this topic for details on how to do that) and take a look at the resulting trace file. Thanks. - Tim

Posted by Tim Quinn on March 13, 2007 at 02:52 PM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed