|What's On? | Web Start News | Web Start F.A.Q. | Web Start Forum | The Saturn Times | Web Start Services | Web Start Links | Download | Lopica @ Sourceforge|
I invite you to share your insights, comments, suggestions, or corrections. Please send them to the lopica-talk mailinglist (Subscribe/Unsubscribe) or send a private email to email@example.com (Gerald Bauer) or post your insights to the Web Start Developers Group . The Unofficial Web Start FAQ is a living, growing list of answers, not just a publish-and-forget-it static dead-tree booklet, help to improve it.
Q: Where can I find the Web Start source code? (Update)
Starting with 1.4.2, the Web start source is no longer a separate download package but bundled with the Java runtime source licensed under the Sun Corporate Source License (SCSL) online @ http://wwws.sun.com/software/communitysource/j2se/java2/download.html
Q: How can I start my Web Start app as a Windows Service?
Jayson Raymond has written up all the steps using the Java Service Wrapper in the Seattle Java User Group (SeaJUG) Wiki online @ http://www.seajug.org/vqwiki/jsp/Wiki?JavaWebStartTips
To quote some highlights:
Set the following environment variables:
%jnlpx.home%- Where Web Start has been installed
%javaw.cmd%- The absolute path to
%service.home%- The path to where the wrapper service and policy file is to be installed
Configure the wrapper and place it into
A security policy file is needed to allow the Java Service Wrapper
access to system resources once the Web Start Security Manager takes over.
Place a file containing the contents of WrapperPolicy into
Create a file containing the contents of DeploymentProperties,
deployment.javaws.jre.0.path property to point to the full path of
javaw.exe (the value of
deployment.properties in the
directory (on Windows, that's
Because the service will not be running as
a user, this is where Web Start will find its critical configuration information.
It is in this file you will probably wish to disable its request to create a desktop icon.
Finally, run the wrapper:
Wrapper.exe -i jws.conf
Q: How can I debug apps under Web Start? (Update)
The arguments Web Start (
javaws) uses when
kicking off the Java runtime (
change from version to version.
To see what your Web Start copy uses under the hood
turn on the environment variable
and fire off Web Start
on the command line
Web Start will popup a message box that shows you the full command line
that you can use to kick off your app for debugging.
Thanks for your tip.
Setting the env variable
revealed that I had to add
the following lines in Web Start 1.4.2 which wasn't necessary in Web Start 1.2:
"-Djnlpx.deployment.user.home=C:\Documents and Settings\sirwio\Application Data\Sun\Java\Deployment"
Q: When I attach the debugger the download happens nicely. However, once the download completes my debugger gets detached from Web Start and my Swing app starts up without my debugger. What's going on?
This is caused by a "double launch" where Web Start itself runs on a Java runtime that's not right for your app so it kicks off a different Java runtime for your app instead of reusing its very own.
Try using the
.javawsrc config file (in your home dir)
with the line "
TraceStartup=true" to see the
command Web Start (
javaws) uses to re-launch the Java runtime (
Look in the log file for details.
The double launch is probably caused by using a path
to a "private" Java runtime (that is, a Java Runtime not listed in the Windows registry).
Try editing the
or using the preference Java tab panel to add this Java runtime
to those pre-configured.
You can also bang the
TraceStartup flag into the command line
-XX:TraceStartup=true like this:
%JAVA_HOME%/jre/bin/javaw.exe %DEBUG% %WS_OPTS% -XX:TraceStartup=true -classpath %CP%
The Web Start version you use is critical, 1.0 and 1.2 always kick off a seperate Java runtime for your app - while 1.4.2 (usually) reuses (shares) the Java runtime it runs on.
Q: Why can't Tomcat serve up Web Start XML startup scripts? What's up with "Invalid Argument error: Could not load file/URL specified"?
I get an "invalid argument" error on loading the Web Start XML startup script (aka JNLP file) served up using Tomcat 4.1.27.
When I access the web address (URL) for the startup script, the browser downloads the script (I can see the content using Ethereal) and kicks off Web Start.
So, I assume the MIME type is OK and the download servlet works and serves up the Web Start XML startup script allright.
However, what puzzles me is that it all works with Jetty but once I drop the the Web Start XML startup script into Tomcat 4.1.27, it breaks.
Anyone seen this?
Setup: Web Start 1.2; Java 1.4.1_01 on both ends; Tomcat 4.1.27
The error and log information reads as follows:
Error dialog/General Tab:
An error occurred while launching/running the application.
Category: Invalid Argument error
Could not load file/URL specified: C:\Documents and Settings\mjf860\Local Settings\Temporary Internet Files\Content.IE5\2DQR21KT\cwms.jnlp
The Web Start startup script does in fact NOT exist (the folder does but holds no JNLP scripts), despite the fact that I saw the startup script go over the wire to my own box.
Two days later
mickfinnfro solved the puzzle and writes:
Turns out that Tomcat is sending
no-cache in the HTTP header
and Internet Exploder honors it by not saving the script.
Tomcat throws in a
no-cache HTTP header for all resources
that live within a security-constraint in
After moving the URI in question out of the security constraint,
the Web Start XML script gets saved (cached) on the client
and Web Start works its magic as advertised.
Q: How can I use Web Start and Jaser Reports together?
Patric Bechtel reports:
tools.jar in your app... sigh. That's a real bummer (4.5 megs!).
The problem is that Jasper Reports can't find the jars as
they are not listed in the
java.class.path system property.
Patric offers the hack below as a workaround:
.rootin the root of each jar).
jar:and the trailing
!/.root, then canonify (straigthen) them using file objects and concatenate (glue) them toghether with the
java.class.pathsystem property and voila off you go.
Just to let you know. The best way to handle this
is to pre-compile the xml report into the class that
.jasper extension. Then use this in your web
start app. This spares you from sending down and
compiling the xml. Note though that this trick only works if you
don't change the report layout on the fly, that is to say,
it will only work for static not dynamic reports.
Patric writes in:
The Jasper Reports issue seems to be solved now. Teodor has revamped
the compiling process in Jasper Reports 0.5.0 and you can now use the famous Beanshell (BSH)
from Patrick Niemeyer. Use the
to compile to jasper files.
Q: How can I use Jakarta commons-logging together with Web Start?
I have an client application that uses Apache Axis, which in turn uses Apache commons-logging.
The client works fine from the command line, but dies in Web Start with a
thrown from commons-logging's
presumably because it's unable to initialize something needed to set up logging resources.
I ran into the same problem, in order to fix this you have to add this to your VM parameters:
Q: How can I associate file types with my Web Start app?
Web Start 1.5 (upcoming with Java 1.5 codenamed Tiger) will include new JNLP tags that let you configure file associations.
For a sneak preview of upcoming Web Start goodies check out the Java Won 2003 Dev Pow Wow talk slides titled "What's New in the Java Plug-In and Java Web Start?" by Devananda Jayaraman, Andrew Herrick, and Thomas Ng (Sun) online @ http://servlet.java.sun.com/javaone/sf2003/conf/sessions/display-1486.en.jsp
Q: How can I pass parameters on to the Java runtime (JVM)?
dietz reports a new hack:
The properties set in the jnlp file are set before the main method of the application is invoked,
but unlike properties set on the command line with
they are not set during JVM start-up.
It may be that the jms initialization needs this property to be set up sooner.
You can test this by setting the following line in the
(assuming Web Start 1.2 or 1.4.2)
This invokes the Java runtime with the arg
|Please send comments on our web pages to our public lopica-talk mailinglist or to a member of our web team.||Copyright © 2001, 2002, 2003, 2004, 2005 The Lopica Team|