Java的应用程序WS忽略零星参数 [英] Java WS application ignoring arguments sporadically

查看:254
本文介绍了Java的应用程序WS忽略零星参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近把一个JWS应用程序,它得到它的从动态创建的JNLP文件的参数(详细信息,可以发现的这里)。这一切都很好,除了应用程序忽略的参数(不启动加载指定的号码)我的系统(Linux的x86_64的)上。然而,它似乎JWS应用程序完全按照预期我的一个同事的win_64机器上。这是相当有趣的,因为我无法复制他的另一个类似win_64成功。

I have recently put together a JWS application which gets it's argument from a dynamically created JNLP file (details can be found here). It's all good except the application ignores the argument (starts without loading the specified number) on my system (linux x86_64). It seems however that the JWS application exactly as intended on the win_64 machine of a colleague of mine. This is rather interesting as I couldn't replicate his success on another similar win_64.

为了让事情变得更加精彩,同样JWS应用程序工作得很好(换句话说,不忽略参数)当我下载JNLP文件,并在终端上javaws的运行它。

To make things more exciting, the same JWS application works just fine (in other words, doesn't ignore the argument) when I download the JNLP file and run it by javaws on the terminal.

我比较的java.policy和javaws.policy文件并且没有差异。 JNLP文件明确给出了所有的权限,以及jar文件签署的所有罚款(这不能成为问题,否则该应用程序将无法启动的来源,对吧?)。

I have compared the java.policy and javaws.policy files and there are no differences. The JNLP file clearly gives all-permissions, and the jar files are signed all fine (which can't be the source of the problem otherwise the application wouldn't start, right?).

问题1:但是,是什么这个问题取决于

Question 1: So what could this problem depend on?

编辑:我只是设法从一个新的正确的响应(在这个意义上特别)Win32的机器,没有任何明显的Java更新。 问题2:是否有关于这一点我可以检查发生了什么,或者javaws的日志文件,我可以长篇大论推出一个控制台,这样我可以创建自己的自定义日志

I just managed to get proper response from a new (in this particular sense) win32 machine, without any obvious java update. Question 2 : Is there a log file for javaws on which I can check what happens, or alternatively, can I verbose the launch to a console so I can create my own custom logs?

编辑2:顺便说一句,我忘了交代,我还张贴了这个问题的的甲骨文论坛。不管怎么说,对那里的JNLP文件的线程上的详细信息,以防它可能是相关的。

Edit 2: By the way, I have forgotten to mention that I have also posted this question at the Oracle forums, which I should have perhaps mentioned initially as it was politely pointed out there. Anyways, there is more information on the JNLP file there on the thread, in case it might be relevant.

修改3:我来想这个问题可以从属性中发起< JNLP> 标签,一旦生成了JNLP文件。本来 JNLP 标记这个样子是这样的:

Edit 3: I came to think that the problem could be originating from the properties of the <jnlp> tag, upon generating the JNLP file. Originally the jnlp tag looked like this like this:

<jnlp spec="1.0+" codebase="http://mydomain/myapp/" 
    href="my.jnlp">

的问题,这是事实,那就是在在codeBase的申报目录中没有my.jnlp,取而代之的是在飞行中通过一个Perl脚本在cgi-bin目录中创建的JNLP code目录,并返回一个输出流(我认为)。所以我编辑的脚本生成以下标记的JNLP:

The problem with this is the fact that there is no my.jnlp in the the directory declared in the codebase, instead the JNLP code is created on the fly by a Perl script in the cgi-bin directory and returned as an output stream (I think). So I edited the script to generate the JNLP with the following tag:

<jnlp spec="1.0+" codebase="http://mydomain/myapp/" 
    href="http://mydomain/cgi-bin/my.jnlp">

这个实验的结果是:甚至没有GUI启动这个时候...
我发现在Oracle论坛,其中相关的线程有人建议定义的href 以下列方式属性:

The result of this experiment: not even the GUI started this time... I have found a relevant thread on Oracle forums, where it was advised to define the href property in the following fashion:

href="script.jsp?<%=request.getQueryString()%>">

不幸的是没有解决我的问题。

which unfortunately doesn't solve my problem.

问题3:难道此修改适用于我的情况呢?在这种情况下,怎么样?如果没有什么可能导致该问题的任何见解将是严重的AP preciated正如我在胶着状态真的很对我的工作,现在

Question 3: Could this modification be applicable to my situation as well? In that case how? If not any insights on what might be causing the problem would be seriously appreciated as I am really at a stalemate on my work right now

推荐答案

两周JNLP文件的语法和我的CGI脚本摔跤后,我想我终于找到了问题的症结所在。我在这里提下来(在寻找$ P $足够ptentious来回答我的问题的风险)的情况下,别人运行到同样的问题。

After two weeks of wrestling with the JNLP file syntax and my CGI script, I think I finally found the crux of the problem. I am noting this down here (at the risk of looking pretentious enough to answer my own question) in case somebody else runs into the same problem.

的href 的属性&LT; JNLP&GT; 标签,在我的情况显然是不必要的,当取出应用程序启动按预期在Linux和赢系统工作。我不是100%肯定,如果这是确切的原因,但我的理解是,作为JNLP语法是由脚本生成,并直接返回给用户,而不是JNLP文件的地方在文件系统中,的href 财产被指向一个错误的地方,也许造成了一定的那种在不同的操作系统不同的处理冲突的。

The href property of the <jnlp> tag, in my case was apparently unnecessary and when removed the application started working as intended on both linux and win systems. I am not 100% sure if this is the exact reason but my understanding is that as the jnlp syntax is generated from a script and directly returned to the user instead of a jnlp file somewhere in the filesystem, the href property was pointing to a wrong place and perhaps caused some sort of a clash that is handled differently in different OS.

这篇关于Java的应用程序WS忽略零星参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