JNLP - input parameters not recieved

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.
borbjoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

savalouCommented:
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
borbjoAuthor Commented:
>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
Howie_LyCommented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

borbjoAuthor Commented:
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
borbjoAuthor Commented:
uhm, sorry, I meant wget :)

0
Howie_LyCommented:
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
borbjoAuthor Commented:
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
borbjoAuthor Commented:
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
borbjoAuthor Commented:
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
Howie_LyCommented:
Good to hear you solved it !

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

0
SpazMODicCommented:
PAQed, with points refunded (250)

SpazMODic
EE Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.