Solved

JNLP - input parameters not recieved

Posted on 2003-11-26
12
2,127 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
12 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
replace a word with other 1 44
javap bin 2 34
windows explorer path to command prompt 5 44
Is Applet the way to go for my drag and drop system? 8 11
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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.

776 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