Java Web Start
Hi,
I"m new to using Java Web Start, i have built a basic applicatino in java, and when i try to run my application using java web start i get the following error message:
first screen: Unable to launch the specified application
and when i click on details i get the following :
An error occurred while launching/running the application.
Category: Invalid Argument error
Too many arguments supplied: {-splash, 2576, C:\Program Files\Java\jre1.5.0_11\lib\javaws\miniSplash.jpg }
note: when debugging using java web start, i am capable of seeing my application run properly.
# 1
What is the content of the JNLP file?Has it been validated against the DTD?
# 2
How exactly would i validate with the DTD ?
Here is what my jnlp file looks like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN" "http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
<jnlp codebase="file:///C:/Documents and Settings/acheikhali/Desktop/iNetVuMainCtrl" href="iNetVuMainCtrl.jnlp">
<information>
<title>iNetVuMainCtrl</title>
<vendor>C-COM Satellite Systems Inc.</vendor>
<homepage href="www.c-comsat.com"/>
<description>iNetVu Web Interface</description>
<icon href="default"/>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
</resources>
<resources>
<jar download="eager" href="dist/iNetVuMainCtrl.jar" main="false"/>
</resources>
<resources locale="" os="">
<jar download="eager" href="dist/lib/swing-layout-1.0.jar" main="false" version=""/>
</resources>
<application-desc main-class="inetvumainctrl.Main"/>
</jnlp>
note: I used java beans 5.5 in order to build a GUI java application, then i just added the libraries needed (i.e. swing.jar) in the resources section, and some data in the information section as seen above in the code.
# 3
> How exactly would i validate with the DTD ?
I'll come back to that leter, if needed, but..
Beyond valid (& well formed) is having logical
vaules for the attributes. Another matter, while
testing, is to KISS (Keep It Simple Stupid).
Some of the changes I suggest are to
arrive at 'logical'. The three resource
elements were compacted into 1, and
because I suspect your main is in the first Jar,
it has been changed to main='true'
(note that at least 1 jar in an application-desc
must contain a main!).
The res of the changes were to 'Keep it Simple'
while testing, so I removed the icon and shortcut
elements entirely.
Here is the altered file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN"
"http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
<jnlp
codebase="file:///C:/Documents and Settings/acheikhali/Desktop/iNetVuMainCtrl"
href="iNetVuMainCtrl.jnlp">
<information>
<title>iNetVuMainCtrl</title>
<vendor>C-COM Satellite Systems Inc.</vendor>
<homepage href="www.c-comsat.com"/>
<description>iNetVu Web Interface</description>
</information>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
<jar download="eager" href="dist/iNetVuMainCtrl.jar" main='true' />
<jar download="eager" href="dist/lib/swing-layout-1.0.jar" main="false"/>
</resources>
<application-desc main-class="inetvumainctrl.Main"/>
</jnlp>
Also, I am a bit confused by your error
message output, it mentions things that
are not listed in the JNLP file. Is the file
you posted, the exact file that produced
those errors you posted first?
Are the errors being shown in the JWS
console, or by NetBeans?
# 4
thanks for your reply, i appreciate it..
Yes, that is the exact project that I was trying to run with jws. I'm still getting the same errors though when i try to run the project from within netbeans... i tried running it from an internet explorer browser. JWS started up (i.e. the information that i put in the information section about company and vendor, etc.. showed up), but my application would not show..
# 5
> Yes, that is the exact project that I was trying to run with jws.
> I'm still getting the same errors though when i try to run the
> project from within netbeans...
I'll ask you to put netbeans aside for a monent,
since it (seems to be) just getting between us
and the error messages in the web start console.
> i tried running it from an internet explorer browser.
That is one way to run it, but you can also
run it from the command line. I mentioned
that because the project can also be uninstalled
from the command line, and that is what I
would like you to do between each test run.
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/javaws.html#options
If running from the directory that contains the
JNLP, it would be something like..
>javaws -uninstall file:./iNetVuMainCtrl.jnlp
> JWS started up (i.e. the information that i put in the
> information section about company and vendor,
> etc.. showed up), but my application would not show..
OK. Try uninstalling it as above, then run it
from the command line (while current directory
is where the JNLP resides), using
>javaws -codebase file:/. file:./iNetVuMainCtrl.jnlp
Make sure the web start console is configured
to pop up automatically on start, so we can
see the lastest errors it reports.
# 6
using the cmd i uninstalled, and tried to run it from the command line. It still gave me the following error...
Category: Invalid Argument error
Too many arguments supplied: {-splash, 2576, C:\Program Files\Java\jre1.5.0_11\lib\javaws\miniSplash.jpg }
looking at miniSplash.jpg, all it is is a "Java Loading" image.
# 7
I have to admit, I am stumped. It is beginning to sound more like a bad install.Can you run other people's web start projects OK? Amongst my example, here.. http://www.physci.org/jws/..you should be able to find some small,sandboxed test apps.
# 8
Hi, do you have the environment variable JAVAWS_VM_ARGS set ? If so, what is their value?Bye Schippe
# 9
hi,no i dont have anything set in the references tab... how exactly would i go about doing so?thnx for your reply.
# 10
Hi,
the error message seems to complain about some command line parameters.
Because you do not provide any parameters inthe jnlp, they must have been set from outside the jnlp.
One possibility is the environment variable JAWAWS_VM_ARGS. Maybe it is set on your machine even if it wasn磘 you who set it. Its used for instance for debugging webstart applications. So maybe your IDE set it.
On Windows you may check it by typing "set" in command prompt or by opening the Control Panel/System/Advanced/Environment Variables.
Bye Schippe