[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

JNLP - input parameters not recieved

Posted on 2003-11-26
12
Medium Priority
?
2,160 Views
Last Modified: 2012-06-21
I have two different servers with the exact same .jar and the exact same dynamic .jnlp file.

On one server, when I run it - my application gets the parameters it needs. On the other, it's empty.

On BOTH servers, the HTTP log looks like this:

Nov 26 16:01:54 notus httpd: test.bam - rundod: automode=openwork, user=testuser, user-agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)Nov 26 16:01:55 notus httpd: test.bam - rundod: automode=, user=, user-agent=JNLP/1.0.1 javaws/1.4.2_01 (b06) J2SE/1.4.2_01


The first time the JNLP is called (from the browser) - the arguments are correct (automode & user) - the second time it is called (from javaws) the arguments are empty.

As I said, the http log is the same on both servers, but on one my app gets the arguments and on the other it doesn't. I run it from the same machine, so it can't be differences in the java version.

I know it doesn't get the arguments on one of the servers because I do a println of all arguments passed and look at the Java Web Start log.
0
Comment
Question by:borbjo
11 Comments
 
LVL 3

Expert Comment

by:savalou
ID: 9826255
I think you need to post the code you're using to make the call.

What does it mean that one call is from the browser and the other is from javaws?  

If the log  entries you posted are from one server and the other looks exactly the same, is the javaws http call not supposed to have parameters?  

What is the difference between server platforms?
0
 

Author Comment

by:borbjo
ID: 9830145
>What is the difference between server platforms?

Sorry, it's the same server - but different subdomains.

>What does it mean that one call is from the browser and the other is from javaws?

The app is run with Java Web Start. It seems that JWS produces two requests for the JNLP file. The first when the user clicks on the link in his browser, and the second when JWS downloads / requests the file (as shown in the http log). I output the user agent in the log, and this shows that the first request is from IE and the second is from javaws.

>If the log  entries you posted are from one server and the other looks exactly the same, is the javaws http call not
>supposed to have parameters?  

I do not know. All I know is that on one server my app gets the parameters - and the other it doesn't. Both have parameters in the first request, and none in the second.

Here's the JNLP file (it's PHP):

<?

Header ("Content-Type: application/x-java-jnlp-file");
include("inc/connect.conf");
include("inc/checkAccess.inc");

error_log("test.bam - rundod: automode=$automode, user=".$user->username.", user-agent=".$HTTP_SERVER_VARS["HTTP_USER_AGENT"]);

echo "<?";?>
xml version="1.0" encoding="utf-8"<?
echo "?>";
?>

<jnlp spec="0.2 1.0"
      codebase="<?=SYSTEM_DOMAIN?>"
      href="run.php">
   <information>
      <title>Test Application</title>
      <vendor><?=COMPANY_NAME?></vendor>
      <homepage href="index.html"/>
      <description>Test Application</description>
      <description kind="short">Just a test</description>
   </information>
   <resources>
      <j2se version="1.4+" href="http://java.sun.com/products/autodl/j2se"/>
      <j2se version="1.2+"/>
      <jar href="test.jar" main="true" download="eager"/>
      <jar href="jaxb-ri.jar"/>
      <jar href="jaxb-libs.jar"/>
      <jar href="jaxb-xjc.jar"/>
      <jar href="commons-codec-1.1.jar"/>
   </resources>
   <application-desc main-class="com.xxx.test">
      <argument>user=<?=$user->username?></argument>
      <argument>password=<?=$user->md5password?></argument>
      <argument>serverroot=<?=SERVER_ROOT?></argument>
      <?
            if($automode != "") {
                  echo "<argument>automode=" . $automode . "</argument>";
            }
?></application>
   <security>
      <all-permissions>
   </security>
</jnlp>



0
 
LVL 4

Expert Comment

by:Howie_Ly
ID: 9833928
Assuming PHP runs okay on server#2, then

it could be a problem with your connection to retrieve the username + password?  i.e.

> include("inc/connect.conf");
> include("inc/checkAccess.inc");

Where is it going to for for connect?  Could it be a permission problem if it is a database.. can you run a debug on these two files?  Can you substitute username and password with hard-coded text to establish that this is actually a connection problem?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:borbjo
ID: 9835527
This was my first thought also ..

The PHP runs ok on both servers, if I do a mget of the file I retrieve the correct JNLP with username/password. The third argument is retrieved via GET (eg. run.php?automode=openwork). Also, you can see that the username/password is correct in the first http log entry.

it's just very weird.
0
 

Author Comment

by:borbjo
ID: 9835567
uhm, sorry, I meant wget :)

0
 
LVL 4

Expert Comment

by:Howie_Ly
ID: 9840565
Does it help by fully qualifying the url of
> include("inc/connect.conf");
??

e.g. include("http://mywebserver.com/inc/connect.conf");

I think you're on the right track however.
0
 

Author Comment

by:borbjo
ID: 9848641
It doesn't help even if I remove those lines entirely.

I decided to remove everything that has to do with user-authentication, and removed all includes. The only parameter left is the automode which is recieved via GET (run.php?automode=openwork).

It seems that the file is cached or something, because even if I run the file with run.php?automode=new when I run the app autmode will still be "openwork" - as it was the first time.
0
 

Author Comment

by:borbjo
ID: 9848660
Sorry, I made a mistake .. I had set the href="run.jnlp" (static) which had the autmode=openwork by default when testing on friday.

When I changed back to run.php it turns out that it continues to ignore the input parameter completely so that autmode is empty again.
0
 

Author Comment

by:borbjo
ID: 9866003
I decided to solve the problem by writing a .jnlp file to a temp directory every time my application is run.

This is sort of a "hack" that I'm not totally comfortable with as argument info will be placed in the jnlp for everyone to read (even though the filename is random and it's placed in a directory that doesn't perform file listing).

0
 
LVL 4

Expert Comment

by:Howie_Ly
ID: 9866103
Good to hear you solved it !

Ask for a refund on your points here
http://www.experts-exchange.com/Community_Support/

0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9887973
PAQed, with points refunded (250)

SpazMODic
EE Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question