Ok, hope someone can help me with this one, I'm totally stuck. The whole problem is very strange:
I have two domains on one server that both contain the same dynamic jnlp file and the same .jar file that is run using the jnlp (that is; copies of the same .jnlp and .jar in two different directories on the same server).
On one domain, when I run it - my application gets the parameters it needs. On the other, the parameters are empty.
On BOTH domains, the HTTP log looks exactly the same:
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
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.
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.
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=" <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>
The file runs correctly on both domains (I check the error log). If I use wget to download the file - both will give me a correct JNLP file with the correct arguments filled in.
I have two domains on one server that both contain the same dynamic jnlp file and the same .jar file that is run using the jnlp (that is; copies of the same .jnlp and .jar in two different directories on the same server).
On one domain, when I run it - my application gets the parameters it needs. On the other, the parameters are empty.
On BOTH domains, the HTTP log looks exactly the same:
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
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.
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.
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=" <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>
The file runs correctly on both domains (I check the error log). If I use wget to download the file - both will give me a correct JNLP file with the correct arguments filled in.