Argument in JNLP file

Hi Folks,
In JNLP file I see we can give Ariguments in <argument> tag in <application-desc>, but how can i specify argument key and argument value?
like if I give
<argument>testArg<argument> is testArg is the arg name? then how can I specify the value for the argument?
am bit confused here can anyone pls clarify me on this?
Thanks a lot for the support
Cheers
Subash

>
Thats setting the system properties right? >Not so much (AFAIR you can 'set' java.home, but it has no effect). It is simply properties that are accessible to the app. at run-time.
>
I wanted to send command line argument, wher in main(String[] arg) method I wanted to access from the arg[] arrays,
Is there any way to do that? Then what is the purpose of <argument> tag?>That is doable as well. I have seen two common forms of handing arguments with names..
java theapp.jar -foo fooValue -bar barValue
java theapp.jar foo=fooValue bar=barValueThe first presumes all names and values occur in order (1 name, 1 value, 1 name, 1 value..) and arrive at main(String[]) in that order. The second has the '=' sign as delimiter between name and value.
The way they would be specified as arguments is something like..
<application-desc ..>
  <argument>-foo</argument>
  <argument>fooValue</argument>
  <argument>-bar</argument>
  <argument>barValue</argument>
</application-desc>&
<application-desc ..>
  <argument>foo=fooValue</argument>
  <argument>bar=barValue</argument>
</application-desc>

