|
|
||
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 gerald@vamphq.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)
dietz333
writes:
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 javaw.exe
%service.home%
-
The path to where the wrapper service and policy file is to be installed
Configure the wrapper and place it into %service.home%
.
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 %service.home%
.
Create a file containing the contents of DeploymentProperties,
changing the deployment.javaws.jre.0.path
property to point to the full path of
javaw.exe
(the value of %javaw.cmd%
above),
called deployment.properties
in the deployment.system.home
directory (on Windows, that's %SystemRoot%\Sun\Java\Deployment
).
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)
dietz333
writes:
The arguments Web Start (javaws
) uses when
kicking off the Java runtime (java
)
change from version to version.
To see what your Web Start copy uses under the hood
turn on the environment variable JAVAWS_TRACE_NATIVE=1
and fire off Web Start
on the command line
e.g. javaws.exe http://java.sun.com/products/javawebstart/apps/notepad.jnlp
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.
sirwio
responds:
Thanks for your tip.
Setting the env variable JAVAWS_TRACE_NATIVE=1
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.system.home=C:\WINDOWS\Sun\Java\Deployment"
"-Djnlpx.deployment.user.home=C:\Documents and Settings\sirwio\Application Data\Sun\Java\Deployment"
keefie59
reports:
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?
dietz333
answers:
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 (java
).
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 deployment.properties
file,
or using the preference Java tab panel to add this Java runtime
to those pre-configured.
osbald
clarifies:
You can also bang the TraceStartup
flag into the command line
with -XX:TraceStartup=true
like this:
%JAVA_HOME%/jre/bin/javaw.exe %DEBUG% %WS_OPTS% -XX:TraceStartup=true -classpath %CP%
com.sun.javaws.Main http://localhost:28080/wf-v2.1/SecurityEventViewer.jnlp
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"?
mickfinnfro
writes:
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[1].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 web.xml
.
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:
You need 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:
.root
in the root of each
jar).
this.getClass().getResources('.root')
jar:
and the trailing !/.root
, then
canonify (straigthen) them using file objects and concatenate (glue) them
toghether with the path.separator
property.
java.class.path
system property and voila off you go.
mxc4
responds:
Just to let you know. The best way to handle this
is to pre-compile the xml report into the class that
gets the .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 dori.jasper.engine.design.JRBshCompiler
to compile to jasper files.
Q: How can I use Jakarta commons-logging together with Web Start?
jfarnham
asks:
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
NullPointerException
thrown from commons-logging's LogFactory
,
presumably because it's unable to initialize something needed to set up logging resources.
sbshankar
answers:
I ran into the same problem, in order to fix this you have to add this to your VM parameters:
-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
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
-Djms.properties=jms_client.properties
,
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 deployment.properties
file:
deployment.javaws.secure.properties="jms.properties"
(assuming Web Start 1.2 or 1.4.2)
This invokes the Java runtime with the arg -Djms.properties=jms_client.properties
mickfinnfro
mxc4
sbshankar
dietz
dietz333
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 |