Problem with Command Line Arguments

Hi all -

I need help. I cannot get my JWS to read my command line arguments.

I have read all the other postings on command line arguments and JWS and I've modeled mine after them, but I still cannot get them to work.

Here's my jnlp file:

<jnlp spec="1.0" codebase="http://devwblgc01:9001/testjws" href="myTest.jnlp">

<information>

<title>My Test</title>

<vendor>Coral Energy</vendor>

<homepage href="http://www.msn.com"/>

<description>Test Client Application</description>

<description kind="short">An applicationfor check out</description>

<icon href="blank.gif"/>

</information>

<security>

<all-permissions/>

</security>

<resources>

<j2se version="1.3"/>

<property name="java.naming.provider.url" value="t3://devwblgc01:9001"/>

<property name="java.naming.factory.initial" value="weblogic.jndi.T3InitialContextFactory"/>

<jar href="smyTest.jar" main="true" download="eager"/>

<jar href="sweblogicaux.jar"/>

<jar href="stibrvj.jar"/>

<jar href="sweblogicClasses.jar"/>

<jar href="sShared.jar"/>

</resources>

<application-desc main-class="com.coral.application.mytest.MyTest"/>

<argument>"one"</argument>

</application-desc>

</jnlp>

and here'smy main method:

publicclass MyTest

{

publicstaticvoid main(String[] args){

System.out.println("Number of args = " + args.length);

for (int i = 0; i < args.length; i++)

System.out.println(args[i]);

}

}

And here's the output:

Java Web Start Console, started Tue Jul 24 14:00:53 CDT 2001

Java 2 Runtime Environment: Version 1.3.0 by Sun Microsystems Inc.

Logging to file: C:\temp\log.tmp

Number of args = 0

The number of args is always zero. I've tried with quotes, without quotes etc etc. But no luck. What am I doing wrong?

Thanks in advance!

DAU

[3146 byte] By [dunchis] at [2007-9-26 1:43:54]
# 1

Hi,

Also I'm not an XML parser I can see that you made a subtle mistake in your hand-crafted XML file. I can recommend my free Venus Application Publisher for JNLP tool collection that helps you build valid JNLP files. You can check it out at http://www.geocities.com/vamp201

Anyhow, I guess you couldn't care less. Here is your mistake:

<application-desc main-class="com.coral.application.mytest.MyTest"/>

should be

<application-desc main-class="com.coral.application.mytest.MyTest">

otherwise you end your application-desc section and Web Start will ignore your arguments.

- Gerald

geraldb at 2007-6-29 2:38:35 > top of Java-index,Desktop,Deploying...
# 2
Hi, I forgot to mention that you can launch Vamp from the web here: http://www.jenomics.de/vamp/venus.jnlp - Gerald
geraldb at 2007-6-29 2:38:35 > top of Java-index,Desktop,Deploying...
# 3
YAY! Thank you thank you thank you!!! I knew it had to be something like that!!!! I'd been staring at it so long I'd gone bug-eyed!Thank you soooooooo much!
dunchis at 2007-6-29 2:38:35 > top of Java-index,Desktop,Deploying...
# 4
it seems the java web start violated the XML rule. Itshould report an error because the jnlp file is nota wellformat XML file. hope Sun could fix the problemsoon.
xudianm at 2007-6-29 2:38:35 > top of Java-index,Desktop,Deploying...
# 5
What if your argument isn't know until run time (eg: is passed in a query string via a link) ?Can JWS handle ?
mesas at 2007-6-29 2:38:35 > top of Java-index,Desktop,Deploying...