Solved

JNLP - input parameters not recieved

Posted on 2003-11-26
12
2,120 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
 

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now