Similar Messages

  • How to pass java.library.path as a VM argument in JNLP file

    I jave a jar file containing reference to sqljdbc4.jar as I am using JDBC to talk with SQL Server. It works fine through eclipse IDE when I give the fillowing VM Argument
    -Djava.library.path=C:\Users\reddys2\Downloads\sqljdbc_4.0\enu\auth\x86. Without this I get the "error message" saying that "failed to load sqljdbc_auth.dll
    Now I would like to bundle working jar file in .jnlp and invoke through browser. I tried to add vm argunment (<property name="java.library.path" value="C:\Users\reddys2\Downloads\sqljdbc_4.0\enu\auth\x86"/> ) in the .jnlp file. But still i am getting "WARNING:Failed to load the sqljdbc_auth.dll cause:no sqljdbc_auth in java.library.path"
    Any help is greatly appreciated. Here are the contents of JNLP file
    =======================================================================================
    ?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0+" codebase="http://xxx.16.19.56:8080/ifsdTools/" href="PF_UserList.jnlp">
    <information>
    <title>Login into PF</title>
    <vendor>XXX XXXX</vendor>
    <description>Provides ability to mirror PF Data base locally</description>
    </information>
    <resources>
         <j2se version="1.4+"/>
         <jar href="PopulateIFSDProjectForgeData.jar" />
         <jar href="Psqljdbc4.jar" main/>
         <property name="java.library.path" value="."/>
         <property name="javax.net.ssl.keyStore" value="NONE"/>
         <property name="javax.net.ssl.keyStoreType" value="PKCS11"/>
         <property name="http.proxyHost" value="proxy1.lmco.com"/>
         <property name="http.proxyPort" value="80"/>
         <property name="java.library.path" value="C:\Users\xxxx\Downloads\sqljdbc_4.0\enu\auth\x86"/>
         <property name="pfProjectId" value="proj1073" />
    </resources>
    <security>
         <all-permissions/>
    </security>
    <application-desc main-class="ifsdTools.PopulateIFSDProjectForgeData" />
    </jnlp>
    =========================================================================================================
    Edited by: 878645 on Apr 26, 2012 3:43 PM

    Thanks for the pointer. Question that I have is I am referencing sqljdbc4.jar in my application, which in turn using sqljdbc_auth.dll.
    Which one should i refernce through <nativelib>. Is it sqljdbc4.jar or sqljdbc_auth.dll.
    have added the following line to the .jnlp.
    <nativelib href="sqljdbc4.jar"/>
    But still it is complaining on sqljdbc_audth.dll. If it is sqljdbc_auth.dll, can I use <nativelib> to pass it.
    In that case does it need to be signed?. If so,
    Is it possible to sign .dll using 'jarsigner'?.
    Edited by: 878645 on Apr 26, 2012 3:43 PM

  • Passing arguments from jnlp file to application

    Hi,
    I am using a jnlp file to launch an application. This is working perfectly. Now I want my application to get some custom properties for making an rmi connection . The only place where I must specify this is in the jnlp file which is dynamically generated. The dynamically generated JNLP file contains:
    <property name="abc.rmi.adapter.host" value="localhost"/>
    <property name="abc.rmi.adapter.port" value="5050"/>
    <property name="abc.rmi.adapter.servicename" value="abc/RMIClientAdapter/"/>
    This does not work.
    However, according to sun only certain types of properties are supported by jnlp for security reason. Is there any way to get over this and have my custom properties. Any help will be appreciated.
    Thanks,
    dasappan

    If you are trying to use RMI, you probably need all-permissions allready.
    for applications requesting all-permissions, all of the properties set in the jnlp file will be set as system properties before the applications "main" is called.
    If you are not using <security><all-permissions/></security>, then only specific trusted properties, plus any begining with "javaws." or "jnlp." will be allowed.
    For properties you just need to pass to yourself, just append "jnlp." to the front of them.
    /Andy

  • How to change the argument input in a jnlp file?

    A question associated with the following few lines of jnlp codes:
    <application-desc main-class="Main">
    <argument>arg</argument>
    </application-desc>
    My question is: "How can 'arg' be changed dynamically?
    Thanks for help.

    Thank Dietz for help.
    I tried the following jsp code. But it can launch the application only when "test2.jnlp" file exists. "argument to change" can't be passed to the application.
    Thanks.
    <% response.setContentType("application/x-java-jnlp-file");
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    out.println("<jnlp ");
    out.println("spec=\"1.0+\" ");
    out.println("codebase=\"http://tang:8080/examples/rtla/\"");
    out.println("href=\"test2.jnlp\">");
    out.println("<information> ");
    out.println("<title>RTLAFrame viewer</title> ");
    out.println("<vendor>XXX, Inc.</vendor> ");
    out.println("<description>RTLAviewer Application Demo</description>");
    out.println("<description kind=\"short\">A viewer.</description> ");
    out.println("<offline-allowed/> ");
    out.println("</information> ");
    out.println("<security> ");
    out.println("<all-permissions/>");
    out.println("</security> ");
    out.println("<resources> ");
    out.println("<j2se version=\"1.3+\"/>");
    out.println("<jar href=\"test.jar\"/> ");
    out.println("</resources> ");
    out.println("<application-desc main-class=\"RTLAFrame\">");
    out.println("<argument>argument to change</argument>");
    out.println("</application-desc> ");
    out.println("</jnlp> ");
    %>

  • argument ignored in jnlp file

    args.length is always 0.
    public static void main(String[] args) {
    if (args.length > 0) {
    //Do something useful
    Here's my jnlp file, with some names changed "to protect the innocent".
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.5+"
    codebase="http://mysite.com/JavaWebStart"
    href="MyApp.jnlp">
    <information>
    <title>My Title</title>
    <vendor>My Company</vendor>
    <homepage href="http://mysite.com/JavaWebStart/MyApp.html"/>
    <description>MyApp Description</description>
    <description kind="short">MyApp Short Description</description>
    <icon href="MyApp.png"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"
    java-vm-args="-Xss1M -Xmx256M">
    </j2se>
    <jar href="MyApp.jar" main="true" download="eager"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/beandt.jar"/>
    <jar href="lib/dbswing.jar"/>
    <jar href="lib/dx.jar"/>
    <jar href="lib/mailapi.jar"/>
    <jar href="lib/postgresql-8.3-603.jdbc3.jar"/>
    <jar href="lib/smtp.jar"/>
    </resources>
    <application-desc main-class="MyApppkg.MainApp">
    <argument>haha</argument>
    </application-desc>
    </jnlp>

    This suddenly started working when I got all-permissions to work. (That was a separate questions I posted on the same day.)

  • Deploying FX as a Desktop App - jnlp file codebase should be...what?

    Howdy,
    If I try and run my deployed JavaFX app on another PC I get an error pointing back to the codebase that NB created in the <appname>.jnlp file:
    codebase="[http://localhost:8082/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/E%3A/JavaFX/Projects/Concentration/Concentration11/dist/]"My main question is, for a standalone desktop FX app you want to distribute, what should the codebase be?
    I assume you don't point to your developer machine's URL because of course that won't exist on someone else's machine. And unlike most web examples, this won't be running from a server.
    Many other examples refer to running the jar file from the command prompt - not acceptable if you are selling an applet, or even just distributing to the general public.
    So how does this work - how do you set up the jnlp file for desktop deployment? And, do you have to manually do this, or is there something I am missing in NB (6.8) ?
    Many thanks in advance.

    Hi Phil and thank you. I admit have been avoiding learning to compile from the command prompt or with other tools due to the ease that NB affords - but it seems that NB is introducing some issues lately.
    I haven't tried the other tools yet, but I thought maybe I could just edit the NB created jnlp file:
    [http://forums.sun.com/about:blank]<jnlp spec="1.0+" codebase="file:/" href="Concentration11.jnlp"> [http://forums.sun.com/about:blank]<information>  <title>*Concentration11*</title>  <vendor>*Gary*</vendor>  <homepage href="http://localhost:8082/servlet/org.netbeans.modules.javafx.project.JnlpDownloadServlet/E%3A/JavaFX/Projects/Concentration/Concentration11/dist/"/>  <description>*Concentration11*</description>  <offline-allowed/>  </information> [http://forums.sun.com/about:blank]<resources>  <j2se version="1.5+"/>  <extension name="JavaFX Runtime" href="http://dl.javafx.com/1.2/javafx-rt.jnlp"/>  <jar href="Concentration11.jar" main="true"/>  <jar href="lib/derby.jar"/>  <jar href="lib/derbyclient.jar"/>  <jar href="lib/derbytools.jar"/>  <jar href="lib/.netbeans-derby_JapaneseWords.jar"/>  </resources> [http://forums.sun.com/about:blank]<application-desc main-class="com.sun.javafx.runtime.main.Main">  <argument>*MainJavaFXScript=dbPackage.Main*</argument>  </application-desc>  <update check="background"/>  </jnlp>Replacing the code base with your file idea, if I try to run from the jnlp file it complains it can't find the resource:
    com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/Concentration11.jnlp
    at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
    <...more...>Sorry to be so dense. Any ideas what I am flubbing up this time?
    Thank you Phil.

  • Console does not launch OVM 3.1.1, Win7x32 Firefox15/IE8 - Empty .jnlp file

    I have installed Oracle VM Manager 3.1.1, and two Oracle VMS servers; all seems to have gone pretty well after some learning curve. After success here, I created Clone of the most recent PeopleTools 8.5.2 and PeopleSoft HCM templates, and was able to start those machines. (Or at least, the Virtual Machine status shows "Running..." - read on.)
    However, when I try to launch the console, I get no success. First, when accessing the VMM server over HTTPS (port 7002), Java doesn't even try to start. Instead, basically, I get a screen blink and nothing else when I try to Launch Console from HTTPS. But when using HTTP:myVMM:7001, I get further. The Java logo appears briefly, and then I get "Application Error - Unable to launch the application" dialog. When I click on Details, I see the following under the Exception tab:
    JNLParseException[ Could not parse launch file. Error at line 0.]
         at com.sun.javaws.jnl.XMLFormat.decode(Unknown Source)
         at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
         at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
         at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
         at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
         at com.sun.javaws.Main.launchApp(Unknown Source)
         at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
         at com.sun.javaws.Main$1.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Looking further into this, the .jnlp that's presented to JAVA by Launch Console is zero bytes in length. What might cause the .jnlp file to be empty?

    Thank you very much for your rapid reply, SPA2! It's encouraging!
    You named the file correctly, and there is only one ovm_rasproxy-ws.jnlp on the system. It is at /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/tmp/_WL_user/ovm_core/tgzc2b/war/ovm_rasproxy-ws.jnlp. It is not empty - has a size of 1028 bytes, and the contents are listed at the bottom of this message.
    I don't know how to start the vncviewer directly from the OVM Manager machine. I did install the package (twice, in fact... and the second time stated "package tightvnc-java-1.3.9-3.noarch is already installed" There are no executables in the tightvnc-java-1.3.9-3.noarch.rpm package, and I have not found indication of what the URL would be. Can you help with that?
    Trying to find the version of Java from http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CCwQFjAB&url=http%3A%2F%2Fwww.java.com%2Fen%2Fdownload%2Finstalled.jsp&ei=cFyOUL6OHpHo8QSrn4GIBg&usg=AFQjCNH6zuZGOL1prgUuefMNfg4eSpEOjQ I see "Something is wrong. Java is not working." So I uninstalled and reinstalled Java. Now it is Java 7 Update 9.
    Also - to further check this out, I did Save instead of Open from Firefox (IE does not give that option). Firefox saved a 0 byte file. I really appreciate the help.
    Contents of ovm_rasproxy-ws.jnlp:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="${Scheme}://${Server}:${ServerPort}/ovm/rasproxy/"
    href="ovm_rasproxy-ws.jnlp?${RequestUri}">
    <information>
    <title>Oracle VM Remote Access Service</title>
    <vendor>Oracle</vendor>
    <homepage>http://support.oracle.com/</homepage>
    </information>
    <resources>
    <!-- Application Resources -->
    <j2se version="1.5+"
    href="http://java.sun.com/products/autodl/j2se" />
    <jar href="ovm_rasproxy-signed.jar" main="true" />
    <jar href="commons-logging-1.1.1.jar" />
    </resources>
    <application-desc main-class="com.oracle.ovm.ras.proxy.RasProxyApplet">
    <argument>-server</argument>
    <argument>${Server}</argument>
    <argument>-service</argument>
    <argument>${Serviceid}</argument> <!--dynamic-->
    ${Credentials}
    </application-desc>
    <security>
    <all-permissions/>
    </security>
    <update check="always"/>
    </jnlp>
    Edited by: Dennis Lovelady on Oct 29, 2012 3:32 AM
    Edited by: Dennis Lovelady on Oct 29, 2012 3:36 AM to answer about installation of tightvnc and about Java version
    Edited by: Dennis Lovelady on Oct 29, 2012 4:10 AM

  • Indicated instalation path of the aplication in JNLP file

    Hi everybody,
    First of all, i would like to apologize about my english. Sorry about it.
    I got a problem with a deploymet of an application using Java Web Start.
    My application deploys correctly but i need a way to indicate where's the path i want to download the app.
    I've been read all documentacion about it but the argument productpath of the JNLP file doesn't works.
    I try a lot of differents ways in JNLP file, like:
    <application-desc main-class="MyPrincipalClass">
    <argument>-java</argument>
    <argument>-productpath</argument>
    <argument>DownloadedPath</argument>
    </application-desc>
    But any of them work.
    I need a way to indicate where the app must be downloaded when JNLP file is executed.
    Thanks in advanced.
    Regards from Isaac.

    ..the boss would like to have the possibility of decide
    where the application would be installed (for example: c:/MyApp/).Win XP?Start | Settings | Control Panel
    Java
    General (tab - default)
    'Temporary Internet Files' Settings.
    'Location:'  ChangeThis is how the end user (or their system administrator)
    can choose the installation location for Java Web-Start
    applications.
    Explain that to boss, and the end user, and I think
    they will be far less interested in the application
    itself offering an independent installation path.
    (after all - If I want my JWS apps. to be stored
    on the 'shared data' drive, I do not want to have
    to configure it for every single Web Start app. -
    just the plug-in - once)
    I've seen that this could be possible using
    productpath property in JNLP but this doesn't work.Huh? I do not know what you are refering to.
    Can you provide a net reference for 'productpath'?
    If chossing installation path it's not possible, ...It is (ultimately - though I want you to talk your
    boss out of such nonsense), as mentioned by
    Orclev using an 'installer' element - but that will be
    at the loss of a lot of other functionality (also as
    mentioned).
    i'd like to know how can obtain (during the
    downloaded process) the path where the
    application is being installed. Still not convinced the app. needs it, but on
    that matter, is your application running in
    a trusted environment? It is far easier to
    determine app. classpath if that is the case
    (in fact I am not sure it can be done in an
    untrusted app. - and that might be a security
    problem).

  • JNLP file failed to run using javaws - NumberFormatException

    Hi all,
    I am clueless about this one. A fresh pair of eyes would be helpful.
    I am trying to run two JNLP files on for running remote consoles on
    2 separate Linux blades.
    Here is one of them:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="https://icn1-bmc:443/">
         <information>
            <title>JavaRConsole</title>
            <vendor>Sun Microsystems</vendor>
            <description kind="one-line">JavaRConsole Console Redirection Application</description>
            <description kind="tooltip">JavaRConsole Console Redirection Application</description>
            <description kind="short">
                JavaRConsole enables a user to view the video display of an
                Andromeda computer equipped with a service processor.  It also enables
                the user to redirect his local keyboard, mouse, CD-ROM and floppy drives to
                the remote computer to give him complete control over the remote machine.
            </description>
        </information>
        <security>
            <all-permissions/>
        </security>
        <resources>
            <j2se version="1.5+"/>
            <jar href="Java/JavaRConsole.jar"/>
            <jar href="Java/RedirLib.jar"/>
            <property name="DEBUGLIST" value="ui,general,video,threads,cdrom,floppy,dispatcher,hid,scsi,network"/>
            <property name="SEV_WARN" value="ilomrc.log"/>
            <property name="SEV_CRIT" value="ilomrc.log"/>
        </resources>
        <resources os="Linux" arch="i386">
            <nativelib href="Java/linuxi386.jar"/>
        </resources>
        <resources os="Windows" arch="x86">
            <nativelib href="Java/win32.jar"/>
        </resources>
        <resources os="SunOS" arch="x86">
            <nativelib href="Java/solarisx86.jar"/>
        </resources>
        <resources os="SunOS" arch="sparc">
            <nativelib href="Java/solarissparc.jar"/>
        </resources>
        <application-desc>
            <argument>8</argument>
            <argument>icn1-bmc</argument>
            <argument>root</argument>
        </application-desc>
    </jnlp>The other file is essentially the same with "icn2-bmc" replacing all
    instances of "icn1-bmc". here is the output of the "diff" command:
    3c3
    < <jnlp spec="1.0+" codebase="https://icn1-bmc:443/">
    <jnlp spec="1.0+" codebase="https://icn2-bmc:443/">
    41c41
    <         <argument>icn1-bmc</argument>
    <argument>icn2-bmc</argument>The command I use to run these files is:
    javaws <filename>The first file runs fine, and opens a remote console to the blade.
    However when I try to run javaws with the second file, it fails to start the
    app, with the foll exception:
    java.lang.NumberFormatException: For input string: "icn2-bmc"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.valueOf(Unknown Source)
         at java.lang.Integer.decode(Unknown Source)
         at com.ami.javarconsole.ui.FrameMain.main(FrameMain.java:1326)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)This is unusual, since it was able to parse "icn1-bmc" just fine.
    Similar exception when I replace hostname with the IP address:
    java.lang.NumberFormatException: For input string: "10.0.19.214"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.valueOf(Unknown Source)
         at java.lang.Integer.decode(Unknown Source)
         at com.ami.javarconsole.ui.FrameMain.main(FrameMain.java:1326)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)Any clues? Let me know if you need any more information?
    Message was edited by:
    amateurPro

    I was about to post a question in the forums for this same issue, but I thought I'd reply to this thread instead. I am actually getting a fairly consistent error with this code. Here's my scenario:
    I'm running an OSD TS which performs a "Format and Partition Disk" task immediately before an "Apply Operating System" task (well, almost immediately... there are a few tasks for setting custom variables and whatnot in between). The Format
    and Partition Disk task returns a success code. The Apply Operating System task returns these lines (edited for relevance) with the command line "OSDApplyOS.exe /image:PRI00011,1 /target:C: /runfromnet:False":
    'C:\' not a removable drive
    The volume C:\ exists and is a local hard drive.
    The volume C:\ is using a valid file system.
    Windows target partition is 0-1, drive letter is C:\
    Verifying boot volume is NTFS.
    * Boot volume D:\ is not valid: unsupported file system. Please ensure the boot volume file system on the system you are applying the image to is NTFS. The request is not supported. (Error: 80070032; Source: Windows) *
    I am specifying in the Apply Operating System task to apply the OS to a specific logical drive letter (C:). The odd part is that if I reboot the computer and run the task sequence again, it goes through just fine... every time. Thanks for your help.
    * EDIT: I'm running SCCM 2012 R2.

  • Dynamic generation of jnlp file

    I'm dynamically generating a jnlp file using a jsp to pass run-time parameters over to my Java application thusly:
    <%
    response.setContentType("application/x-java-jnlp-file");
    String userName = request.getParameter("username");
    String password = request.getParameter("password");
    String batchId = request.getParameter("batchid");
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    out.println("<jnlp ");
    out.println("spec=\"1.0+\" ");
    out.println("codebase=\"http://server/directory\" ");
    out.println("href=\"this jsp file\">");
    ... other jnlp stuff...
    out.println("<application-desc main-class=\"myApp.myClass\">");
    out.println("<argument>" + userName + "</argument>");
    out.println("<argument>" + password + "</argument>");
    out.println("<argument>" + batchId + "</argument>");
    out.println("</application-desc>");
    out.println("</jnlp>");
    And use args[] to attempt to get the passed parameters in the Java application:
    userName = args[0];
    password = args[1];
    batchId = args[2];
    However, they don't seem to be passed over to the application as I get NullPointerExceptions. If I try to trace the state of the arguments by adding:
    FileOutputStream f = new FileOutputStream("w:output.txt");
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(f, System.getProperty("file.encoding")));
    w.write("userName: " + userName);
    w.write("password: " + password);
    w.write("batchId: " + batchId);
    f.flush();
    f.close();
    The output file is completely empty.
    1. Am I passing the arguments in wrongly?
    2. Why is the output not being written in the file?
    My thanks in advance for any assistance offered.
    Erkton

    Erkton,
    I use a similar approach and it does work. The main gotchas I found were typos. I would suggest temporarily changing the
    response.setContentType("application/x-java-jnlp-file");
    line to
    response.setContentType("text/xml");
    and looking at your JNLP file as XML and verifything that you got everything write. Look for beginning and end tags, stuff like that.
    Once you have it right then switch it back to JNLP.
    One other thing to look out for is Internet Explorer doesn't like jnlp files unless they end with a .jnlp extension. I had to rename my jnlp files to end with .jnlp instead of .jsp for IE to parse them correctly. I don't think thats the issue you are running into, but you may want to look out for it.

  • Passing arguments in JNLP not working

    I am trying to send arguments to my web start application in the JNLP file attached below.
    But my application claims that there are no arguments passed to its main program.
    This is under JDK 1.4.2 and Windoze XP.
    Has anyone seen this problem or seen it work? I must be doing something simple wrong, but no apparent error messages.
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for THREDDS Data Viewer -->
    <jnlp spec="1.0" codebase="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/" href="Viewer.jnlp">
    <information>
    <title>Start THREDDS Data Viewer with selected dataset</title>
    <vendor>Unidata</vendor>
    <homepage href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/index.html"/>
    <description>THREDDS Data Viewer</description>
    <description kind="short">Prototype client for THREDDS Data servers. </description>
    <icon href="Viewer.gif"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.4" max-heap-size="512m"/>
    <jar href="threddsViewer.jar"/>
    <jar href="threddsViewerResources.jar"/>
    <jar href="threddsViewerResourcesOptional.jar" download="lazy"/>
    <extension name="THREDDS common" href="../common/common.jnlp"/>
    <extension name="SunExtensions" href="../SunExtensions/SunExtensions.jnlp"/>
    <extension name="xml" href="../xml/xml.jnlp"/>
    <property name="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    <property name="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    </resources>
    <application-desc>
    <argument>-dataset</argument>
    <argument>catalog=http://localhost:8080/thredds/catalog.xml&dataset=IDVtest</argument>
    </application-desc>
    </jnlp>
    THANKS!

    I tried running this with 1.5.0-beta1
    webstart reports that the signature is bad on one of the signed extensions, and will not run
    (http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/Viewer.jnlp)
    However the jnlp cache viewer can show the interpretation of the jnlp file. It shows:
    <jnlp spec="1.0" codebase="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/" href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/Viewer.jnlp">
    <information>
    <title>THREDDS Data Viewer </title>
    <vendor>Unidata</vendor>
    <homepage href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/index.html"/>
    <description>THREDDS Data Viewer</description>
    <description kind="short">Prototype client for THREDDS Data servers. </description>
    <icon href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/Viewer.gif" kind="default"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se max-heap-size="536870912" version="1.4"/>
    <jar href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/threddsViewer.jar" download="eager" main="false"/>
    <jar href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/threddsViewerResources.jar" download="eager" main="false"/>
    <jar href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/Viewer/threddsViewerResourcesOptional.jar" download="lazy" main="false"/>
    <extension href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/common/common.jnlp" name="THREDDS common"/>
    <extension href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/SunExtensions/SunExtensions.jnlp" name="SunExtensions"/>
    <extension href="http://www.unidata.ucar.edu/projects/THREDDS/tech/webstart/xml/xml.jnlp" name="xml"/>
    <property name="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    <property name="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    </resources>
    <application-desc main-class="thredds.viewer.Main"/>
    </jnlp>
    ie: no arguments.
    looking at the file in the cache, I see the same thing.
    it has no <argument>-dataset</argument> in the application-desc
    /Dietz

  • Jnlp file wont open

    Hello when leopard switches on after the login, a black window Terminal opens with some text in it.
    Also i cant open jnlp files as i get this window instead of opening the jave file that let's me use a chat window. How do i handle this ? everything was working last week, now it is not. Thanks guys and the text file window i get when i click the jnlp file is:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="0.2 1.0"
    codebase="https://content10.ilinc.com/download"
    href="">
    <information>
    <title>iLinc</title>
    <vendor>iLinc Communications, Inc.</vendor>
    <description>Installer/Launcher</description>
    <description kind="short">Short Description</description>
    <icon href="https://lms-10.ilinc.com/images/vendor/sedona/java_logo.gif"/>
    <offline-allowed/>
    </information>
    <security><all-permissions/></security>
    <resources>
    <j2se version="1.3+" href="http://java.sun.com/products/autodl/j2se"/>
    <j2se version="1.3+"/>
    <jar href="session.jar" main="true" download="eager"/>
    </resources>
    <resources os="Windows">
    <jar href="windows/client.jar"/>
    </resources>
    <resources os="Mac OS X" arch="i386">
    <jar href="mac.i386/client.jar"/>
    </resources>
    <resources os="Mac OS X" arch="ppc">
    <jar href="mac.ppc/client.jar"/>
    </resources>
    <application-desc main-class="Session">
    <argument>https://lm-learnlinc-3.ilinc.com/il/il.dll/@F/Get/join.lrn?t=l&sa=lm-learnlinc-3 .ilinc.com:80&CurrentVersion=10.2.5.2132&uid=4120984&userLogin=4120984&pw=0f0efb 55603a2e17775895d4dd9c0a17&sid=1941833&rec=&ssa=lm-learnlinc-3.ilinc.com:443&OEM Name=iLinc&alt=https%3A%2F%2Fcontent10.ilinc.com%2Fdownload&csa=content10.ilinc. com&dlpage=https%3A%2F%2Fsedona.ilinc.com%2Fdload&serverguid=8eec1dbf-0ab0-4bca- acb0-f1717e928851&lfile=lang_1&cid=55189&did=&flags=NSC</argument>
    <argument>iLinc-session.jnlp</argument>
    </application-desc>
    </jnlp>

    As for your first problem, as I understand, every time you log in, you get a Terminal window with some text.... Does this happen for all users, or just one? My guess is that you have somehow set something to open up when you log in, so that's what it's doing. You can go to the System Prefs, and then to the Accounts page, and finally to the Login Items tab, and if you see if by any chance you have Terminal set as a login item. If so, highlight it, and click the "minus" button at the bottom. If you don't have Terminal set as a login item, I'd look for some document that opens Terminal when you log in.
    Sorry, but I have no ideas about your 2nd problem. There have been some Java updates lately, so perhaps what was working is no broken. You might try making sure you have the latest version of your "jnlp" file... there may be a new one that works the the newer Java engine.

  • How do you set a parameter value in a jnlp file?

    I am trying to figure out how to assign a value to a parameter within a jnlp file and then call that into the main class file. My main class file is below. I want to set firstName inside of the JNLP config file, but am convinced it is impossible. Any thoughts?
    public class Greeting
    private String firstName;
    public Greeting()
    public String getName ()
    if( firstName == null)
    firstName = "Day";
    return firstName;
    }//end method
    public static void main (String args[])
    Greeting greeting1 = new Greeting ();
    greeting1.getName();
    System.out.printf("%s\n", greeting1.getName());
    }

    In the jnlp file, add the Name as a runtime argument for running the Greeting class from its main(). Then add a constructor like
    public Greeting(string name){
    firstName = name;
    }and then change the Greeting greeting1 = new Greeting ();to Greeting greeting1 = new Greeting (args[0]);A side note, most people on here get all bent out of shape if you don't put your code in the Code formatter on here, in case you didn't know about it before. It's just easier to read.

  • Calling JNLP file via Servlet

    Hi Folks,
    I need to pass runtime parameters to my jnlp file from URL param, like ?requestNum=12345&mergeId=1.
    So I created a Servlet to process the request and add the requestParams at runtime in the JNLP file,
    In the doGet Method I have teh following piece of code,
    String[] args = new String[]{"requsetNum",request.getParameter("requestNum"),"mergeId",request.getParameter("mergeId")};
    response.setContentType("application/x-java-jnlp-file");
    PrintWriter out = response.getWriter();
    //It writes the jnlp content prperly in console,          System.out.println(JnlpFileContentBase.readBeforeArgElementsContent()+JnlpFileContentBase.populateArguments(args)+JnlpFileContentBase.readAfterArgElementsContent());
    //I split the jnlp file content before and after the argument area out.println(JnlpFileContentBase.readBeforeArgElementsContent()+JnlpFileContentBase.populateArguments(args)+JnlpFileContentBase.readAfterArgElementsContent());
    out.close();
    But when i run on server the above the jnlp is not starting up,
    Am i missing something in the doGet method? is the PrintWriter out object is enough to write back the content?
    Please help me to find out what am missing out here.
    Thanks
    Subash

    Hi Andrew,
    Thanks for notifying that, but that due to my testings with several combinations, I copied the file and kept direcly under WEB-INF and under the webapps/ElemFinder and several places to see it could be retried or not. And hence copied one of the errors. Nothing worked btw.
    I suspected initially it could be because of calling another jnlp file, but now i have my consolidated single jnlp file, but still have the FileNotFoundException for the jar file I have,
    sb.append("<jar href=\"WEB-INF/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar\"/>\n"); // code from Servlet
    This is the firs jar resource under the resource elements
    Where I get the Exception,
    java.io.FileNotFoundException: http://localhost:8080/ElemFinder/ElemFinderEngineInvoker/WEB-INF/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
    I think its basically issues with reading the resource files,
    I tried with several options for this file either, placing under WEB-INF, under webapps/ElemFinder ... etc. Nothing seems to be working,
    Any entries to be put in web.xml for this?
    Pls help me to get rid of this....
    Thanks
    Subash
    PS: BTW i dint try in teh util u gave sice the jnlp already is downloading from my App, do you think still needed to check in the util?

  • Chinese Char support in JNLP file

    Hi All,
    We have to support the chinese char in jnlp file as jar file name.
    Can we support this .
    Kindly provide this information we anybody new about this ...
    Thanks in advance for your support.
    Regards,
    Piyush

    >
    Thats setting the system properties right? >Not so much (AFAIR you can 'set' java.home, but it has no effect). It is simply properties that are accessible to the app. at run-time.
    >
    I wanted to send command line argument, wher in main(String[] arg) method I wanted to access from the arg[] arrays,
    Is there any way to do that? Then what is the purpose of <argument> tag?>That is doable as well. I have seen two common forms of handing arguments with names..
    java theapp.jar -foo fooValue -bar barValue
    java theapp.jar foo=fooValue bar=barValueThe first presumes all names and values occur in order (1 name, 1 value, 1 name, 1 value..) and arrive at main(String[]) in that order. The second has the '=' sign as delimiter between name and value.
    The way they would be specified as arguments is something like..
    <application-desc ..>
      <argument>-foo</argument>
      <argument>fooValue</argument>
      <argument>-bar</argument>
      <argument>barValue</argument>
    </application-desc>&
    <application-desc ..>
      <argument>foo=fooValue</argument>
      <argument>bar=barValue</argument>
    </application-desc>

Maybe you are looking for

  • Hp prime Copy and pasting problems

    Does any one know why the HP prime copy and paste function does not work properly. For example when I copy and past form the spreadsheet to the statistics 1 var app nothing happens. Perhaps there is a work around that will allow me to avoid this prob

  • Got "java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size" Err

    System :jrockit-R27.4.0-jdk1.5.0_12 4 GB RAM 3GB Switch JVM Setting: <java classname="com.nomis.documentmgmt.scenario.OptBuildBaselineScript" fork="yes" failonerror="true" maxmemory="1536m"> <jvmarg value="-client"/> <jvmarg value="-Djava.library.pat

  • Photoshop CS5 Actions Error

    When running a favorite action of mine using CS5, I get the error "The Command Name Is Not Currently Available".  Exactly what is missing from CS5 that was there in previous versions?

  • How to store Employee's working history ?

    Hi gurus, At present I've a problem with storing employee information for the following : 1. Working history for an employee ( At our company ) , For example : The employee has joined in how many projects , Time , Positions....... (How can I store th

  • Test Web Service Method  - -  FAILED

    Hi, I was going through a tutorial on Accessing webs services and when I try to test my method it fails. The ensuing error box shows ; InvocationTargetException com.sun.rave.websvc.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:459) c